Quasi-satellites
A special case of a three body orbit is that of a quasi-satellite.
bodies=[] b=Body() b.mass=10 b.x=-5 bodies.append(b) b=Body() b.mass=0.01 b.x=5 b.vy=1 bodies.append(b) b=Body() b.mass=0.00001 b.x=9 b.vy=.649 bodies.append(b)
At first glance this is not very interesting. It has a heavy central `Sun', a `planet' a thousand times lighter in a circular orbit, and a small `satellite' another thousand times lighter in an elliptical orbit.
But the orbit of the `planet' and `satellite' have almost the same period. If one considers the position of the `satellite' from the point of view of the `planet', then sometimes it is slightly ahead, and sometimes slightly behind. Sometimes it is closer to the `Sun', and sometimes further from it. But it is always on the same side of the `Sun' as the `planet', and so, to an observer on the `planet', it appears to be orbiting the `planet', not the `Sun'.
Such orbits are not stable, but they do exist, and persist for many orbital periods. Zoozve, a quasi-satellite of Venus, may be the best-known, but there are other quasi-satellites.
Can you modify the code so that the plot is drawn with the `planet' being stationary, and the `Sun' and `satellite' appearing to orbit it?
How could an observer on the `planet' tell that the `satellite' was not orbiting the `planet'?