#[repr(C)]
pub struct Matrix3x3 { /* private fields */ }
Expand description
A 3x3 matrix struct used for graphics programming with OpenGL.
Creates a new 3x3 matrix.
m0 … m8: The values of the matrix.
A new 3x3 matrix.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::new(
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0
);
Creates a new 3x3 matrix with all elements set to zero.
A new 3x3 matrix with all elements set to zero.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::zero();
Creates a new 3x3 identity matrix.
A new 3x3 identity matrix.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::identity();
Transposes the matrix.
A new 3x3 matrix that is the transpose of the original matrix.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::new(
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
);
let m_transpose = m.transpose();
Calculates the trace of the matrix.
The sum of the diagonal elements of the matrix.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::new(
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
);
let trace = m.trace();
Calculates the determinant of the matrix.
The determinant of the matrix.
use cgl_rs::math::Matrix3x3;
let m = Matrix3x3::new(
1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0
);
let det = m.determinant();
The resulting type after applying the +
operator.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
The resulting type after applying the *
operator.
This method tests for self
and other
values to be equal, and is used
by ==
.
This method tests for !=
. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
The resulting type after applying the -
operator.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
Converts the given value to a
String
.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.