Post · 7 min read· pp. 32–38

Reference Ellipsoid

class ahrs.utils.ReferenceEllipsoid(a: float = 1.0, f: float = 0.0, GM: float = 6.6743e-11, w: float = 1.0) : This implementation is based on the World Geodetic System (WGS) reference ellipsoid [198414], which is the most widely used reference ellipsoid for the Global Positioning System (GPS).

code
The WGS84 uses four elemental parameters to describe a reference ellipsoid:

- Semi-major axis, aa, in meters.
- Flattening ratio, ff.
- Standard Gravitational Parameter, GMGM, in m^3/s^2.
- Angular velocity, ω\omega, in rad/s.

The semi-major axis, aa, is the radius of the ellipsoid at the
equator, while the flattening ratio, ff, is the ratio of the
difference between the semi-major and semi-minor axes to the semi-major
axis:

f=a−baf = \frac{a-b}{a}
where bb is the semi-minor axis of the ellipsoid. When f=0f = 0 the ellipsoid is a perfect sphere. When f=1f = 1 the ellipsoid is a flat disc. The [standard gravitational parameter](https://en.wikipedia.org/wiki/Standard_gravitational_parameter), GMGM, is the product of the **gravitational constant** and the **mass** of the planetary body:
GM=G⋅MGM = G \cdot M
where \(G = 6.67430 \times 10^{-11} \frac{\mathrm{m}^3}{\mathrm{kg}

\mathrm{s}^2}) is the universal constant of gravitation, and MM is the mass of the planetary body, in kg.

code
From these four parameters we can derive all other properties of the
ellipsoid.

The default values describe a **perfect sphere** with a radius of 1 meter,
whose gravitational constant is equal the universal constant of gravitation,
and rotates at 1 rad/s.

Parameters:
:   - **a** (*float, default: 1.0*) – Semi-major axis of the ellipsoid, in meters.
    - **f** (*float, default: 0.0*) – Flattening of the ellipsoid, unitless.
    - **GM** (*float, default: 6.6743e-11*) – Standard Gravitational Parameter of the ellipsoid, in m^3/s^2.
    - **w** (*float, default: 1.0*) – Angular velocity of the ellipsoid, in rad/s.

*property* arithmetic\_mean\_radius*: float*
:   Mean Radius R1R_1 of the Three Semi-Axes, computed as:

    
R1=a(1−f3)R_1 = a\Big(1-\frac{f}{3}\Big)
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.arithmetic_mean_radius 1.0

code

    *property* aspect\_ratio*: float*
    :   Aspect Ratio ARAR, computed as:

        
AR=baAR = \frac{b}{a}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.aspect_ratio 1.0
code
*property* authalic\_sphere\_radius*: float*
:   Radius R2R_2 of a Sphere of Equal Area, computed as:

    
R2=RP(1−23e′2+2645e′4−100189e′6+703414175e′8−220652467775e′10)R_2 = R_P \Big(1-\frac{2}{3}e'^2 + \frac{26}{45}e'^4 - \frac{100}{189}e'^6 + \frac{7034}{14175}e'^8 - \frac{220652}{467775}e'^{10} \Big)
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.authalic_sphere_radius 1.0

code

    *property* curvature\_polar\_radius*: float*
    :   Polar Radius of Curvature RPR_P, computed as:

        
RP=a2b=a1−e2=a1−f\begin{split}\begin{array}{ll} R_P &= \frac{a^2}{b} = \frac{a}{\sqrt{1-e^2}} \\ &= \frac{a}{1-f} \end{array}\end{split}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.curvature_polar_radius 1.0
code
*property* dynamical\_form\_factor*: float*
:   WGS 84 Dynamical Form Factor J2J_2, computed as:

    
J2=e23(1−2me′15q0)J_2 = \frac{e^2}{3} \Big(1-\frac{2me'}{15q_0}\Big)
where:
q0=12[(1+3e′2)arctan⁡e′−3e′]q_0 = \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big]
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.dynamical_form_factor 0.0

code

    *property* equatorial\_normal\_gravity*: float*
    :   Normal Gravity ge\mathrm{g}_e at the Equator, in
        ms2\frac{\mathrm{m}}{\mathrm{s}^2}, computed as:

        
ge=GMab(1−m−me′q0′6q0)\mathrm{g}_e = \frac{GM}{ab}\Big(1-m-\frac{me'q_0'}{6q_0}\Big)
where:
q0=12[(1+3e′2)arctan⁡e′−3e′]q0′=3[(1+1e′2)(1−1e′arctan⁡e′)]−1\begin{split}\begin{array}{ll} q_0 &= \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big] \\ q_0' &= 3\Big[\Big(1+\frac{1}{e'^2}\Big)\Big(1-\frac{1}{e'}\arctan e'\Big)\Big] - 1 \end{array}\end{split}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.equatorial_normal_gravity 14982844642.8839
code
*property* equivolumetric\_sphere\_radius*: float*
:   Radius R3R_3 of a Sphere of Equal Volume, computed as:

    
R3=a2b3=a1−f3\begin{split}\begin{array}{ll} R_3 &= \sqrt[3]{a^2b} \\ &= a\sqrt[3]{1-f} \end{array}\end{split}
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.equivolumetric_sphere_radius 1.0

