Type Definition nalgebra::base::MatrixN [−][src]
pub type MatrixN<N, D> = Matrix<N, D, D, Owned<N, D, D>>;
Expand description
A statically sized column-major square matrix with D
rows and columns.
Because this is an alias, not all its methods are listed here. See the Matrix
type too.
Implementations
Creates a new homogeneous matrix that applies the same scaling factor on each dimension.
pub fn new_nonuniform_scaling<SB>(
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
pub fn new_nonuniform_scaling<SB>(
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
Creates a new homogeneous matrix that applies a distinct scaling factor for each dimension.
pub fn new_translation<SB>(
translation: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
pub fn new_translation<SB>(
translation: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
Creates a new homogeneous matrix that applies a pure translation.
Creates a square matrix with its diagonal set to diag
and all other entries set to 0.
Example
let m = Matrix3::from_diagonal(&Vector3::new(1.0, 2.0, 3.0)); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_diagonal(&DVector::from_row_slice(&[1.0, 2.0, 3.0])); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 && m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 3.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 && dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 3.0);
Trait Implementations
impl<N: SimdRealField, D: DimName, R> From<Isometry<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>> + Allocator<N, D>,
impl<N: SimdRealField, D: DimName, R> From<Isometry<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>> + Allocator<N, D>,
impl<N: SimdRealField, D: DimName, R> From<Similarity<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
impl<N: SimdRealField, D: DimName, R> From<Similarity<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
Performs the conversion.
impl<N: RealField, D: DimName, C> From<Transform<N, D, C>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
C: TCategory,
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
impl<N: RealField, D: DimName, C> From<Transform<N, D, C>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
C: TCategory,
DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
impl<N: Scalar + Zero + One, D: DimName> From<Translation<N, D>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
impl<N: Scalar + Zero + One, D: DimName> From<Translation<N, D>> for MatrixN<N, DimNameSum<D, U1>> where
D: DimNameAdd<U1>,
DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>,
Performs the conversion.