Skip to main content

SpatialVector

Struct SpatialVector 

Source
pub struct SpatialVector<T, K> {
    pub data: Vector6<T>,
    /* private fields */
}
Expand description

A 6-D spatial vector v = [angular (top 3); linear (bottom 3)], tagged by K ∈ {Motion, Force} to control cross-product and transform semantics (Featherstone’s crm / crf operators).

See the crate-level documentation for the full convention.

Fields§

§data: Vector6<T>

The raw 6-components [angular₀, angular₁, angular₂, linear₀, linear₁, linear₂].

Implementations§

Source§

impl<T: Scalar + Copy> SpatialVector<T, Motion>

Source

pub fn new(angular: Vector3<T>, linear: Vector3<T>) -> Self

Build a motion vector from its angular (top) and linear (bottom) halves.

Source

pub fn cross(&self, rhs: &SpatialVector<T, Motion>) -> SpatialVector<T, Motion>

motion ⊗ motion → motion (Featherstone crm).

Source

pub fn cross_force( &self, rhs: &SpatialVector<T, Force>, ) -> SpatialVector<T, Force>

motion ⊗ force → force (Featherstone crm applied to a force).

Source

pub fn transform_by(&self, iso: &Isometry3<T>) -> Self

Transform this motion vector by an Isometry3 using the motion Plücker adjoint [R, 0; t×R, R].

For a pure rotation this reduces to R acting on both halves, matching Isometry3::transform_vector componentwise.

Source§

impl<T: Scalar + Copy> SpatialVector<T, Force>

Source

pub fn new(angular: Vector3<T>, linear: Vector3<T>) -> Self

Build a force vector from its angular (moment, top) and linear (force, bottom) halves.

Source

pub fn cross_motion( &self, rhs: &SpatialVector<T, Motion>, ) -> SpatialVector<T, Force>

force ⊗ motion → force (Featherstone crf).

Source

pub fn cross(&self, rhs: &SpatialVector<T, Force>) -> SpatialVector<T, Motion>

force ⊗ force → motion (Featherstone crf).

Source

pub fn transform_by(&self, iso: &Isometry3<T>) -> Self

Transform this force vector by an Isometry3 using the force Plücker adjoint [R, t×R; 0, R].

For a pure rotation this reduces to R acting on both halves, matching Isometry3::transform_vector componentwise.

Source§

impl<T: Scalar + Copy, K> SpatialVector<T, K>

Source

pub fn angular(&self) -> Vector3<T>

The angular half (top 3 components).

Source

pub fn linear(&self) -> Vector3<T>

The linear half (bottom 3 components).

Source

pub fn as_vector(&self) -> &Vector6<T>

Borrow the raw 6-vector.

Trait Implementations§

Source§

impl<T: Scalar + Copy, K> Add for SpatialVector<T, K>

Source§

fn add(self, rhs: Self) -> Self

§Panics

Inherits T’s + semantics (never panics for floats).

Source§

type Output = SpatialVector<T, K>

The resulting type after applying the + operator.
Source§

impl<T: Clone, K: Clone> Clone for SpatialVector<T, K>

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<T: Copy, K: Copy> Copy for SpatialVector<T, K>

Source§

impl<T: Debug, K: Debug> Debug for SpatialVector<T, K>

Source§

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

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

impl<T: Scalar + Copy + Debug, K> Display for SpatialVector<T, K>

Source§

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

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

impl<T: Eq, K: Eq> Eq for SpatialVector<T, K>

Source§

impl<T: Scalar + Copy, K> Mul<T> for SpatialVector<T, K>

Source§

type Output = SpatialVector<T, K>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self

Performs the * operation. Read more
Source§

impl<T: Scalar + Copy, K> Neg for SpatialVector<T, K>

Source§

type Output = SpatialVector<T, K>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T: PartialEq, K: PartialEq> PartialEq for SpatialVector<T, K>

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<T: PartialEq, K: PartialEq> StructuralPartialEq for SpatialVector<T, K>

Source§

impl<T: Scalar + Copy, K> Sub for SpatialVector<T, K>

Source§

type Output = SpatialVector<T, K>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<T, K> Freeze for SpatialVector<T, K>
where Vector<T, 6>: Freeze, PhantomData<K>: Freeze,

§

impl<T, K> RefUnwindSafe for SpatialVector<T, K>

§

impl<T, K> Send for SpatialVector<T, K>
where Vector<T, 6>: Send, PhantomData<K>: Send,

§

impl<T, K> Sync for SpatialVector<T, K>
where Vector<T, 6>: Sync, PhantomData<K>: Sync,

§

impl<T, K> Unpin for SpatialVector<T, K>
where Vector<T, 6>: Unpin, PhantomData<K>: Unpin,

§

impl<T, K> UnsafeUnpin for SpatialVector<T, K>

§

impl<T, K> UnwindSafe for SpatialVector<T, K>

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.