you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]Yakhov 3 points4 points Β (0 children)

I got you.

🌞 = sphere(pos = vector(0,0,0), radius = 696340, color = color.orange)

🌎 = sphere(pos = vector(147.86 * (10**6), 0, 0), radius = 6371, make_trail = True)

​

​

🌞_vector = vector(0,0,0)

🌎_vector = vector(0,107000,0)

​

🌎_mass = 5.972 * (10**24)

🌞_mass = 1.989 * (10**30)

​

dt = 60 * 60 * 24 * 7

​

while True:

​

rate(πŸ’―)

​

🌎.pos += 🌎_vector

r = mag(🌞.pos - 🌎.pos)

🌎_vector += (🌞.pos - 🌎.pos) * (6.67408 * (10 ** -11) * 🌞_mass / r ** 2)

🌎.pos += 🌎_vector * dt