JuliaSpace / SatelliteToolbox.jl

A toolbox for satellite analysis written in julia language.
MIT License
249 stars 33 forks source link

Fix conversion between state vector and orbit elements in equatorial cases #25

Closed ronisbr closed 5 years ago

ronisbr commented 5 years ago

When converting from state vectors to Keplerian elements, the RAAN, argument of perigee, and true anomaly is NaN for equatorial orbits:

julia> sv_to_kepler( kepler_to_sv( Orbit(0.0, 42164e3, 0, 0, 0, 0, 0 ) ) )

                 Orbit
  ======================================
                  t =        0.00000
    Semi-major axis =    42164.0000 km
       Eccentricity =        0.000000
        Inclination =        0.0000 ˚
               RAAN =           NaN ˚
    Arg. of Perigee =           NaN ˚
       True Anomaly =           NaN ˚

Hence, the function rv_to_kepler must account for the special cases.