コンテンツにスキップ

SphericalHarmonicField

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

Defined in: mod.rs:382

Available on crate feature alloc only.

pub struct SphericalHarmonicField

Evaluator of a degree × order window of a SphericalHarmonicCoefficients set in its body-fixed frame.

Holds the coefficients by Arc and the Holmes–Featherstone recursion table for degree; see the module docs for the model and its conventions.

fn new(coefficients: impl [Into<[Arc<SphericalHarmonicCoefficients>](https://doc.rust-lang.org/std/rcs/arc/struct.Arc.html)>](https://doc.rust-lang.org/std/convert/trait.Into.html), degree: usize, order: usize) -> [Result<Self, TruncationError>](https://doc.rust-lang.org/std/result/enum.Result.html)

Evaluate coefficients up to degree × order.

degree must lie in 2..=coefficients.max_degree() and order in 0..=degree (0 is zonal only); anything else is a TruncationError rather than a clamp. Accepts the set by value or as an Arc — pass a cloned Arc to build several windows over one set.


fn full(coefficients: impl [Into<[Arc<SphericalHarmonicCoefficients>](https://doc.rust-lang.org/std/rcs/arc/struct.Arc.html)>](https://doc.rust-lang.org/std/convert/trait.Into.html)) -> [Result<Self, TruncationError>](https://doc.rust-lang.org/std/result/enum.Result.html)

Evaluate every coefficient the set carries (max_degree × max_degree).


fn truncated(&self, degree: usize, order: usize) -> [Result<Self, TruncationError>](https://doc.rust-lang.org/std/result/enum.Result.html)

Another window over the same coefficients, limited to degree × order.

Shares the coefficient set (no copy); only the recursion table is rebuilt. The bounds are those of new(Self::new) — this is not limited to this field’s own window, so it can widen as well as narrow.


fn coefficients(&self) -> &[Arc<SphericalHarmonicCoefficients>](https://doc.rust-lang.org/std/rcs/arc/struct.Arc.html)

The coefficient set this field evaluates (clone the Arc to build another window over it).


fn gm(&self) -> f64

Gravitational parameter [km³/s²]; see SphericalHarmonicCoefficients::gm for why the point mass must use this same value.


fn radius(&self) -> f64

Reference radius [km] (SphericalHarmonicCoefficients::radius).


fn degree(&self) -> usize

Highest degree evaluated (≤ coefficients().max_degree()).


fn order(&self) -> usize

Highest order evaluated (≤ degree; 0 means zonal only).


fn potential_body_fixed(&self, position: &Vector3<f64>) -> f64

Non-central disturbing potential U [km²/s²] at a body-fixed position [km]. a = ∇U.


fn acceleration_body_fixed(&self, position: &Vector3<f64>) -> Vector3<f64>

Non-central acceleration ∇U [km/s²] at a body-fixed position [km].

Non-finite or zero positions propagate to a non-finite result rather than being masked.