52 m[0][0] = 1;
m[0][1] = 0;
m[0][2] = 0;
53 m[1][0] = 0;
m[1][1] = 1;
m[1][2] = 0;
54 m[2][0] = 0;
m[2][1] = 0;
m[2][2] = 1;
72 Matrix3x3(
float a11,
float a12,
float a13,
float a21,
float a22,
float a23,
float a31,
float a32,
float a33) {
73 m[0][0] = a11;
m[0][1] = a12;
m[0][2] = a13;
74 m[1][0] = a21;
m[1][1] = a22;
m[1][2] = a23;
75 m[2][0] = a31;
m[2][1] = a32;
m[2][2] = a33;
86 m[0][0] + other.
m[0][0],
m[0][1] + other.
m[0][1],
m[0][2] + other.
m[0][2],
87 m[1][0] + other.
m[1][0],
m[1][1] + other.
m[1][1],
m[1][2] + other.
m[1][2],
88 m[2][0] + other.
m[2][0],
m[2][1] + other.
m[2][1],
m[2][2] + other.
m[2][2]
100 m[0][0] - other.
m[0][0],
m[0][1] - other.
m[0][1],
m[0][2] - other.
m[0][2],
101 m[1][0] - other.
m[1][0],
m[1][1] - other.
m[1][1],
m[1][2] - other.
m[1][2],
102 m[2][0] - other.
m[2][0],
m[2][1] - other.
m[2][1],
m[2][2] - other.
m[2][2]
114 m[0][0] * other.
m[0][0] +
m[0][1] * other.
m[1][0] +
m[0][2] * other.
m[2][0],
m[0][0] * other.
m[0][1] +
m[0][1] * other.
m[1][1] +
m[0][2] * other.
m[2][1],
m[0][0] * other.
m[0][2] +
m[0][1] * other.
m[1][2] +
m[0][2] * other.
m[2][2],
115 m[1][0] * other.
m[0][0] +
m[1][1] * other.
m[1][0] +
m[1][2] * other.
m[2][0],
m[1][0] * other.
m[0][1] +
m[1][1] * other.
m[1][1] +
m[1][2] * other.
m[2][1],
m[1][0] * other.
m[0][2] +
m[1][1] * other.
m[1][2] +
m[1][2] * other.
m[2][2],
116 m[2][0] * other.
m[0][0] +
m[2][1] * other.
m[1][0] +
m[2][2] * other.
m[2][0],
m[2][0] * other.
m[0][1] +
m[2][1] * other.
m[1][1] +
m[2][2] * other.
m[2][1],
m[2][0] * other.
m[0][2] +
m[2][1] * other.
m[1][2] +
m[2][2] * other.
m[2][2]
128 m[0][0] * scalar,
m[0][1] * scalar,
m[0][2] * scalar,
129 m[1][0] * scalar,
m[1][1] * scalar,
m[1][2] * scalar,
130 m[2][0] * scalar,
m[2][1] * scalar,
m[2][2] * scalar
140 return m[0][0] * (
m[1][1] *
m[2][2] -
m[1][2] *
m[2][1])
141 -
m[0][1] * (
m[1][0] *
m[2][2] -
m[1][2] *
m[2][0])
142 +
m[0][2] * (
m[1][0] *
m[2][1] -
m[1][1] *
m[2][0]);
156 float invDet = 1.0f / det;
159 (
m[1][1] *
m[2][2] -
m[1][2] *
m[2][1]) * invDet,
160 (
m[0][2] *
m[2][1] -
m[0][1] *
m[2][2]) * invDet,
161 (
m[0][1] *
m[1][2] -
m[0][2] *
m[1][1]) * invDet,
163 (
m[1][2] *
m[2][0] -
m[1][0] *
m[2][2]) * invDet,
164 (
m[0][0] *
m[2][2] -
m[0][2] *
m[2][0]) * invDet,
165 (
m[0][2] *
m[1][0] -
m[0][0] *
m[1][2]) * invDet,
167 (
m[1][0] *
m[2][1] -
m[1][1] *
m[2][0]) * invDet,
168 (
m[0][1] *
m[2][0] -
m[0][0] *
m[2][1]) * invDet,
169 (
m[0][0] *
m[1][1] -
m[0][1] *
m[1][0]) * invDet
Matrix3x3 operator-(const Matrix3x3 &other) const
Subtracts another matrix from this matrix.
float m[3][3]
The elements of the matrix.
Matrix3x3 inverse() const
Calculates the inverse of the matrix.
float determinant() const
Calculates the determinant of the matrix.
Matrix3x3 operator+(const Matrix3x3 &other) const
Adds another matrix to this matrix.
Matrix3x3 operator*(float scalar) const
Multiplies this matrix by a scalar.
Matrix3x3 operator*(const Matrix3x3 &other) const
Multiplies this matrix by another matrix.
Matrix3x3()
Default constructor.
Matrix3x3(float a11, float a12, float a13, float a21, float a22, float a23, float a31, float a32, float a33)
Parameterized constructor.