SphericalHarmonicField
Defined in: mod.rs:382
Available on crate feature
alloconly.
pub struct SphericalHarmonicFieldEvaluator 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.
Methods
Section titled “Methods”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.
full()
Section titled “full()”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).
truncated()
Section titled “truncated()”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.
coefficients()
Section titled “coefficients()”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.
radius()
Section titled “radius()”fn radius(&self) -> f64
Reference radius [km] (SphericalHarmonicCoefficients::radius).
degree()
Section titled “degree()”fn degree(&self) -> usize
Highest degree evaluated (≤ coefficients().max_degree()).
order()
Section titled “order()”fn order(&self) -> usize
Highest order evaluated (≤ degree; 0 means zonal only).
potential_body_fixed()
Section titled “potential_body_fixed()”fn potential_body_fixed(&self, position: &Vector3<f64>) -> f64
Non-central disturbing potential U [km²/s²] at a body-fixed
position [km]. a = ∇U.
acceleration_body_fixed()
Section titled “acceleration_body_fixed()”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.