Skip to content

Commit 1931b52

Browse files
Update two_body.py
1 parent f6c441e commit 1931b52

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

examples/TwoBodies/two_body.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import os, sys
2-
3-
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
4-
if root not in sys.path:
5-
sys.path.insert(0, root)
6-
7-
from tools.icbuilder import particleAdd, save
8-
9-
particleAdd(0, 0, 0, 0, 0, 0, 10)
10-
particleAdd(5, 0, 0, 0, 1, 0, 1)
11-
12-
save("two_body.txt")
1+
import os, sys
2+
3+
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
4+
if root not in sys.path:
5+
sys.path.insert(0, root)
6+
7+
from tools.icbuilder import save
8+
9+
# Build your two-body system manually
10+
particles = [
11+
(0, 0, 0, 0, 0, 0, 10), # massive body
12+
(5, 0, 0, 0, 1, 0, 1), # lighter orbiting body
13+
]
14+
15+
save("two_body.txt", particles)

0 commit comments

Comments
 (0)