mat3
Header file: include/mat3.h
mat3 is a column-major matrix with 3 columns and 3 rows.
\(mat3 = \begin{bmatrix} x.x & y.x & z.x \\ x.y & y.y & z.y \\ x.z & y.z & z.z \end{bmatrix}\)
Class variables
Type |
Name |
Description |
|---|---|---|
x |
The first column of the mat3. |
|
y |
The second column of the mat3. |
|
z |
The third column of the mat3. |
Class functions
Constructors
Name |
Description |
|---|---|
Construct a ([0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]) matrix. |
|
Construct a ([_value, _value, _value], [_value, _value, _value], [_value, _value, _value]) matrix. |
|
Construct a ([_xx, _xy, _xz], [_yx, _yy, _yz], [_zx, _zy, _zz]) matrix. |
|
mat3(float _xx, float _xy, float _xz, float _yx, float _yy, float _yz, const nml::vec3& _z) |
Construct a ([_xx, _xy, _xz], [_yx, _yy, _yz], [_z.x, _z.y, _z.z]) matrix. |
mat3(float _xx, float _xy, float _xz, const nml::vec3& _y, float _zx, float _zy, float _zz) |
Construct a ([_xx, _xy, _xz], [_y.x, _y.y, _y.z], [_zx, _zy, _zz]) matrix. |
mat3(const nml::vec3& _x, float _yy, float _yz, float _zx, float _zy, float _zz) |
Construct a ([_x.x, _x.y, _x.z], [_yx, _yy, _yz], [_zx, _zy, _zz]) matrix. |
mat3(float _xx, float _xy, float _xz, const nml::vec3& _y, const nml::vec3& _z) |
Construct a ([_xx, _xy, _xz], [_y.x, _y.y, _y.z], [_z.x, _z.y, _z.z]) matrix. |
mat3(const nml::vec3& _x, const nml::vec3& _y, float _zx, float _zy, float _zz) |
Construct a ([_x.x, _x.y, _x.z], [_y.x, _y.y, _y.z], [_zx, _zy, _zz]) matrix. |
mat3(const nml::vec3& _x, float _yx, float _yy, float _yz, const nml::vec3& _z) |
Construct a ([_x.x, _x.y, _x.z], [_yx, _yy, _yz], [_z.x, _z.y, _z.z]) matrix. |
mat3(const nml::vec3& _x, const nml::vec3& _y, const nml::vec3& _z) |
Construct a ([_x.x, _x.y, _x.z], [_y.x, _y.y, _y.z], [_z.x, _z.y, _z.z]) matrix. |
Construct a matrix from a pointer. |
|
Construct a ([_mat.x.x, _mat.x.y, _mat.x.z], [_mat.y.x, _mat.y.y, _mat.y.z], [_mat.z.x, _mat.z.y, _mat.z.z]) matrix. |
Operators
Name |
Description |
|---|---|
Add a mat3 to the current mat3. |
|
Substract a mat3 from the current mat3. |
|
Multiply the current mat3 by a mat3. |
|
Multiply the current mat3 by a scalar. |
|
Divide the current mat3 by a scalar. |
|
Return a reference to x if index is 0, a reference to y if index is 1 or a reference to z if index is 2, else, throw an exception. |
|
Return a const reference to x if index is 0, a const reference to y if index is 1 or a const reference to z if index is 2, else, throw an exception. |
Functions
Name |
Description |
|---|---|
Return the determinant of the matrix. |
|
Return three eigenvalues and eigenvectors of the matrix. The matrix must be symmetrical. |
|
Return a pointer to the matrix’s elements. |
Static Functions
Name |
Description |
|---|---|
Return a ([1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]) identity matrix. |
Namespace functions
Operators
Name |
Description |
|---|---|
Return a mat3 that is the sum between two mat3. |
|
Return a mat3 that is the difference between two mat3. |
|
Return a mat3 that is the product between two mat3. |
|
Return a vec3 that is the product between a mat3 and a vec3. |
|
Return a mat3 that is the product between a mat3 and a scalar. |
|
Return a mat3 that is the product between a scalar and a mat3. |
|
Return a mat3 that is the quotient between a mat3 and a scalar. |
|
Return true if the two mat3 are identical, else, return false. |
|
Return true if the two mat3 are different, else, return false. |
Functions
Name |
Description |
|---|---|
Return a mat3 where the columns of mat are the rows and the rows of mat are the columns. |
|
Return the inverse of a mat3. |
|
Return a 2D translation matrix according to the translation vector. |
|
Return a 2D rotation matrix according to the angle (in radians). |
|
Return a 2D scaling matrix according to the scaling factors. |
|
Return a mat3 as a string under the format “[[x.x, x.y, x.z], [y.x, y.y, y.z], [z.x, z.y, z.z]]”. |