New norms and division by scalar
Some checks failed
Merge-Checker / build_and_test (pull_request) Failing after 21s

This commit is contained in:
2025-06-02 16:19:23 -04:00
parent 60a2b12b5f
commit 64820553c7
5 changed files with 40 additions and 23 deletions

View File

@@ -9,8 +9,7 @@
Quaternion Quaternion::FromAngleAndAxis(float angle, const Matrix<1, 3> &axis) {
const float halfAngle = angle / 2;
const float sinHalfAngle = sin(halfAngle);
Matrix<1, 3> normalizedAxis{};
normalizedAxis = axis.EuclideanNorm();
Matrix<1, 3> normalizedAxis = axis / axis.EuclideanNorm();
return Quaternion{static_cast<float>(cos(halfAngle)),
normalizedAxis.Get(0, 0) * sinHalfAngle,
normalizedAxis.Get(0, 1) * sinHalfAngle,