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>
impl<N: Zero + Copy + Clone> DVec3<N>
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>
fn as_slice<'a>(&'a self) -> &'a [N]
Slices this vector.
fn as_mut_slice<'a>(&'a mut self) -> &'a mut [N]
Mutably slices this vector.
impl<N: One + Zero + Copy + Clone> DVec3<N>
impl<N: Rand + Zero> DVec3<N>
fn new_random(dim: usize) -> DVec3<N>
Builds a vector filled with random values.
impl<N: BaseFloat + ApproxEq<N>> DVec3<N>
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>
impl<N: Copy + Zero> DVec3<N>
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>
fn from_fn<F: FnMut(usize) -> N>(dim: usize, f: F) -> DVec3<N>
Builds a vector filled with the result of a function.