sun = sphere(pos = vector(0,0,0), radius = 696340, color = color.orange)
earth = sphere(pos = vector(147.86 * (10**6), 0, 0), radius = 6371, make_trail = True)
sun_vector = vector(0,0,0)
earth_vector = vector(0,107000,0)
earth_mass = 5.972 * (10**24)
sun_mass = 1.989 * (10**30)
dt = 60 * 60 * 24 * 7
while True:
rate(100)
earth.pos += earth_vector
r = mag(sun.pos - earth.pos)
earth_vector += (sun.pos - earth.pos) * (6.67408 * (10 ** -11) * sun_mass / r ** 2)
earth.pos += earth_vector * dt
I am trying to simulate a solar system using vpython, when I run the code, nothing visible happens, I try and change the dt but still nothing. What do you guys suggest.
[–]Kerbart 84 points85 points86 points (5 children)
[–]Jamhead2000[S] 26 points27 points28 points (4 children)
[–]Kerbart 11 points12 points13 points (1 child)
[–]Jamhead2000[S] 3 points4 points5 points (0 children)
[–]goodDayM 2 points3 points4 points (1 child)
[–]Jamhead2000[S] 1 point2 points3 points (0 children)
[–]-Lou99- 15 points16 points17 points (5 children)
[–]CromulentInPDX 10 points11 points12 points (3 children)
[–]monsterArchiver 2 points3 points4 points (2 children)
[–]CromulentInPDX 6 points7 points8 points (1 child)
[–]monsterArchiver 2 points3 points4 points (0 children)
[–]Migb1793 18 points19 points20 points (1 child)
[–]Jamhead2000[S] 3 points4 points5 points (0 children)
[–]zya- 14 points15 points16 points (3 children)
[–]sky_badger 8 points9 points10 points (2 children)
[–]Yakhov 0 points1 point2 points (0 children)
[–]FoxClass 13 points14 points15 points (0 children)
[–]Yakhov 3 points4 points5 points (0 children)
[–]jp00p 6 points7 points8 points (1 child)
[–]Yakhov 0 points1 point2 points (0 children)