Skip to main content

Transform

Struct Transform 

Source
pub struct Transform<From: Frame, To: Frame> {
    pub rotation: Rotation<From, To>,
    pub omega: Vec3,
}
Expand description

A rotation between frames that turn relative to one another.

Carries the angular velocity of To with respect to From, expressed in From. A Rotation alone is enough for a Position; only this is enough for a StateVector.

Fields§

§rotation: Rotation<From, To>

The rotation part.

§omega: Vec3

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

Implementations§

Source§

impl<A: Frame, B: Frame> Transform<A, B>

Source

pub const fn new(rotation: Rotation<A, B>, omega: Vec3) -> Self

Assemble from a rotation and the angular velocity between the frames.

Source

pub fn position(self, p: Position<A>) -> Position<B>

Apply to a position. The angular velocity plays no part.

Source

pub fn state(self, s: StateVector<A>) -> StateVector<B>

Apply to a full state.

r_B = R · r_A
v_B = R · (v_A − ω × r_A)

The second term is the one everyone forgets. For GCRF→ITRF at the equator it is 465 m/s: a satellite at rest on the ground would appear to be moving at Mach 1.4, and a satellite in orbit would have its velocity wrong by six percent. The result still looks like a plausible orbit.

Source

pub fn inverse(self) -> Transform<B, A>

The inverse transform.

The angular velocity of From relative to To is −ω, re-expressed in To.

Trait Implementations§

Source§

impl<From: Clone + Frame, To: Clone + Frame> Clone for Transform<From, To>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<From: Copy + Frame, To: Copy + Frame> Copy for Transform<From, To>

Source§

impl<From: Debug + Frame, To: Debug + Frame> Debug for Transform<From, To>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<From: PartialEq + Frame, To: PartialEq + Frame> PartialEq for Transform<From, To>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<From: PartialEq + Frame, To: PartialEq + Frame> StructuralPartialEq for Transform<From, To>

Auto Trait Implementations§

§

impl<From, To> Freeze for Transform<From, To>
where Rotation<From, To>: Freeze,

§

impl<From, To> RefUnwindSafe for Transform<From, To>
where Rotation<From, To>: RefUnwindSafe,

§

impl<From, To> Send for Transform<From, To>
where Rotation<From, To>: Send,

§

impl<From, To> Sync for Transform<From, To>
where Rotation<From, To>: Sync,

§

impl<From, To> Unpin for Transform<From, To>
where Rotation<From, To>: Unpin,

§

impl<From, To> UnsafeUnpin for Transform<From, To>
where Rotation<From, To>: UnsafeUnpin,

§

impl<From, To> UnwindSafe for Transform<From, To>
where Rotation<From, To>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.