geodetic2ecef
ahrs.common.frames.geodetic2ecef(lat: float, lon: float, h: float, a: float = 6378137.0, b: float = 6356752.3142) → ndarray : Transform geodetic coordinates to Rectangular (Cartesian) Coordinates in the Earth-Centered Earth-Fixed frame.
code
The cartesian coordinates of a point
can be calculated from the geodetic coordinates
using the
following equations [[Wik15](/u/fab8b0a9fec670cf#id85)] [[ZHP11](/u/fab8b0a9fec670cf#id16)]
[[NKG13](/u/fab8b0a9fec670cf#id55)]:
where is the latitude, is the longitude,
is the height, and is the radius of curvature in the
prime vertical at the given latitude :
The first eccentricity of the ellipsoid **squared**, , is
defined using the equatorial radius of the ellipsoid , and the
polar radius of the ellipsoid :
These values default to Earth’s ellipsoid.
Parameters:
: - **lat** (*float*) – Latitude, in degrees.
- **lon** (*float*) – Longitude, in degrees.
- **h** (*float*) – Height above ellipsoidal surface, in meters.
- **a** (*float, default: 6378137.0*) – Ellipsoid’s equatorial radius (semi-major axis), in meters. Defaults to
Earth’s.
- **b** (*float, default: 6356752.3142*) – Ellipsoid’s polar radius (semi-minor axis), in meters. Defaults to
Earth’s.
Returns:
: **X** – ECEF cartesian coordinates.
Return type:
: numpy.ndarray