[−][src]Struct aljabar::Vector
N-element vector.
Vectors can be constructed from arrays of any type and size. There are convenience constructor functions provided for the most common sizes.
Methods
impl<T, const N: usize> Vector<T, { N }>
[src]
pub fn trunc(self) -> (TruncatedVector<T, { N }>, T)
[src]
Drop the last component and return the vector with one fewer dimension.
Trait Implementations
impl<T, const N: usize> Zero for Vector<T, { N }> where
T: Zero,
[src]
T: Zero,
impl<T, const N: usize> VectorSpace for Vector<T, { N }> where
T: Clone + Zero,
T: Add<T, Output = T>,
T: Sub<T, Output = T>,
T: Mul<T, Output = T>,
T: Div<T, Output = T>,
[src]
T: Clone + Zero,
T: Add<T, Output = T>,
T: Sub<T, Output = T>,
T: Mul<T, Output = T>,
T: Div<T, Output = T>,
impl<T, const N: usize> MetricSpace for Vector<T, { N }> where
Self: InnerSpace,
[src]
Self: InnerSpace,
impl<T, const N: usize> InnerSpace for Vector<T, { N }> where
T: Clone + Zero,
T: Add<T, Output = T>,
T: Sub<T, Output = T>,
T: Mul<T, Output = T>,
T: Div<T, Output = T>,
T: AddAssign<T>,
Self: Clone,
[src]
T: Clone + Zero,
T: Add<T, Output = T>,
T: Sub<T, Output = T>,
T: Mul<T, Output = T>,
T: Div<T, Output = T>,
T: AddAssign<T>,
Self: Clone,
fn dot(self, rhs: Self) -> T
[src]
fn magnitude2(self) -> Self::Scalar
[src]
Returns the squared length of the value.
impl<A, B, RHS, const N: usize> PartialEq<RHS> for Vector<A, { N }> where
RHS: Deref<Target = [B; {N}]>,
A: PartialEq<B>,
[src]
RHS: Deref<Target = [B; {N}]>,
A: PartialEq<B>,
fn eq(&self, other: &RHS) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T, const N: usize> Copy for Vector<T, { N }> where
T: Copy,
[src]
T: Copy,
impl<T, const N: usize> Eq for Vector<T, { N }> where
T: Eq,
[src]
T: Eq,
impl<T, const N: usize> From<[T; N]> for Vector<T, { N }>
[src]
impl<T, const N: usize> Into<[T; N]> for Vector<T, { N }>
[src]
impl<T, const N: usize> Clone for Vector<T, { N }> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T, const N: usize> Deref for Vector<T, { N }>
[src]
impl<T, const N: usize> DerefMut for Vector<T, { N }>
[src]
impl<A, B, const N: usize> Add<Vector<B, N>> for Vector<A, { N }> where
A: Add<B>,
[src]
A: Add<B>,
type Output = Vector<<A as Add<B>>::Output, { N }>
The resulting type after applying the +
operator.
fn add(self, rhs: Vector<B, { N }>) -> Self::Output
[src]
impl<A, B, const N: usize> Sub<Vector<B, N>> for Vector<A, { N }> where
A: Sub<B>,
[src]
A: Sub<B>,
type Output = Vector<<A as Sub<B>>::Output, { N }>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector<B, { N }>) -> Self::Output
[src]
impl<A, B, const N: usize> Mul<B> for Vector<A, { N }> where
A: Mul<B>,
B: Clone,
[src]
A: Mul<B>,
B: Clone,
Scalar multiply
type Output = Vector<<A as Mul<B>>::Output, { N }>
The resulting type after applying the *
operator.
fn mul(self, scalar: B) -> Self::Output
[src]
impl<T, const N: usize, const M: usize> Mul<Vector<T, M>> for Matrix<T, { N }, { M }> where
T: Add<T, Output = T> + Mul<T, Output = T> + Clone,
Vector<T, { M }>: InnerSpace,
[src]
T: Add<T, Output = T> + Mul<T, Output = T> + Clone,
Vector<T, { M }>: InnerSpace,
type Output = Vector<<Vector<T, { M }> as VectorSpace>::Scalar, { N }>
The resulting type after applying the *
operator.
fn mul(self, rhs: Vector<T, { M }>) -> Self::Output
[src]
impl<A, B, const N: usize> Div<B> for Vector<A, { N }> where
A: Div<B>,
B: Clone,
[src]
A: Div<B>,
B: Clone,
Scalar divide
type Output = Vector<<A as Div<B>>::Output, { N }>
The resulting type after applying the /
operator.
fn div(self, scalar: B) -> Self::Output
[src]
impl<T, const N: usize> Neg for Vector<T, { N }> where
T: Neg,
[src]
T: Neg,
type Output = Vector<<T as Neg>::Output, { N }>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<A, B, const N: usize> AddAssign<Vector<B, N>> for Vector<A, { N }> where
A: AddAssign<B>,
[src]
A: AddAssign<B>,
fn add_assign(&mut self, rhs: Vector<B, { N }>)
[src]
impl<A, B, const N: usize> SubAssign<Vector<B, N>> for Vector<A, { N }> where
A: SubAssign<B>,
[src]
A: SubAssign<B>,
fn sub_assign(&mut self, rhs: Vector<B, { N }>)
[src]
impl<A, B, const N: usize> MulAssign<B> for Vector<A, { N }> where
A: MulAssign<B>,
B: Clone,
[src]
A: MulAssign<B>,
B: Clone,
Scalar multiply assign
fn mul_assign(&mut self, scalar: B)
[src]
impl<A, B, const N: usize> DivAssign<B> for Vector<A, { N }> where
A: DivAssign<B>,
B: Clone,
[src]
A: DivAssign<B>,
B: Clone,
Scalar divide assign
fn div_assign(&mut self, scalar: B)
[src]
impl<T, const N: usize> Debug for Vector<T, { N }> where
T: Debug,
[src]
T: Debug,
Auto Trait Implementations
impl<const N: usize, T> Send for Vector<T, N> where
T: Send,
T: Send,
impl<const N: usize, T> Unpin for Vector<T, N> where
T: Unpin,
T: Unpin,
impl<const N: usize, T> Sync for Vector<T, N> where
T: Sync,
T: Sync,
impl<const N: usize, T> UnwindSafe for Vector<T, N> where
T: UnwindSafe,
T: UnwindSafe,
impl<const N: usize, T> RefUnwindSafe for Vector<T, N> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> RealMetricSpace for T where
T: MetricSpace,
<T as MetricSpace>::Metric: Real,
[src]
T: MetricSpace,
<T as MetricSpace>::Metric: Real,
impl<T> RealInnerSpace for T where
T: InnerSpace,
<T as VectorSpace>::Scalar: Real,
[src]
T: InnerSpace,
<T as VectorSpace>::Scalar: Real,
fn magnitude(self) -> Self::Scalar
[src]
Returns the length of the vector.
fn normalize(self) -> Self where
Self::Scalar: One,
[src]
Self::Scalar: One,
Returns a vector with the same direction and a magnitude of 1
.
fn normalize_to(self, magnitude: Self::Scalar) -> Self
[src]
Returns a vector with the same direction and a given magnitude.
fn project_on(self, other: Self) -> Self
[src]
Returns the vector projection of the current inner space projected onto the supplied argument. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,