Implement GetRow, GetColumn, At methods for Mat2x2

This commit is contained in:
2023-12-29 15:54:46 -05:00
parent c3053ceb3a
commit 0620c8aea5
2 changed files with 25 additions and 2 deletions

View File

@@ -2,4 +2,20 @@
namespace LinearAlgebra {
Vector2 Matrix2x2::GetRow(int index) const {
float x = this->elems[index][0];
float y = this->elems[index][1];
return {x, y};
}
Vector2 Matrix2x2::GetColumn(int index) const {
float x = this->elems[0][index];
float y = this->elems[1][index];
return {x, y};
}
float Matrix2x2::At(int x, int y) const {
return this->elems[x][y];
}
}