Struct rla::vector::Vector
[−]
[src]
pub struct Vector<T: Float, N: ArrayLength<T>> where
N::ArrayType: Copy, { pub data: GenericArray<T, N>, }
Fields
data: GenericArray<T, N>
Methods
impl<T, N: ArrayLength<T>> Vector<T, N> where
T: Float + Zero,
N::ArrayType: Copy,
Vector<T, N>: Copy,
[src]
T: Float + Zero,
N::ArrayType: Copy,
Vector<T, N>: Copy,
fn from_one_less(first: Vector<T, Sub1<N>>, val: T) -> Vector<T, N> where
N: Sub<B1>,
<N as Sub<B1>>::Output: ArrayLength<T>,
<<N as Sub<B1>>::Output as ArrayLength<T>>::ArrayType: Copy,
N: Sub<B1>,
<N as Sub<B1>>::Output: ArrayLength<T>,
<<N as Sub<B1>>::Output as ArrayLength<T>>::ArrayType: Copy,
Builds a Vector
Example
use rla::vector::*; let v = Vec3f::from_one_less(Vec2f::new(&[1.0, 2.0]), 3.0); assert!(v == Vec3f::new(&[1.0, 2.0, 3.0]));
fn new(slice: &[T]) -> Vector<T, N>
fn zero() -> Vector<T, N>
fn max(self) -> T
fn dot(self, other: Self) -> T
fn length_sq(self) -> T
fn length(self) -> T
fn project(self, other: Self) -> Self
fn normalize(self) -> Option<Self>
fn reflect(self, other: Self) -> Self
fn distance_sq(self, other: Self) -> T
fn distance(self, other: Self) -> T
Trait Implementations
impl<T: PartialEq + Float, N: PartialEq + ArrayLength<T>> PartialEq for Vector<T, N> where
N::ArrayType: Copy,
[src]
N::ArrayType: Copy,
fn eq(&self, __arg_0: &Vector<T, N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector<T, N>) -> bool
This method tests for !=
.
impl<T: Eq + Float, N: Eq + ArrayLength<T>> Eq for Vector<T, N> where
N::ArrayType: Copy,
[src]
N::ArrayType: Copy,
impl<T: Copy + Float, N: Copy + ArrayLength<T>> Copy for Vector<T, N> where
N::ArrayType: Copy,
[src]
N::ArrayType: Copy,
impl<T: Debug + Float, N: Debug + ArrayLength<T>> Debug for Vector<T, N> where
N::ArrayType: Copy,
[src]
N::ArrayType: Copy,
impl<T, N> Clone for Vector<T, N> where
N: ArrayLength<T>,
N::ArrayType: Copy,
T: Float,
[src]
N: ArrayLength<T>,
N::ArrayType: Copy,
T: Float,
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T, N> Sub for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the -
operator
fn sub(self, other: Self) -> Self::Output
The method for the -
operator
impl<T, N> Add for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the +
operator
fn add(self, other: Self) -> Self::Output
The method for the +
operator
impl<T, N> Mul for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the *
operator
fn mul(self, other: Self) -> Self::Output
The method for the *
operator
impl<T, N> Div for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the /
operator
fn div(self, other: Self) -> Self::Output
The method for the /
operator
impl<T, N> Mul<T> for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the *
operator
fn mul(self, other: T) -> Self::Output
The method for the *
operator
impl<T, N> Add<T> for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the +
operator
fn add(self, other: T) -> Self::Output
The method for the +
operator
impl<T, N> Sub<T> for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
type Output = Vector<T, N>
The resulting type after applying the -
operator
fn sub(self, other: T) -> Self::Output
The method for the -
operator
impl<T, N> Div<T> for Vector<T, N> where
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,
[src]
N::ArrayType: Copy,
N: ArrayLength<T>,
T: Float,