Added more planets, plotting, json AND toml support

This commit is contained in:
Thomas Faour
2025-06-21 21:14:25 -04:00
parent 2859edb62e
commit 19fcf445e4
13 changed files with 1245 additions and 117 deletions
-22
View File
@@ -1,22 +0,0 @@
{
"bodies": [
{
"name": "Earth",
"mass": 5.972e24,
"position": [1.47095e11, 0, 0],
"velocity": [0, 29290, 0]
},
{
"name": "Sun",
"mass": 1.989e30,
"position": [0, 0, 0],
"velocity": [0, 0, 0]
},
{
"name": "JWST",
"mass": 6500,
"position": [149217067274.40607, 0, 0],
"velocity": [0, 29729.784, 0]
}
]
}
-34
View File
@@ -1,34 +0,0 @@
{
"bodies": [
{
"name": "Mercury",
"mass": 3.30104e23,
"position": [4.6000e10, 0, 0],
"velocity": [0, 58970, 0]
},
{
"name": "Venus",
"mass": 4.867e24,
"position": [1.08941e11, 0, 0],
"velocity": [0, 34780, 0]
},
{
"name": "Earth",
"mass": 5.972e24,
"position": [1.47095e11, 0, 0],
"velocity": [0, 29290, 0]
},
{
"name": "Moon",
"mass": 7.34767309e22,
"position": [149982270700, 0, 0],
"velocity": [0, 30822, 0]
},
{
"name": "Sun",
"mass": 1.989e30,
"position": [0, 0, 0],
"velocity": [0, 0, 0]
}
]
}
+81 -10
View File
@@ -1,9 +1,16 @@
# Simulation body configuration
[[bodies]]
name = "Sun"
mass = 1.989e30
position = [0.0, 0.0, 0.0]
velocity = [0.0, 0.0, 0.0]
[[bodies]]
name = "Mercury"
mass = 3.30104e23 # kg
position = [46000000000.0, 0.0, 0.0] # meters
velocity = [0.0, 58970.0, 0.0] # m/s
mass = 3.30104e23
position = [4.6000e10, 0.0, 0.0] # 0.307 AU
velocity = [0.0, 58970.0, 0.0] # m/s
[[bodies]]
name = "Venus"
@@ -15,16 +22,80 @@ velocity = [0.0, 34780.0, 0.0]
name = "Earth"
mass = 5.972e24
position = [147095000000.0, 0.0, 0.0]
velocity = [0.0, 29290.0, 0.0]
velocity = [0.0, 30290.0, 0.0]
[[bodies]]
name = "Moon"
mass = 7.34767309e22
position = [149982270700.0, 0.0, 0.0]
velocity = [0.0, 30822.0, 0.0]
position = [147458300000, 0.0, 0.0] # Earth + 384,400 km
velocity = [0.0, 31372.0, 0.0] # Earth velocity + moon orbital velocity
[[bodies]]
name = "Sun"
mass = 1.989e30
position = [0.0, 0.0, 0.0]
velocity = [0.0, 0.0, 0.0]
name = "Mars"
mass = 6.4171e23
position = [2.279e11, 0.0, 0.0] # 1.524 AU
velocity = [0.0, 24007.0, 0.0] # m/s
[[bodies]]
name = "Jupiter"
mass = 1.8982e27
position = [7.786e11, 0.0, 0.0] # 5.204 AU
velocity = [0.0, 13060.0, 0.0] # m/s
[[bodies]]
name = "Saturn"
mass = 5.6834e26
position = [1.432e12, 0.0, 0.0] # 9.573 AU
velocity = [0.0, 9640.0, 0.0] # m/s
[[bodies]]
name = "Uranus"
mass = 8.6810e25
position = [2.867e12, 0.0, 0.0] # 19.165 AU
velocity = [0.0, 6810.0, 0.0] # m/s
[[bodies]]
name = "Neptune"
mass = 1.02413e26
position = [4.515e12, 0.0, 0.0] # 30.178 AU
velocity = [0.0, 5430.0, 0.0] # m/s
# Dwarf planets and interesting objects
[[bodies]]
name = "Pluto"
mass = 1.303e22
position = [5.906e12, 0.0, 0.0] # 39.482 AU (average)
velocity = [0.0, 4670.0, 0.0] # m/s
[[bodies]]
name = "Ceres"
mass = 9.393e20
position = [4.14e11, 0.0, 0.0] # 2.766 AU (asteroid belt)
velocity = [0.0, 17880.0, 0.0] # m/s
# Some major moons for more interesting dynamics
[[bodies]]
name = "Io"
mass = 8.932e22
position = [7.790e11, 0.0, 0.0] # Jupiter + 421,700 km
velocity = [0.0, 30350.0, 0.0] # Jupiter velocity + Io orbital velocity
[[bodies]]
name = "Europa"
mass = 4.800e22
position = [7.793e11, 0.0, 0.0] # Jupiter + 671,034 km
velocity = [0.0, 26890.0, 0.0] # Jupiter velocity + Europa orbital velocity
[[bodies]]
name = "Ganymede"
mass = 1.482e23
position = [7.796e11, 0.0, 0.0] # Jupiter + 1,070,412 km
velocity = [0.0, 23250.0, 0.0] # Jupiter velocity + Ganymede orbital velocity
[[bodies]]
name = "Titan"
mass = 1.345e23
position = [1.433e12, 0.0, 0.0] # Saturn + 1,221,830 km
velocity = [0.0, 15100.0, 0.0] # Saturn velocity + Titan orbital velocity
-16
View File
@@ -1,16 +0,0 @@
{
"planets": [
{
"name": "Earth",
"mass": 7.342e24,
"position": [0, 0, 0],
"velocity": [0, -1022, 0]
},
{
"name": "Moon",
"mass": 7.34767309e24,
"position": [384400000, 0, 0],
"velocity": [0, 1022, 0]
}
]
}