Implement Matrix3x3::IsRowOrthogonal IsColOrthogonal

This commit is contained in:
2024-03-21 18:37:43 -04:00
parent 802c321115
commit 06bb959e3f
2 changed files with 16 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ namespace J3ML::LinearAlgebra {
* vectors in the form M * v. This means that "Matrix3x3 M, M1, M2; M = M1 * M2;" gives a transformation M
* that applies M2 first, followed by M1 second
*/
class Matrix3x3 {
public:
enum { Rows = 3 };
@@ -137,7 +138,10 @@ namespace J3ML::LinearAlgebra {
Vector4 Mul(const Vector4& rhs) const;
Quaternion Mul(const Quaternion& rhs) const;
void IsColOrthogonal();
// Returns true if the column vectors of this matrix are all perpendicular to each other.
bool IsColOrthogonal(float epsilon = 1e-3f) const;
// Returns true if the row vectors of this matrix are all perpendicular to each other.
bool IsRowOrthogonal(float epsilon = 1e-3f) const;
protected:
float elems[3][3];