1
0
forked from josh/j3ml

Implement Diagonal

This commit is contained in:
2024-01-12 05:53:12 -05:00
parent 93759ba545
commit 32046d88cd
2 changed files with 9 additions and 0 deletions

View File

@@ -43,6 +43,8 @@ namespace LinearAlgebra {
Vector3 GetRow(int index) const;
Vector3 GetColumn(int index) const;
Vector3 Diagonal() const;
float At(int x, int y) const;
void SetRotatePart(const Vector3& a, float angle);

View File

@@ -278,5 +278,12 @@ namespace LinearAlgebra {
return m2;
}
Vector3 Matrix3x3::Diagonal() const {
return {elems[0][0],
elems[1][1],
elems[2][2]
};
}
}