diff --git a/flix/vector.h b/flix/vector.h index 5b2df3f..02779af 100644 --- a/flix/vector.h +++ b/flix/vector.h @@ -79,7 +79,7 @@ public: static float angleBetweenVectors(const Vector& a, const Vector& b) { - return acos(dot(a, b) / (a.norm() * b.norm())); + return acos(constrain(dot(a, b) / (a.norm() * b.norm()), -1, 1)); } static Vector angularRatesBetweenVectors(const Vector& u, const Vector& v)