Vect

Struct Vect 

Source
#[repr(transparent)]
pub struct Vect<const N: usize, S>(pub [S; N]);

Tuple Fields§

§0: [S; N]

Implementations§

Source§

impl<S: Field> Vect<4, S>

Source

pub fn point(position: Vect<3, S>) -> Self

Source

pub fn point_at_inf(direction: Nrml<3, S>) -> Self

Source§

impl<S: Ring, const N: usize> Vect<N, S>

Source

pub const ZERO: Self

Source

pub const fn axis(i: usize, value: S) -> Self

Source

pub const fn splat(s: S) -> Self

Source

pub fn from_fn<F: Fn(usize) -> S>(f: F) -> Self

Source

pub fn swiz<const M: usize>(self, f: impl Fn([S; N]) -> [S; M]) -> Vect<M, S>

Source

pub fn map<T: Ring>(self, f: impl Fn(S) -> T) -> Vect<N, T>

Source

pub fn scale(self, other: Self) -> Self

Source

pub fn zero_extend<const M: usize>(self, i: usize) -> Vect<M, S>
where S: Sized,

Source

pub fn is_nan(self) -> bool

Source

pub fn is_finite(self) -> bool

Source§

impl<const N: usize> Vect<N, f32>

Source

pub fn to_f64(self) -> Vect<N, f64>

Source§

impl<const N: usize> Vect<N, f64>

Source

pub fn to_f32(self) -> Vect<N, f32>

Source§

impl<S: Ring, const N: usize> Vect<N, S>

Source

pub fn sqr_magn(self) -> S

Source§

impl<S: Field, const N: usize> Vect<N, S>

Source

pub fn magn(self) -> S

Source

pub fn normal(self) -> Option<Nrml<N, S>>

Source

pub fn normal_or_zero(self) -> Vect<N, S>

Source

pub fn magn_normal(self) -> Option<(S, Nrml<N, S>)>

Source

pub fn magn_normal_or_zero(self) -> (S, Vect<N, S>)

Source

pub fn divide_by_infinity(self) -> Option<Vect<N, S>>

Source§

impl<S: Field> Vect<1, S>

Source

pub fn x(self) -> S

Source§

impl<S: Field> Vect<2, S>

Source

pub fn x(self) -> S

Source

pub fn y(self) -> S

Source§

impl<S: Field> Vect<3, S>

Source

pub fn x(self) -> S

Source

pub fn y(self) -> S

Source

pub fn z(self) -> S

Source§

impl<S: Field> Vect<4, S>

Source

pub fn x(self) -> S

Source

pub fn y(self) -> S

Source

pub fn z(self) -> S

Source

pub fn w(self) -> S

Trait Implementations§

Source§

impl<S: Field, const N: usize> Add<Nrml<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Nrml<N, S>) -> Self::Output

Performs the + operation. Read more
Source§

impl<S: Field, const N: usize> Add<Vect<N, S>> for Nrml<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vect<N, S>) -> Self::Output

Performs the + operation. Read more
Source§

impl<S: Ring, const N: usize> Add for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<S: Ring, const N: usize> AddAssign for Vect<N, S>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const N: usize, S: Field> Apl<Vect<N, S>> for Rig<N, S>
where (): RotDim<N>,

Source§

type Output = Vect<N, S>

Source§

fn apl(self, other: Vect<N, S>) -> Vect<N, S>

Source§

impl<const N: usize, S: Field> Apl<Vect<N, S>> for Rot<N, S>
where (): RotDim<N>,

Source§

type Output = Vect<N, S>

Source§

fn apl(self, other: Vect<N, S>) -> Self::Output

Source§

impl<const N: usize, S: Clone> Clone for Vect<N, S>

Source§

fn clone(&self) -> Vect<N, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S: Field, const N: usize> Cross<Nrml<N, S>> for Vect<N, S>
where Self: Cross,

Source§

type Output = <Vect<N, S> as Cross>::Output

Source§

fn cross(self, other: Nrml<N, S>) -> Self::Output

Source§

impl<S: Field, const N: usize> Cross<Vect<N, S>> for Nrml<N, S>
where Vect<N, S>: Cross,

Source§

type Output = <Vect<N, S> as Cross>::Output

Source§

fn cross(self, other: Vect<N, S>) -> Self::Output

Source§

impl<S: Field> Cross for Vect<2, S>

Source§

type Output = Vect<1, S>

Source§

fn cross(self, other: Self) -> Vect<1, S>

Source§

impl<S: Field> Cross for Vect<3, S>

Source§

type Output = Vect<3, S>

Source§

fn cross(self, other: Self) -> Vect<3, S>

Source§

impl<S: Ring + Debug, const N: usize> Debug for Vect<N, S>

Source§

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

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

impl<const N: usize, S: Ring> Default for Vect<N, S>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<S: Ring + Display, const N: usize> Display for Vect<N, S>

Source§

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

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

impl<S: Ring, const N: usize> Div<S> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: S) -> Self::Output

Performs the / operation. Read more
Source§

