コンテンツにスキップ

Sgp4Elements

このコンテンツはまだ日本語訳がありません。

Defined in: elements.rs:49

pub struct Sgp4Elements

SGP4 mean orbital element set — a validated mean-element record.

Holding a Sgp4Elements guarantees the elements are physically usable: every field is finite, the mean motion is positive, and the eccentricity is in [0, 1). Build one with try_new(Self::try_new) (or TryFrom) from a Sgp4ElementsFields; the text parsers (crate::tle, crate::omm) go through the same path, so a parsed element set is always valid. Read the fields back with fields(Self::fields).

The elements are SGP4 mean elements (Brouwer-Kozai), not osculating Keplerian elements — propagate them with SGP4 rather than converting to a classical orbit. No allocator required.

fn try_new(fields: Sgp4ElementsFields) -> [Result<Self, ElementsError>](https://doc.rust-lang.org/std/result/enum.Result.html)

Validate fields and wrap them as a Sgp4Elements.

Returns an ElementsError if any field is non-finite, the mean motion is not strictly positive, or the eccentricity is outside [0, 1). Angles are only checked for finiteness (not normalized — SGP4 reduces them mod 2π), and bstar may be negative (it occurs in real element sets).


fn fields(&self) -> &Sgp4ElementsFields

Read-only view of the validated fields.


fn to_fields(&self) -> Sgp4ElementsFields

Copy out the validated fields.


fn semi_major_axis(&self, mu: f64) -> f64

Semi-major axis [km] from mean motion: a = (μ/n²)^(1/3).

A rough two-body estimate for display only — it ignores the J2 secular correction baked into the SGP4 (Kozai) mean motion, so it is not the semi-major axis SGP4 itself uses.


fn period(&self) -> f64

Orbital period [s] from the mean motion: 2π / n.

Positive — the mean motion is a validated, strictly-positive invariant (so the period never goes negative or NaN; an absurdly tiny mean motion could still overflow to +∞). Needs no mu; this is the conventional period reported for a TLE/OMM.