- Joined
- Oct 26, 2011
- Messages
- 1,232
- Reaction score
- 633
- Points
- 128
For a lua script I want to calculate a state vector from an initial state vector and elapsed time. I know how to do this without perturbations. If I want to include disturbing acceleration due to the oblateness (J2) I need the equatorial state vector.
I think in C++ you can transform the coordinates by using oapiGetPlanetObliquityMatrix, but this doesn't work in lua. I tried many different variants e.g. with spherical equatorial coordinates (longitude, latitude and radius) but I never got accurate results or no velocity vector.
So my question is: How do you calculate the rotation matrix or is there another way to get the equatorial state vector (and thereby the orbital elements) in lua?
I think in C++ you can transform the coordinates by using oapiGetPlanetObliquityMatrix, but this doesn't work in lua. I tried many different variants e.g. with spherical equatorial coordinates (longitude, latitude and radius) but I never got accurate results or no velocity vector.
So my question is: How do you calculate the rotation matrix or is there another way to get the equatorial state vector (and thereby the orbital elements) in lua?