Struct vecmat::transform::Linear[][src]

#[repr(transparent)]
pub struct Linear<T, const N: usize> { /* fields omitted */ }
Expand description

Linear transformation.

Implementations

impl<T, const N: usize> Linear<T, N>[src]

pub fn from_matrix(lin: Matrix<T, N, N>) -> Self[src]

pub fn into_matrix(self) -> Matrix<T, N, N>[src]

impl<T, const N: usize> Linear<T, N> where
    T: Neg<Output = T> + Num + Copy,
    Matrix<T, N, N>: Inv<Output = Matrix<T, N, N>>, 
[src]

pub fn normal_transform(self) -> Self[src]

impl<T> Linear<T, 3> where
    T: Float
[src]

pub fn look_at(dir: Vector<T, 3>, up: Vector<T, 3>) -> Self[src]

Returns the transformation that rotates -z-axis to dir and y-axis to up.

impl<T> Linear<T, 3> where
    T: Float + NumCast
[src]

pub fn look_at_any(dir: Vector<T, 3>) -> Self[src]

Returns any of transformations that rotate dir to -z-axis.

Trait Implementations

impl<T, const N: usize> AbsDiffEq<Linear<T, N>> for Linear<T, N> where
    T: AbsDiffEq<Epsilon = T> + Copy
[src]

type Epsilon = T

Used for specifying relative comparisons.

fn default_epsilon() -> Self::Epsilon[src]

The default tolerance to use when testing values that are close together. Read more

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool[src]

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool[src]

The inverse of AbsDiffEq::abs_diff_eq.

impl<T: Clone, const N: usize> Clone for Linear<T, N>[src]

fn clone(&self) -> Linear<T, N>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug, const N: usize> Debug for Linear<T, N>[src]

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

Formats the value using the given formatter. Read more

impl<T, const N: usize> Directional<Vector<T, N>> for Linear<T, N> where
    Self: Transform<Vector<T, N>>,
    T: Neg<Output = T> + Num + Copy,
    Vector<T, N>: Normalize,
    Matrix<T, N, N>: Inv<Output = Matrix<T, N, N>>, 
[src]

fn apply_dir(&self, pos: Vector<T, N>, dir: Vector<T, N>) -> Vector<T, N>[src]

Returns the result of the direction transformation at the specified position.

fn apply_normal(&self, _: Vector<T, N>, normal: Vector<T, N>) -> Vector<T, N>[src]

Returns the result of the normal transformation at the specified position. Read more

impl<T, const N: usize> Distribution<Linear<T, N>> for Normal where
    Normal: Distribution<Matrix<T, N, N>>, 
[src]

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Linear<T, N>[src]

Generate a random value of T, using rng as the source of randomness.

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<T, const N: usize> Distribution<Linear<T, N>> for Invertible where
    Invertible: Distribution<Matrix<T, N, N>>, 
[src]

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Linear<T, N>[src]

Generate a random value of T, using rng as the source of randomness.

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<T, const N: usize> From<Linear<T, N>> for Matrix<T, N, N>[src]

fn from(lin: Linear<T, N>) -> Matrix<T, N, N>[src]

Performs the conversion.

impl<T, const N: usize> From<Matrix<T, N, N>> for Linear<T, N>[src]

fn from(lin: Matrix<T, N, N>) -> Self[src]

Performs the conversion.

impl<T: PartialEq, const N: usize> PartialEq<Linear<T, N>> for Linear<T, N>[src]

fn eq(&self, other: &Linear<T, N>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Linear<T, N>) -> bool[src]

This method tests for !=.

impl<T, const N: usize> Reorder<Linear<T, N>, Vector<T, N>> for Shift<T, N> where
    Linear<T, N>: Transform<Vector<T, N>> + Copy,
    Self: Transform<Vector<T, N>>, 
[src]

fn reorder(self, other: Linear<T, N>) -> (Linear<T, N>, Shift<T, N>)[src]

For given A and B returns B' and A'.

impl<T, const N: usize> Reorder<Shift<T, N>, Vector<T, N>> for Linear<T, N> where
    Self: Transform<Vector<T, N>>,
    Shift<T, N>: Transform<Vector<T, N>>, 
[src]

fn reorder(self, other: Shift<T, N>) -> (Shift<T, N>, Linear<T, N>)[src]

For given A and B returns B' and A'.

impl<T, const N: usize> Transform<Vector<T, N>> for Linear<T, N> where
    T: Neg<Output = T> + Num + Copy
[src]

fn identity() -> Self[src]

Identity transformation.

fn inv(self) -> Self[src]

Inverse transformation.

fn apply(&self, pos: Vector<T, N>) -> Vector<T, N>[src]

Perform the transformation itself.

fn deriv(&self, _pos: Vector<T, N>, dir: Vector<T, N>) -> Vector<T, N>[src]

Find transformation directional derivative at specified point.

fn chain(self, other: Self) -> Self[src]

Chain two transformations into a new one. Read more

impl<T: Copy, const N: usize> Copy for Linear<T, N>[src]

impl<T, const N: usize> StructuralPartialEq for Linear<T, N>[src]

Auto Trait Implementations

impl<T, const N: usize> RefUnwindSafe for Linear<T, N> where
    T: RefUnwindSafe

impl<T, const N: usize> Send for Linear<T, N> where
    T: Send

impl<T, const N: usize> Sync for Linear<T, N> where
    T: Sync

impl<T, const N: usize> Unpin for Linear<T, N> where
    T: Unpin

impl<T, const N: usize> UnwindSafe for Linear<T, N> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V