Class GeodeticLibrary
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
Library for converting between different planet coordinates, including: PCI, PCPF, LLA and SEZ
public static class GeodeticLibrary
- Inheritance
-
GeodeticLibrary
Methods
DistanceBetweenGeodeticElements(double, GeodeticElements, GeodeticElements)
Determines the Distance between two Geodetic elements
public static double DistanceBetweenGeodeticElements(double planetRadius, GeodeticElements LLA1, GeodeticElements LLA2)
Parameters
planetRadius
double[m] The radius of the planet
LLA1
GeodeticElementsThe first Geodetic element
LLA2
GeodeticElementsThe second Geodetic element
Returns
- double
[m] The calculated distance between the two elements
GeodeticElem2VectorElem(GeodeticElements, Matrix3, double, double)
Converts from a Lat/Long/Altitude coordinates to planet-centered, planet-fixed coordinates given a planet radius. This assumes that the object is located at the peak of the orbit equal to the lat and lon of the object. This also assumes a circular orbit.
public static VectorElements GeodeticElem2VectorElem(GeodeticElements llaPosition, Matrix3 j20002Pfix, double planetRadius, double mu)
Parameters
llaPosition
GeodeticElements[-] Position in latitude/longitude/altitude coordinates
j20002Pfix
Matrix3[-] Planet rotation matrix
planetRadius
double[m] Planetary radius, assumed to be constant (i.e., spherical)
mu
double[kg m^2 s^3] The gravitational constant for the body orbiting
Returns
- VectorElements
[m]/[m/s] Final position and velocity in the planet-centered, planet-fixed frame.
GetRotationVelocity(GeodeticElements, Matrix3, Matrix3, double)
Returns the rotation velocity of a particular location on a body based on the geodetic coordinates and the rotation speed of the body at the current point in time. This assumes a PCI frame velocity.
public static Vector3 GetRotationVelocity(GeodeticElements llaPosition, Matrix3 j2000, Matrix3 j2000Dot, double planetRadius)
Parameters
llaPosition
GeodeticElements[deg] The geodetic coordinates to get the rotation at
j2000
Matrix3[-] The J2000 rotation frame of the body at the current time
j2000Dot
Matrix3[-] The J2000 rotation velocity of the body at the current time
planetRadius
double[m] The radius of the body that the location exists on
Returns
- Vector3
[m/s] A PCI frame velocity at the current location
HCS2PCPF(Matrix3, double, double, double)
Converts a HCS (horizontal coordinate system) rotation frame to a PCPF (planet centered planet fixed) rotation frame with a rotation about the azimuth angle (clockwise from the primary direction) and elevation angles in degrees into a new rotation frame.
public static Matrix3 HCS2PCPF(Matrix3 hcs, double yaw, double pitch, double roll = 0)
Parameters
hcs
Matrix3[-] The HCS frame at the current position
yaw
double[deg] The angle to rotate clockwise about the HCS direction
pitch
double[deg] The angle to rotate about the horizon plane
roll
double[deg] The angle to roll about the final axis
Returns
- Matrix3
[-] A rotated HCS rotation in the PCPF frame
LLA2ENU(double, double)
Converts a latitude and longitude position to an ENU (east north up) rotation frame.
public static Matrix3 LLA2ENU(double latitude, double longitude)
Parameters
latitude
double[deg] The latitude of the position
longitude
double[deg] The longitude of the position
Returns
- Matrix3
The ENU rotation frame
LLA2NED(double, double)
Converts a latitude and longitude position to an NED (north east down) rotation frame.
public static Matrix3 LLA2NED(double latitude, double longitude)
Parameters
latitude
double[deg] The latitude of the position
longitude
double[deg] The longitude of the position
Returns
- Matrix3
The NED rotation frame
LLA2PCI(GeodeticElements, Matrix3, double)
Converts from a planet-centered inertial coordinates to latitutde/longitude/altitude (LLA) coordinates given a planet radius and rotation matrix.
public static Vector3 LLA2PCI(GeodeticElements llaPosition, Matrix3 J20002Pfix, double planetRadius)
Parameters
llaPosition
GeodeticElements[-] Position in latitude/longitude/altitude coordinates
J20002Pfix
Matrix3[-] Rotation matrix between inertial and PCPF frames
planetRadius
double[m] Planetary radius, assumed to be constant (i.e., spherical)
Returns
- Vector3
[m] Position in inertial coordinates.
LLA2PCPF(GeodeticElements, double)
Converts from a Lat/Long/Altitude coordinates to planet-centered, planet-fixed coordinates given a planet radius.
public static Vector3 LLA2PCPF(GeodeticElements llaPosition, double planetRadius)
Parameters
llaPosition
GeodeticElements[-] Position in latitude/longitude/altitude coordinates
planetRadius
double[m] Planetary radius, assumed to be constant (i.e., spherical)
Returns
- Vector3
[m] Final position in the planet-centered, planet-fixed frame.
LLA2SEZ(double, double)
Converts a latitude and longitude position to an SEZ (south east zenith) rotation frame.
public static Matrix3 LLA2SEZ(double latitude, double longitude)
Parameters
latitude
double[deg] The latitude of the position
longitude
double[deg] The longitude of the position
Returns
- Matrix3
The SEZ rotation frame
LLA2WGS(GeodeticElements)
Converts a latitude longitude altitude (LLA) to a WGS-84 (Earth centered Earth fixed) terrestrial reference system
public static Vector3 LLA2WGS(GeodeticElements lla)
Parameters
lla
GeodeticElements[deg] The LLA value for the position
Returns
- Vector3
[m] The final PCPF frame in the WGS-84 standard
PCI2LLA(Vector3, Matrix3, double)
Converts from a planet-centered inertial coordinates to latitutde/longitude/altitude (LLA) coordinates given a planet radius and rotation matrix.
public static GeodeticElements PCI2LLA(Vector3 pciPosition, Matrix3 J20002Pfix, double planetRadius)
Parameters
pciPosition
Vector3[m] Position vector in PCI coordinates
J20002Pfix
Matrix3[-] 3x3 rotation matrix representing the rotation between PCPF and ECI frames
planetRadius
double[m] Planetary radius, assumed to be constant (i.e., spherical)
Returns
- GeodeticElements
Final position in latitude/longitude/altitude coordinates [0] : [deg] latitude above planetary equator [1] : [deg] longitude across planetary meridian [2] : [m] altitude above planet radius
PCI2PCPF(Vector3, Matrix3)
Converts from a planet-centered inertial position (i.e., J2000 ECI) to a planet-centered, planet-fixed position given a rotation matrix.
public static Vector3 PCI2PCPF(Vector3 pciPosition, Matrix3 J20002Pfix)
Parameters
pciPosition
Vector3[m] Position vector in PCI coordinates
J20002Pfix
Matrix3[-] 3x3 rotation matrix representing the rotation between PCPF and ECI frames
Returns
- Vector3
[m] Position vector in PCPF coordinates
PCPF2LLA(Vector3, double)
Converts from a planet-centered, planet-fixed coordinates to latitutde/longitude/altitude (LLA) coordinates given a planet radius.
public static GeodeticElements PCPF2LLA(Vector3 pcpfPosition, double planetRadius)
Parameters
pcpfPosition
Vector3[m] Position vector in PCPF coordinates
planetRadius
double[m] Planetary radius, assumed to be constant (i.e., spherical)
Returns
- GeodeticElements
Final position in latitude/longitude/altitude coordinates [0] : [rad] latitude above planetary equator [1] : [rad] longitude across planetary meridian [2] : [m] altitude above planet radius
PCPF2PCI(Vector3, Matrix3)
Converts from a planet-centered, planet-fixed to a planet-centered inertial position (i.e., J2000 ECI) position given a rotation matrix.
public static Vector3 PCPF2PCI(Vector3 pcpfPosition, Matrix3 J20002Pfix)
Parameters
pcpfPosition
Vector3[m] Position vector in planet centered, planet fixed coordinates
J20002Pfix
Matrix3[-] Rotation between inertial and pcf coordinates.
Returns
- Vector3
[m] Final position in the planet-centered inertial frame.
PCPF2PCIDCM(Matrix3, Matrix3)
Converts a PCPF (planet-centered planet-fixed) rotation matrix to a PCI (planet-centered inertial) frame, with the combination of the planet rotation matrix and the raw DCM (direction cosine matrix) rotation matrix.
public static Matrix3 PCPF2PCIDCM(Matrix3 pcpf, Matrix3 j2000)
Parameters
Returns
- Matrix3
[-] The PCI DCM rotation matrix
WGS2LLA(Vector3)
Converts a standard WGS-84 (Earth Centered, Earth Fixed) terrestrial reference system for Earth to an appropriate latitude longitude altitude (LLA) value.
public static GeodeticElements WGS2LLA(Vector3 position)
Parameters
position
Vector3[m] The PCPF frame relative to the center of the Earth
Returns
- GeodeticElements
[deg] The LLA value for the position