I have the x,y position of a body that makes roughly circular orbits around a known point. Is there an algorithm that will give me the number of orbits this body makes over time if I feed it a vector of x,y positions? I don't care about variations in the distance of the body from the "origin" of the orbit.
EDIT 1:
My solution so far:
- shift the x,y coords of the body by the x,y position of the orbit origin (i.e. make origin of orbit [0,0])
- compute atan2 of body xy to get radians, then convert to degrees
- shift degrees so that 0 is start location of body
- find all turn points in degree vector (find 359->0 transitions)
- count orbits as number of turn points + remainder