For example:
Consider a prograde Earth orbit with $\mu = 3.98588738 \times 10^{14} m^3s^{-2}$ semi-major axis $a= 4 \times 10^6 m$ and an eccentricity $\epsilon = 0.3$. Let's ignore the argument of periapsis $\omega$ since the we can just rotate the input coordinates by it.
For a given point along that orbit, say $(2.418542, 1.626223) \times 10^6 m$ (about 126 seconds after periapsis), the eccentric anomaly is about 0.440273 radians.
How can I compute the eccentric anomaly?
To get position from eccentric anomaly, I'm using the first two equations that I found in this answer:
$$x=a\left(\cos\tau-e\right)$$
$$y=a\sqrt{1-e^2}\sin\tau$$
But rearranging either of those equations to isolate $\tau$ gives me a value totally off from where it should be.
I'm working in 2D if that matters. Greatly appreciate any help.
rollback
to undo everything at once. $\endgroup$