This commit is contained in:
Lukian LEIZOUR 2024-08-15 17:25:40 +02:00
parent 40871f7cd5
commit ab87078b21
3 changed files with 21 additions and 0 deletions

View file

@ -70,6 +70,11 @@ class Planet:
n_x = vec_y * -1
n_y = vec_x * 1
n_len = sqrt(n_x ** 2 + n_y ** 2)
n_x /= n_len
n_y /= n_len
self.set_initial_velocity(n_x * v, n_y * v)
class System():
@ -95,6 +100,7 @@ class System():
def main():
window = Tk()
window.title("Simple Grav Sim")
canvas = Canvas(window, bg="black", width=WIDTH, height=HEIGHT)
canvas.pack()