[wpimath] Use ct_matrix instead of Eigen/LU for determinant in headers (#7600)

This caught a bug in ct_matrix's 3x3 determinant.
This commit is contained in:
Tyler Veness
2024-12-28 14:03:29 -08:00
committed by GitHub
parent 46d401553e
commit 57344ef3b2
3 changed files with 12 additions and 6 deletions

View File

@@ -334,7 +334,7 @@ class ct_matrix {
requires(Rows == 3 && Cols == 3)
{
// |a b c|
// |d e f| = aei + bfg + cgh - ceg - bdi - afh
// |d e f| = aei + bfg + cdh - ceg - bdi - afh
// |g h i|
Scalar a = (*this)(0, 0);
Scalar b = (*this)(0, 1);
@@ -345,7 +345,7 @@ class ct_matrix {
Scalar g = (*this)(2, 0);
Scalar h = (*this)(2, 1);
Scalar i = (*this)(2, 2);
return a * e * i + b * f * g + c * g * h - c * e * g - b * d * i -
return a * e * i + b * f * g + c * d * h - c * e * g - b * d * i -
a * f * h;
}