Orbital utilities relating to classical orbital elements (COE) and converting between (r,v) <=> COE.
More...
|
static bool | CheckHitPlanet (double planetRadius, double planetMass, double3 r1c, double3 v1tc, double3 r2c, double3 v2tc, int nrev) |
|
static bool | COEEqual (COE coe1, COE coe2, bool includePhase, double sizeTol=1E-2, double angleRadTol=1E-3) |
| Determine if two COEs are equal within the indicated tolerances.
|
|
static double3 | COEStructWithPhasetoRVRelative (COEStruct coe, double phaseRad) |
|
static double3 double3 v | COEtoRVatTime (COE coe, double time) |
|
static double3 | COEtoRVRelative (COE oe) |
|
static double3 | COEWithPhasetoRVRelative (COE oe, double phaseRad) |
|
static double | ConvertEtoMeanAnomoly (double eValue, double ecc) |
|
static double | ConvertEtoTrueAnomoly (double eValue, double ecc) |
| Convert the eccentric anomaly (angle from center of ellipse wrt x-axis) to the true anomoly (angle from focus wrt periapsis/x-axis if e=0).
|
|
static double | ConvertMeanAnomolyToE (double M, double ecc) |
|
static double | ConvertMeanToTrueAnomoly (double M, double ecc) |
|
static double | ConvertTrueAnomolytoE (double nu, double ecc) |
|
static void | FindC2C3 (double znew, out double c2new, out double c3new) |
| Taken from Vallado source code site. (Also used in LambertUniversal) Internal use only.
|
|
static double | GreenwichSiderealTime (double jdut1) |
|
static double3 | LaunchPlane (double targetInclDeg, double3 r, double latitudeDeg) |
| Determine the orbit normal for a launch from an point at the given latitude into an orbit of specified inclination.
|
|
static double3 | OrbitAxis (COE coe) |
| Determine the orbit axis (normalized)
|
|
static double | PhaseAngleRadiansForDirection (double3 pos, COE coe) |
| Determine the phase in radians for the specified direction. This can be a point on the orbit but this is not required as only the direction of the given vector is used.
|
|
static double | PhaseForOrbitPoint (COE coe, OrbitPoint point, double deg=0) |
| Determine the phase for a specific OrbitPoint in an orbit (e.g. APOAPSIS)
|
|
static double | PhaseForRadius (COE coe, double radius) |
| Determine phase for a given radius. There are two valid responses, phase and -phase (or 2 Pi - phase). This return +phase.
|
|
static double3 | PositionForCOE (COE coe, double phaseRad) |
| Given a COE and phase (radians) determine the relative position in the orbit. The length scale used will match the length scale used in the COE initialization.
|
|
static double3 | PositionsForR (COE coe, double r) |
|
static double3 | RotateToOrbitFrame (COE coe, double3 r) |
| Rotate a 3D vector specified with respect to the default orbit frame (XY orbital plane) into the 3D space where the orientation is adjusted by inclination, omegaU and omegaL.
|
|
static void | RSWState (ref GEBodyState ship, ref GEBodyState planet, double3 orbitNormal, ref GEBodyState rswState) |
| Given the state of a ship and planet determine the state info in the RSW frame in which: R is the radial vector to the planet S is along track W is cross track (see Vallado 3.3 p159 (5th ed))
|
|
static double3 | RVForOrbitPoint (COE coe, OrbitPoint point, double deg=0) |
|
static COE | RVtoCOE (double3 r, double3 v, double mu, double small=1e-6) |
| Given state information (r,v) and mu=GM determine the classical orbital elements (COE).
|
|
static double | TimeOfFlight (double3 r0, double3 r1, COE coe) |
| Determine the time of flight in COE relevant units that it takes for the body in orbit to go from position r0 to position r1 in an orbit with given COE.
|
|
static double3 | VelocityForCircularOrbitRelative (GEBodyState body, double mu) |
| Compute the 3D velocity for a circular velocity for the given 3D body state (r, v) around a mass with specified mu (=GM)
|
|
static double3 | VelocityForCOE (COE coe, double phaseRad) |
| Determine the 3D velocity vector for a COE at the specified phase.
|
|
static bool | VelocityIsPrograde (double3 r, double3 v_now, double3 v_next) |
| Determine if the given velocities v_now and v_next are both oriented in the same direction around the orbit.
|
|
static double | VelocityMagnitudeForCircular (double r, double mu) |
| Determine the magnitude of a circular orbit for a given radius around a body of given mu.
|
|
Orbital utilities relating to classical orbital elements (COE) and converting between (r,v) <=> COE.
A number of these algorithms originate with Vallado's excellent "Fundamentals of Astrodynamics and Applications" (Microcosm Press) and their adaptations in the original Gravity Engine asset.
There are also some other useful algorithms.
static COE GravityEngine2.Orbital.RVtoCOE |
( |
double3 | r, |
|
|
double3 | v, |
|
|
double | mu, |
|
|
double | small = 1e-6 ) |
|
static |
Given state information (r,v) and mu=GM determine the classical orbital elements (COE).
Classical orbital elements have inherent singularities for: circular orbits (e=0) flat orbits (i=0 or Pi radians)
In this case the sense of how small is zero is set by the optional parameter small
.
In the case of circular orbits there is no closest approach point from which to measure phase nu. For circular orbits the X-axis defines nu=0.
In the case of a flat orbit, there is no ascending node to provide a reference for omegaU. It is set to zero.
See the discussion in the Orbits section of the documentation for other information.
- Parameters
-
r | |
v | |
mu | |
small (optional) threshold for detecting circular/flat orbits | |
- Returns
- COE (struct containing orbit elements)