code

    *property* first\_eccentricity\_squared*: float*
    :   First Eccentricity Squared e2e^2 of the ellipsoid, computed as:

        
e2=2f−f2e^2 = 2f - f^2
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.first_eccentricity_squared 0.0
code
*property* is\_geodetic*: bool*
:   Check whether the ellipsoid model is geodetic (describes planet Earth.)

    Example

    ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.is_geodetic False

code

    *property* linear\_eccentricity*: float*
    :   Linear Eccentricity EE, computed as:

        
E=a2−b2E = \sqrt{a^2-b^2}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.linear_eccentricity 0.0
code
*property* mass*: float*
:   The Mass MM of the ellipsoid, in kg, computed as:

    
M=GMGM = \frac{GM}{G}
where GG is the universal constant of gravitation equal to 6.67428×10−11m3kgs26.67428\times 10^{-11} \frac{\mathrm{m}^3}{\mathrm{kg} \mathrm{s}^2} Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.mass 1.0

code

    *property* mean\_normal\_gravity*: float*
    :   Mean Value gˉ\bar{\mathrm{g}} of Normal Gravity, in
        ms2\frac{\mathrm{m}}{\mathrm{s}^2}, computed as:

        
gˉ=ge(1+16e2+13k+59360e4+518e2k+237115120e6+2591080e4k+2702291814400e8+962345360e6k)\bar{\mathrm{g}} = \mathrm{g}_e\Big(1 + \frac{1}{6}e^2 + \frac{1}{3}k + \frac{59}{360}e^4 + \frac{5}{18}e^2k + \frac{2371}{15120}e^6 + \frac{259}{1080}e^4k + \frac{270229}{1814400}e^8 + \frac{9623}{45360}e^6k \Big)
where:
k=bgp−ageage=bgpage−1k = \frac{b\mathrm{g}_p - a\mathrm{g}_e}{a\mathrm{g}_e} = \frac{b\mathrm{g}_p}{a\mathrm{g}_e}-1
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.mean_normal_gravity 14982844642.8839
code
meridian\_curvature\_radius(*lat: float*) → float
:   Radius of the curvature in the prime meridian, estimated at a given
    latitude, ϕ\phi, as per [[Jek16](/u/fab8b0a9fec670cf#id31)]:

    
RM=a(1−e2)(1−e2sin⁡2ϕ)32R_M = \frac{a(1-e^2)}{(1-e^2\sin^2\phi)^{\frac{3}{2}}}
Parameters: : **lat** (*float*) – Geographical latitude, in decimal degrees. normal\_gravity(*lat: float*, *h: float = 0.0*) → float : Normal Gravity on (or above) Ellipsoidal Surface Estimate the normal gravity on or above the surface of an ellipsoidal body using Somigliana’s formula (on surface) and a series expansion (above surface). Somigliana’s closed formula as desribed by H. Moritz in [[Mor84](/u/fab8b0a9fec670cf#id53)] is:
g=agecos⁡2ϕ+bgpsin⁡2ϕa2cos2ϕ+b2sin⁡2ϕ\mathrm{g} = \frac{a\mathrm{g}_e \cos^2\phi + b\mathrm{g}_p\sin^2\phi}{\sqrt{a^2cos^2\phi + b^2\sin^2\phi}}
For numerical computations, a more convenient form is:
g=ge1+ksin⁡2ϕ1−e2sin⁡2ϕ\mathrm{g} = \mathrm{g}_e\frac{1+k\sin^2\phi}{\sqrt{1-e^2\sin^2\phi}}
with the helper constant kk:
k=bgpage−1k = \frac{b\mathrm{g}_p}{a\mathrm{g}_e}-1
Parameters: : - **lat** (*float*) – Geographical latitude, in decimal degrees. - **h** (*float, default: 0.0*) – Mean sea level height, in meters. Returns: : **g** – Normal gravity at given point in space, in m/s^2. Return type: : float Examples ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.normal_gravity(50.0) 9.810702135603085

ref.normal_gravity(50.0, 100.0) 9.810393625316983

code

    *property* normal\_gravity\_constant*: float*
    :   Normal Gravity Formula Constant mm, computed as:

        
m=ω2a2bGMm = \frac{\omega^2a^2b}{GM}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.normal_gravity_constant 14982844642.8839
code
*property* normal\_gravity\_potential*: float*
:   Normal Gravity Potential U0U_0 of the WGS 84 Ellipsoid, computed
    as:

    
U0=GMEarctan⁡e′+ω2a23U_0 = \frac{GM}{E} \arctan e' + \frac{\omega^2a^2}{3}
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.normal_gravity_potential 6.6743e-11

code

    *property* polar\_normal\_gravity*: float*
    :   Normal Gravity gp\mathrm{g}_p at the Pole, in
        ms2\frac{\mathrm{m}}{\mathrm{s}^2}, computed as:

        
gp=GMa2(1+me′q0′3q0)\mathrm{g}_p = \frac{GM}{a^2}\Big(1+\frac{me'q_0'}{3q_0}\Big)
where:
q0=12[(1+3e′2)arctan⁡e′−3e′]q0′=3[(1+1e′2)(1−1e′arctan⁡e′)]−1\begin{split}\begin{array}{ll} q_0 &= \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big] \\ q_0' &= 3\Big[\Big(1+\frac{1}{e'^2}\Big)\Big(1-\frac{1}{e'}\arctan e'\Big)\Big] - 1 \end{array}\end{split}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.polar_normal_gravity 14982844642.8839
code
*property* second\_degree\_zonal\_harmonic*: float*
:   WGS 84 Second Degree Zonal Harmonic C2,0C_{2,0}, computed as:

    
C2,0=−J25C_{2,0} = -\frac{J_2}{\sqrt{5}}
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.second_degree_zonal_harmonic 0.0

code

    *property* second\_eccentricity\_squared*: float*
    :   Second Eccentricity Squared e′2e'^2, computed as:

        
e′2=a2−b2b2e'^2 = \frac{a^2-b^2}{b^2}
Example ```default >>> ref = ahrs.utils.ReferenceEllipsoid() >>> ref.second_eccentricity_squared 0.0
code
*property* sidereal\_day*: float*
:   Sidereal Day, TsidT_{sid}, in seconds, computed as:

    
Tsid=2πωT_{sid} = \frac{2\pi}{\omega}
Example ```default

ref = ahrs.utils.ReferenceEllipsoid() ref.sidereal_day 6.283185307179586

code

    vertical\_curvature\_radius(*lat: float*) → float
    :   Radius of the curvature in the prime vertical, estimated at a given
        latitude, ϕ\phi, as:

        
RN=a1−e2sin⁡2ϕR_N = \frac{a}{\sqrt{1-e^2\sin^2\phi}}
Parameters: : **lat** (*float*) – Geographical latitude, in decimal degrees.