Trayectoria eliptica
public python v1 · immutablefrom math import *window_coordinates(-100,-100,100,100)create_line(0,-100,0,100,'red')create_line(-100,0,100,0,'red')a = -100.0/30.0m = 50v = 0t = 0dt = 0.1i = 0p = 0x = 50vx = 0y = 0vy = 10ax = 0ay = 0flag = Truewhile (x!=50 or flag): t+=dt xa = x va = v ax = a*(x/sqrt(x**2+y**2)) ay = a*(y/sqrt(x**2+y**2)) vx += ax*dt vy += ay*dt y+=vy*dt x+=vx*dt p = create_filled_circle(x,y,1.5,'black','cyan') #erase(p) flag = False