From 445ac3419e5204205f631e5fd7444205213b4765 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 19 Nov 2022 01:57:33 +0300 Subject: [PATCH] Fix NaN in geom::slerp --- libs/geom/include/psemek/geom/vector.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/geom/include/psemek/geom/vector.hpp b/libs/geom/include/psemek/geom/vector.hpp index 2c92f7ac..123175ba 100644 --- a/libs/geom/include/psemek/geom/vector.hpp +++ b/libs/geom/include/psemek/geom/vector.hpp @@ -370,7 +370,7 @@ namespace psemek::geom // sin(x) Taylor series is less than the minimum value representable by T static auto const threshold = std::pow(6 * std::numeric_limits::min(), T{1}/T{3}); - auto const omega = std::acos(dot(normalized(v0), normalized(v1))); + auto const omega = angle(normalized(v0), normalized(v1)); // NB: the case of omega ~ pi is ambiguous and isn't handled in any special way