impl<S: Ring, const N: usize> DivAssign<S> for Vect<N, S>

Source§

fn div_assign(&mut self, rhs: S)

Performs the /= operation. Read more
Source§

impl<S: Field, const N: usize> Dot<Nrml<N, S>> for Vect<N, S>

Source§

type Output = S

Source§

fn dot(self, other: Nrml<N, S>) -> S

Source§

impl<S: Field, const N: usize> Dot<Vect<N, S>> for Nrml<N, S>

Source§

type Output = S

Source§

fn dot(self, other: Vect<N, S>) -> S

Source§

impl<S: Ring, const N: usize> Dot<Vect<N, S>> for Vect<N, S>

Source§

type Output = S

Source§

fn dot(self, other: Self) -> Self::Output

Source§

impl<S: Field, const N: usize> From<Nrml<N, S>> for Vect<N, S>

Source§

fn from(value: Nrml<N, S>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize, S: Hash> Hash for Vect<N, S>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<S: Ring, const N: usize> Index<RangeFull> for Vect<N, S>

Source§

type Output = [S]

The returned type after indexing.
Source§

fn index(&self, index: RangeFull) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<S: Ring, const N: usize> Index<usize> for Vect<N, S>

Source§

type Output = S

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<S: Ring, const N: usize> IndexMut<usize> for Vect<N, S>

Source§

fn index_mut(&mut self, i: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Mul<Mat<N, M, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the * operator.
Source§

fn mul(self, matrix: Mat<N, M, S>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Ring, const N: usize> Mul<S> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: S) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Field, const N: usize, const M: usize> Mul<Vect<M, S>> for Mat<N, M, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the * operator.
Source§

fn mul(self, vector: Vect<M, S>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Ring, const N: usize> MulAssign<S> for Vect<N, S>

Source§

fn mul_assign(&mut self, rhs: S)

Performs the *= operation. Read more
Source§

impl<S: Ring, const N: usize> Neg for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const N: usize, S: PartialEq> PartialEq for Vect<N, S>

Source§

fn eq(&self, other: &Vect<N, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: Field, const N: usize> ProjRej<Nrml<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn proj(self, axis: Nrml<N, S>) -> Self

Source§

fn rej(self, axis: Nrml<N, S>) -> Self

Source§

fn proj_rej(self, axis: Nrml<N, S>) -> (Self, Self)

Source§

impl<S: Field, const N: usize> ProjRej<Option<Nrml<N, S>>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn proj(self, axis: Option<Nrml<N, S>>) -> Self

Source§

fn rej(self, axis: Option<Nrml<N, S>>) -> Self

Source§

fn proj_rej(self, axis: Option<Nrml<N, S>>) -> (Self, Self)

Source§

impl<S: Field, const N: usize> ProjRej<Vect<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn proj(self, axis: Vect<N, S>) -> Self::Output

Source§

fn rej(self, axis: Vect<N, S>) -> Self::Output

Source§

fn proj_rej(self, axis: Vect<N, S>) -> (Self::Output, Self::Output)

Source§

impl<S: Field, const N: usize> Refl<Nrml<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn refl(self, axis: Nrml<N, S>) -> Self::Output

Source§

impl<S: Field, const N: usize> Refl<Option<Nrml<N, S>>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn refl(self, axis: Option<Nrml<N, S>>) -> Self::Output

Source§

impl<S: Field, const N: usize> Refl<Vect<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

Source§

fn refl(self, axis: Vect<N, S>) -> Self::Output

Source§

impl<S: Field, const N: usize> Sub<Nrml<N, S>> for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Nrml<N, S>) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: Field, const N: usize> Sub<Vect<N, S>> for Nrml<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vect<N, S>) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: Ring, const N: usize> Sub for Vect<N, S>

Source§

type Output = Vect<N, S>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<S: Ring, const N: usize> SubAssign for Vect<N, S>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<S: Ring, const N: usize> Sum for Vect<N, S>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const N: usize, S: Copy> Copy for Vect<N, S>

Source§

impl<const N: usize, S: Eq> Eq for Vect<N, S>

Source§

impl<const N: usize, S> StructuralPartialEq for Vect<N, S>

Auto Trait Implementations§

§

impl<const N: usize, S> Freeze for Vect<N, S>
where S: Freeze,

§

impl<const N: usize, S> RefUnwindSafe for Vect<N, S>
where S: RefUnwindSafe,

§

impl<const N: usize, S> Send for Vect<N, S>
where S: Send,

§

impl<const N: usize, S> Sync for Vect<N, S>
where S: Sync,

§

impl<const N: usize, S> Unpin for Vect<N, S>
where S: Unpin,

§

impl<const N: usize, S> UnwindSafe for Vect<N, S>
where S: 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<A, T> Apl<T> for A
where T: Aplable<A>,

Source§

type Output = <T as Aplable<A>>::Output

Source§

fn apl(self, other: T) -> <A as Apl<T>>::Output

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> Maybe<T> for T

Source§

fn maybe(self) -> Option<T>

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 = Infallible

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

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

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.