Class GeodeticLibrary
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
[Nominal] This is a static library for geodetic functions that are used to calculate the position of a point on the Earth's or other celestial body's surface.
public static class GeodeticLibrary
- Inheritance
-
GeodeticLibrary
Methods
GeodeticToVectorElements(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 GeodeticToVectorElements(GeodeticElements llaPosition, Matrix3 j2000, double planetRadius, double mu)
Parameters
llaPosition
GeodeticElements[-] Position in latitude/longitude/altitude coordinates
j2000
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.
GetGeodeticDistance(double, GeodeticElements, GeodeticElements)
Determines the Distance between two Geodetic elements on a surface of a planet. This assumes both geodetic elements are on the same planet.
public static double GetGeodeticDistance(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
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
GetWGSRadius(double)
Calculates the radius of the Earth at a given latitude using the World Geodetic System (WGS) 84 standard. This will take in some latitude and will calculate the true radius at that given point on the non-spherical Earth model. This model is independent to any longitude value.
public static double GetWGSRadius(double latitude)
Parameters
latitude
double[m] The latitude of the point to calculate
Returns
- double
[m] The radius at the provided latitude.
HCSToPCPF(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 HCSToPCPF(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
LLAToENU(double, double)
Converts a latitude and longitude position to an ENU (east north up) rotation frame.
public static Matrix3 LLAToENU(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
LLAToNED(double, double)
Converts a latitude and longitude position to an NED (north east down) rotation frame.
public static Matrix3 LLAToNED(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
LLAToPCI(GeodeticElements, Matrix3, double)
Converts from a planet-centered inertial coordinates to latitude/longitude/altitude (LLA) coordinates given a planet radius and rotation matrix.
public static Vector3 LLAToPCI(GeodeticElements llaPosition, Matrix3 j2000, double planetRadius)
Parameters
llaPosition
GeodeticElements[-] Position in latitude/longitude/altitude coordinates
j2000
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.
LLAToPCPF(GeodeticElements, double)
Converts from a Lat/Long/Altitude coordinates to planet-centered, planet-fixed coordinates given a planet radius.
public static Vector3 LLAToPCPF(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.
LLAToSEZ(double, double)
Converts a latitude and longitude position to an SEZ (south east zenith) rotation frame.
public static Matrix3 LLAToSEZ(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
LLAToWGS(GeodeticElements)
Converts a latitude longitude altitude (LLA) to a WGS-84 (Earth centered Earth fixed) terrestrial reference system.
public static GeodeticElements LLAToWGS(GeodeticElements lla)
Parameters
lla
GeodeticElementsThe LLA position assuming a perfect sphere
Returns
- GeodeticElements
The WGS position using the WGS-84 model
PCIToLLA(Vector3, Matrix3, double)
Converts from a planet-centered inertial coordinates to latitude/longitude/altitude (LLA) coordinates given a planet radius and rotation matrix.
public static GeodeticElements PCIToLLA(Vector3 pciPosition, Matrix3 j2000, double planetRadius)
Parameters
pciPosition
Vector3[m] Position vector in PCI coordinates
j2000
Matrix3[-] 3x3 rotation matrix representing the rotation between PCPF and PCI 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
PCIToPCPF(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 PCIToPCPF(Vector3 pciPosition, Matrix3 j2000)
Parameters
pciPosition
Vector3[m] Position vector in PCI coordinates
j2000
Matrix3[-] 3x3 rotation matrix representing the rotation between PCPF and PCI frames
Returns
- Vector3
[m] Position vector in PCPF coordinates
PCPFToLLA(Vector3, double)
Converts from a planet-centered, planet-fixed coordinates to latitude/longitude/altitude (LLA) coordinates given a planet radius.
public static GeodeticElements PCPFToLLA(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
PCPFToPCI(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 PCPFToPCI(Vector3 PCPFPosition, Matrix3 j2000)
Parameters
PCPFPosition
Vector3[m] Position vector in planet centered, planet fixed coordinates
j2000
Matrix3[-] Rotation between inertial and PCPF coordinates.
Returns
- Vector3
[m] Final position in the planet-centered inertial frame.
PCPFToPCIDCM(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 PCPFToPCIDCM(Matrix3 PCPF, Matrix3 j2000)
Parameters
Returns
- Matrix3
[-] The PCI DCM rotation matrix
WGSToLLA(GeodeticElements)
Converts a standard WGS-84 (Earth Centered, Earth Fixed) terrestrial reference system for Earth to an appropriate latitude longitude altitude (LLA) value, assuming the Earth is a perfect sphere.
public static GeodeticElements WGSToLLA(GeodeticElements wgs)
Parameters
wgs
GeodeticElementsThe WGS position using the WGS-84 model
Returns
- GeodeticElements
The LLA position assuming a perfect sphere