Struct nalgebra::DVec3
[−]
[src]
pub struct DVec3<N> { // some fields omitted }
Stack-allocated, dynamically sized vector with a maximum size of 3.
Methods
impl<N> DVec3<N>
[src]
fn len(&self) -> usize
The number of elements of this vector.
unsafe fn new_uninitialized(dim: usize) -> DVec3<N>
Creates an uninitialized vec of dimension dim
.
impl<N: Zero + Copy + Clone> DVec3<N>
[src]
fn new_zeros(dim: usize) -> DVec3<N>
fn is_zero(&self) -> bool
Tests if all components of the vector are zeroes.
impl<N> DVec3<N>
[src]
fn as_ref<'a>(&'a self) -> &'a [N]
Slices this vector.
fn as_mut<'a>(&'a mut self) -> &'a mut [N]
Mutably slices this vector.
impl<N: One + Zero + Copy + Clone> DVec3<N>
[src]
impl<N: Rand + Zero> DVec3<N>
[src]
fn new_random(dim: usize) -> DVec3<N>
Builds a vector filled with random values.
impl<N: BaseFloat + ApproxEq<N>> DVec3<N>
[src]
fn canonical_basis_with_dim(dim: usize) -> Vec<DVec3<N>>
Computes the canonical basis for the given dimension. A canonical basis is a set of vectors, mutually orthogonal, with all its component equal to 0.0 except one which is equal to 1.0.
fn orthogonal_subspace_basis(&self) -> Vec<DVec3<N>>
Computes a basis of the space orthogonal to the vector. If the input vector is of dimension
n
, this will return n - 1
vectors.
impl<N: Copy + Zero> DVec3<N>
[src]
impl<N: Copy + Zero> DVec3<N>
[src]
fn from_slice(dim: usize, vec: &[N]) -> DVec3<N>
Builds a vector filled with the components provided by a vector.
The vector must have at least dim
elements.
impl<N: Zero> DVec3<N>
[src]
fn from_fn<F: FnMut(usize) -> N>(dim: usize, f: F) -> DVec3<N>
Builds a vector filled with the result of a function.
Trait Implementations
impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N> + Zero> Mul<DMat3<N>> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the *
operator
fn mul(self, right: DMat3<N>) -> DVec3<N>
The method for the *
operator
impl<N: PartialEq> PartialEq for DVec3<N>
[src]
fn eq(&self, other: &DVec3<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<N: Clone> Clone for DVec3<N>
[src]
fn clone(&self) -> DVec3<N>
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<N> Shape<usize> for DVec3<N>
[src]
impl<N: Copy> Indexable<usize, N> for DVec3<N>
[src]
fn swap(&mut self, i: usize, j: usize)
Swaps the i
-th element of self
with its j
-th element.
unsafe fn unsafe_at(&self, i: usize) -> N
Reads the i
-th element of self
. Read more
unsafe fn unsafe_set(&mut self, i: usize, val: N)
Writes to the i
-th element of self
. Read more
impl<N, T> Index<T> for DVec3<N> where [N]: Index<T>
[src]
type Output = [N]::Output
The returned type after indexing
fn index(&self, i: T) -> &[N]::Output
The method for the indexing (Foo[Bar]
) operation
impl<N, T> IndexMut<T> for DVec3<N> where [N]: IndexMut<T>
[src]
impl<N> Iterable<N> for DVec3<N>
[src]
impl<N> IterableMut<N> for DVec3<N>
[src]
impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N>> Axpy<N> for DVec3<N>
[src]
impl<N: Copy + Mul<N, Output=N> + Zero> Mul<DVec3<N>> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the *
operator
fn mul(self, right: DVec3<N>) -> DVec3<N>
The method for the *
operator
impl<N: Copy + Div<N, Output=N> + Zero> Div<DVec3<N>> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the /
operator
fn div(self, right: DVec3<N>) -> DVec3<N>
The method for the /
operator
impl<N: Copy + Add<N, Output=N> + Zero> Add<DVec3<N>> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the +
operator
fn add(self, right: DVec3<N>) -> DVec3<N>
The method for the +
operator
impl<N: Copy + Sub<N, Output=N> + Zero> Sub<DVec3<N>> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the -
operator
fn sub(self, right: DVec3<N>) -> DVec3<N>
The method for the -
operator
impl<N: Neg<Output=N> + Zero + Copy> Neg for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the -
operator
fn neg(self) -> DVec3<N>
The method for the unary -
operator
impl<N: BaseNum> Dot<N> for DVec3<N>
[src]
impl<N: BaseFloat> Norm<N> for DVec3<N>
[src]
fn sqnorm(&self) -> N
Computes the squared norm of self
. Read more
fn normalize(&self) -> DVec3<N>
Gets the normalized version of a copy of v
.
fn normalize_mut(&mut self) -> N
Normalizes self
.
fn norm(&self) -> N
Computes the norm of self
.
impl<N: BaseFloat + Cast<f64>> Mean<N> for DVec3<N>
[src]
impl<N: ApproxEq<N>> ApproxEq<N> for DVec3<N>
[src]
fn approx_epsilon(_: Option<DVec3<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<DVec3<N>>) -> u32
Default ULPs for approximation.
fn approx_eq_eps(&self, other: &DVec3<N>, epsilon: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &DVec3<N>, ulps: u32) -> bool
Tests approximate equality using units in the last place (ULPs)
fn approx_eq(&self, other: &Self) -> bool
Tests approximate equality.
impl<N: Copy + Mul<N, Output=N> + Zero> Mul<N> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the *
operator
fn mul(self, right: N) -> DVec3<N>
The method for the *
operator
impl<N: Copy + Div<N, Output=N> + Zero> Div<N> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the /
operator
fn div(self, right: N) -> DVec3<N>
The method for the /
operator
impl<N: Copy + Add<N, Output=N> + Zero> Add<N> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the +
operator
fn add(self, right: N) -> DVec3<N>
The method for the +
operator
impl<N: Copy + Sub<N, Output=N> + Zero> Sub<N> for DVec3<N>
[src]
type Output = DVec3<N>
The resulting type after applying the -
operator
fn sub(self, right: N) -> DVec3<N>
The method for the -
operator
impl<N: Zero> FromIterator<N> for DVec3<N>
[src]
fn from_iter<I: IntoIterator<Item=N>>(param: I) -> DVec3<N>
Creates a value from an iterator. Read more