Skip to content

Matrix3

A 3x3 matrix class for mathematical operations.

Stores the matrix in column-major order using three Vector3 columns. Commonly used for representing linear transformations.

Functions

Matrix3() constexpr

cpp
vglx::Matrix3::Matrix3(const Matrix4 &m)
ParameterDescription
m4x4 matrix.

Constructs a Matrix3 object from a Matrix4. Extracts the upper-left 3x3 submatrix from a 4x4 matrix.

Matrix3() constexpr

cpp
vglx::Matrix3::Matrix3(const Vector3 &a, const Vector3 &b, const Vector3 &c)
ParameterDescription
aFirst column vector.
bSecond column vector.
cThird column vector.

Constructs a Matrix3 object from three column vectors.

Matrix3() constexpr

cpp
vglx::Matrix3::Matrix3(float n00, float n01, float n02, float n10, float n11, float n12, float n20, float n21, float n22)
ParameterDescription
n00First row, first element.
n01First row, second element.
n02First row, third element.
n10Second row, first element.
n11Second row, second element.
n12Second row, third element.
n20Third row, first element.
n21Third row, second element.
n22Third row, third element.

Constructs a Matrix3 object from individual components (row-major).

Matrix3() constexpr

cpp
vglx::Matrix3::Matrix3(float value)
ParameterDescription
valueValue to place on the diagonal.

Constructs a diagonal Matrix3 with the given scalar value.

operator()() auto &

cpp
auto & vglx::Matrix3::operator()(int i, int j)
ParameterDescription
iRow index (0 to 2).
jColumn index (0 to 2).

Access matrix element by (row, column).

operator()() const auto &

cpp
const auto & vglx::Matrix3::operator()(int i, int j) const
ParameterDescription
iRow index (0 to 2).
jColumn index (0 to 2).

Access matrix element by (row, column) (const).

operator[]() auto &

cpp
auto & vglx::Matrix3::operator[](int j)
ParameterDescription
jColumn index (0 to 2).

Access matrix column vector by index.

operator[]() const auto &

cpp
const auto & vglx::Matrix3::operator[](int j) const
ParameterDescription
jColumn index (0 to 2).

Access matrix column vector by index (const).

Matrix3::Identity() auto

cpp
static constexpr auto vglx::Matrix3::Identity()

Returns the identity matrix.

Determinant() VGLX_EXPORT constexpr auto

cpp
VGLX_EXPORT constexpr auto Determinant(const Matrix3 &m)
ParameterDescription
mInput matrix.

Computes the determinant of a Matrix3 object.

Inverse() VGLX_EXPORT constexpr auto

cpp
VGLX_EXPORT constexpr auto Inverse(const Matrix3 &m)
ParameterDescription
mInput matrix.

Computes the inverse of a Matrix3 object.

Transpose() VGLX_EXPORT constexpr auto

cpp
VGLX_EXPORT constexpr auto Transpose(const Matrix3 &m)
ParameterDescription
mInput matrix.

Computes the transpose of a Matrix3 object.

Released under the MIT License.