Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73556735
example10.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 22, 16:30
Size
366 B
Mime Type
text/x-python
Expires
Wed, Jul 24, 16:30 (2 d)
Engine
blob
Format
Raw Data
Handle
19223376
Attached To
rPNBODY pNbody
example10.py
View Options
from
pNbody
import
*
'''
merge two models
'''
nb1
=
Nbody
(
'gadget.dat'
,
ftype
=
'gadget'
)
nb2
=
Nbody
(
'gadget.dat'
,
ftype
=
'gadget'
)
nb1
.
rotate
(
angle
=
pi
/
4
,
axis
=
[
0
,
1
,
0
])
nb1
.
translate
([
-
50
,
0
,
0
])
nb1
.
vel
=
nb1
.
vel
+
[
20
,
0
,
0
]
nb2
.
rotate
(
angle
=
pi
/
4
,
axis
=
[
1
,
0
,
0
])
nb2
.
translate
([
+
50
,
0
,
20
])
nb2
.
vel
=
nb2
.
vel
-
[
50
,
0
,
0
]
nb3
=
nb1
+
nb2
nb3
.
rename
(
'merge.gad'
)
nb3
.
write
()
Event Timeline
Log In to Comment