Skip to content

FrameTransform

Defined in: frame.rs:531

pub struct FrameTransform\<From, To\>

A frame transform carrying both the orientation (Rotation) and the angular velocity of the To frame relative to From, so it can transform velocities (and full position+velocity states), not just positions.

The stored angular velocity ω is that of To relative to From, expressed in From. Velocities follow the transport theorem:

r_to = R · r_from
v_to = R · (v_from − ω × r_from)

Rotation stays position-only; this is its kinematic (state) companion. Build Earth ECI↔ECEF instances via the EarthFixedTransform(crate::earth::EarthFixedTransform) factories.

fn teme_to_gcrs(tt: &[Epoch<Tt>](../epoch/)) -> Self

TEME → GCRS state (position + velocity) transform at TT epoch tt.

Approximate velocity: the angular velocity is taken as zero, so position and velocity rotate by the same matrix (the standard Vallado treatment of TEME → inertial). This is not the exact kinematic derivative — the precession/nutation/equinox rate contributes a velocity difference of ~1e-8 km/s (LEO) to ~1e-7 km/s (GEO), negligible against the SGP4 velocity error. For an Earth-fixed target — where Earth’s spin ω matters — use the EarthFixedTransform(crate::earth::EarthFixedTransform) factories.


fn teme_to_simple_eci(ut1: &Ut1Epoch) -> Self

TEME → SimpleEci state (position + velocity) transform at UT1 epoch ut1.

Both frames are inertial, so the angular velocity is zero (the GMST − ERA rate is the precession-in-right-ascension rate, ~7e-12 rad/s); position and velocity rotate by the same z-rotation. Pairs with Rotation<Teme, SimpleEci>::teme_to_simple_eci for the visualization frame.


fn new(rotation: Rotation<From, To>, angular_velocity: Vec3<From>) -> Self

Build from a rotation and the angular velocity of To relative to From, expressed in From [rad/s].


fn rotation(&self) -> &Rotation<From, To>

The orientation part (FromTo).


fn angular_velocity_in_from(&self) -> &Vec3<From>

Angular velocity of To relative to From, expressed in From [rad/s].


fn transform_position(&self, position: &Vec3<From>) -> Vec3<To>

Transform a position (identical to Rotation::transform).


fn transform_velocity(&self, position: &Vec3<From>, velocity: &Vec3<From>) -> Vec3<To>

Transform a velocity via the transport theorem v_to = R·(v_from − ω×r_from).

The position is required because the rotating-frame correction is ω × r.


fn transform_state(&self, position: &Vec3<From>, velocity: &Vec3<From>) -> (Vec3<To>, Vec3<To>)

Transform a full state (position, velocity).


fn inverse(&self) -> FrameTransform<To, From>

Inverse transform (ToFrom).

The inverse angular velocity — of From relative to To, expressed in To — is −R·ω.