Skip to main content

Scale

Struct Scale 

Source
pub struct Scale<T> { /* private fields */ }
Expand description

Scale transformation.

Implementations§

Source§

impl<T> Scale<T>

Source

pub fn from_mag(mag: T) -> Self

Source

pub fn into_mag(self) -> T

Trait Implementations§

Source§

impl<T> AbsDiffEq for Scale<T>
where T: AbsDiffEq<Epsilon = T> + Copy,

Available on crate feature approx only.
Source§

type Epsilon = T

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> Self::Epsilon

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

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

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

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

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<T: Clone> Clone for Scale<T>

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> Copy for Scale<T>

Source§

impl<T: Debug> Debug for Scale<T>

Source§

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

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

impl<T, const N: usize> Directional<Vector<T, N>> for Scale<T>
where Self: Transform<Vector<T, N>>,

Source§

fn apply_dir(&self, _: Vector<T, N>, dir: Vector<T, N>) -> Vector<T, N>

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

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

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

impl<T> Distribution<Scale<T>> for Normal
where Normal: Distribution<T>,

Available on crate feature rand only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Scale<T>

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

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> ⓘ
where R: Rng, Self: Sized,

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

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl<T> From<T> for Scale<T>

Source§

fn from(mag: T) -> Self

Converts to this type from the input type.
Source§

impl<T: PartialEq> PartialEq for Scale<T>

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, const N: usize> Reorder<Scale<T>, Vector<T, N>> for Shift<T, N>
where Scale<T>: Transform<Vector<T, N>> + Copy, Self: Transform<Vector<T, N>>,

Source§

fn reorder(self, other: Scale<T>) -> (Scale<T>, Shift<T, N>)

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

impl<T, const N: usize> Reorder<Shift<T, N>, Vector<T, N>> for Scale<T>
where Self: Transform<Vector<T, N>>, Shift<T, N>: Transform<Vector<T, N>>,

Source§

fn reorder(self, other: Shift<T, N>) -> (Shift<T, N>, Scale<T>)

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

impl<T: PartialEq> StructuralPartialEq for Scale<T>

Source§

impl<T, const N: usize> Transform<Vector<T, N>> for Scale<T>
where T: Num + Inv<Output = T> + Copy,

Source§

fn identity() -> Self

Identity transformation.
Source§

fn inv(self) -> Self

Inverse transformation.
Source§

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

Perform the transformation itself.
Source§

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

Find transformation directional derivative at specified point.
Source§

fn chain(self, other: Self) -> Self

Chain two transformations into a new one. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Scale<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Scale<T>
where T: RefUnwindSafe,

§

impl<T> Send for Scale<T>
where T: Send,

§

impl<T> Sync for Scale<T>
where T: Sync,

§

impl<T> Unpin for Scale<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Scale<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Scale<T>
where T: 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, const M: usize, const N: usize> Broadcast<Matrix<T, M, N>> for T
where T: Copy,

Source§

fn broadcast(self) -> Matrix<T, M, N>

Copy values along axes to get V.
Source§

impl<T, const N: usize> Broadcast<Vector<T, N>> for T
where T: Copy,

Source§

fn broadcast(self) -> Vector<T, N>

Copy values along axes to get V.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

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

Source§

fn vzip(self) -> V