I'm trying to write code to go back and forth between equatorial KOE (Keplerian Orbital Elements) and ECEI (Cartesian).
ECEI→KOE I found here: How to programmatically calculate orbital elements using position/velocity vectors?
KOE→ECEI I found on the Wikipedia page for the Orbital Elements which has the equations for x,y of the ellipse which can then be passed through a DCM transform from the orbital plane to the ECEI system.
So this is all well-and-good for a spherical earth. However, the purpose of this is to replace my RK4 integration which takes WGS84 into account with KOE parameters for performance.
I'd greatly appreciate any pointers leading to a method to account for a non-spherical earth.