diff --git a/src/core/include/pw/core/quaternion.hpp b/src/core/include/pw/core/quaternion.hpp index 3ff5b1e..276ab77 100644 --- a/src/core/include/pw/core/quaternion.hpp +++ b/src/core/include/pw/core/quaternion.hpp @@ -53,8 +53,8 @@ template struct quaternion final { return std::forward(self).q_.w(); } - constexpr auto - operator*(const quaternion& rhs) const noexcept -> quaternion { + constexpr auto operator*(const quaternion& rhs) const noexcept + -> quaternion { return {rhs.w() * x() + rhs.x() * w() + rhs.y() * z() - rhs.z() * y(), rhs.w() * y() - rhs.x() * z() + rhs.y() * w() + rhs.z() * x(), rhs.w() * z() + rhs.x() * y() - rhs.y() * x() + rhs.z() * w(), @@ -130,9 +130,10 @@ template struct quaternion final { /** * @note: a and b need to be normalized */ - static constexpr auto - slerp(const quaternion& a, const quaternion& b, const Scalar& t, - const Scalar& eps = Scalar{0.001}) -> quaternion { + static constexpr auto slerp(const quaternion& a, const quaternion& b, + const Scalar& t, + const Scalar& eps = Scalar{0.001}) + -> quaternion { // Calculate angle between them. const Scalar cos_half_theta{a.dot(b)}; @@ -166,8 +167,8 @@ template struct quaternion final { }; } - static constexpr auto - from_axisangle(const axisangle& aa) -> quaternion { + static constexpr auto from_axisangle(const axisangle& aa) + -> quaternion { const auto sin_half_angle{std::sin(aa.angle / Scalar{2})}; @@ -179,8 +180,8 @@ template struct quaternion final { }; } - constexpr static auto - from_matrix(const matrix& m) -> quaternion { + constexpr static auto from_matrix(const matrix& m) + -> quaternion { const auto wtemp = std::sqrt(Scalar{1} + m[0][0] + m[1][1] + m[2][2]) / Scalar{2}; const auto w4 = Scalar{4} * wtemp;