Kepler's Two Body Orbits In this animation the ellipse a and eccentricity parameters of the orbit of the smaller mass, m1, are adjustable by the learner . In the link below I compute the rate of change, thetaDot, of the angle theta that describes the position of m1 with respect to the focus of its ellipse. Integrating thetaDot to obtain theta, and using the value, r, of the distance of m1 from its focus, the position in the (x,y) plane of m1 is obtained. The position versus time of m1 is then shown by a moving circle. Since the center of mass of the large, m2, and m1 must not move, the position of the larger mass is just the negative of the product of mass ratio (m1/m2) times the vector position of m1. It will probably be noted that m1 strays from its (black) supposed elliptical path when the eccentricity is large. That is due to the very simple way that the program integrates thetaDot to obtain theta. With a longer period this straying is greatly reduced.
Click Here for Orbit Equations
mRatio
a
eps
Single Step