Skip to content

Documentation / @interstellar-tools/equations / specificAngularMomentumFromElements

Function: specificAngularMomentumFromElements() ​

ts
function specificAngularMomentumFromElements(
  a: number,
  e: number,
  mu: number
): number;

Defined in: orbits/specific-angular-momentum-from-elements.ts:59

Specific angular momentum (h) from orbital elements.

Definition

h=μa(1−e2)

where (a) is the semi-major axis, (e) the eccentricity, and (μ) the gravitational parameter.

Validity by conic

  • Elliptic: (a>0,0≤e<1) → (1−e2>0) ⇒ radicand (>0).
  • Hyperbolic: (a<0,e>1) → (1−e2<0) and (a<0) ⇒ product still (>0).
  • Parabolic: (e=1) is not represented by finite (a). Use state vectors or (h=2μrp) (with periapsis radius (rp)).

Units

  • Inputs: (a) in m, (e) dimensionless, (μ) in m³/s².
  • Output: (h) in m²/s.

INFO

  • This returns the magnitude of (h=r×v).
  • For numerical robustness, tiny negative radicands from FP cancellation are clamped to zero.

Parameters ​

ParameterTypeDescription
anumberSemi-major axis (a) (m). Must be finite and ≠ 0 (elliptic (a>0), hyperbolic (a<0)).
enumberEccentricity (e) (dimensionless). Must be finite and ≥ 0.
munumberGravitational parameter (μ) (m³/s²). Must be finite and ≥ 0.

Returns ​

number

Specific angular momentum (h) (m²/s).

Throws ​

Error If (a) is non-finite or zero; if (e) is non-finite or negative; if (μ) is non-finite or negative; or if (μa(1−e²)<0) beyond a tiny FP tolerance (invalid element set for this formula).

Examples ​

ts
// Near-circular LEO-like elements
const muEarth = 3.986004418e14; // m³/s²
const a = 6778e3; // m
const e = 0.001;
const h = specificAngularMomentumFromElements(a, e, muEarth); // ≈ sqrt(μ a)
ts
// Hyperbolic flyby example
const muEarth = 3.986004418e14; // m³/s²
const a = -50000e3; // m (negative for hyperbola)
const e = 1.2;
const h = specificAngularMomentumFromElements(a, e, muEarth);

See ​

specificAngularMomentum - compute (h) from state vectors ((r,v)).