From 85feacca987ae36c9eaa73efbb6ae774da56aa7d Mon Sep 17 00:00:00 2001 From: alexandre burton Date: Wed, 27 Sep 2023 23:23:51 -0400 Subject: [PATCH] rename length2 to lengthSquared --- libs/openFrameworks/math/ofQuaternion.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/openFrameworks/math/ofQuaternion.h b/libs/openFrameworks/math/ofQuaternion.h index fae52490bb8..ba767289d54 100644 --- a/libs/openFrameworks/math/ofQuaternion.h +++ b/libs/openFrameworks/math/ofQuaternion.h @@ -103,8 +103,9 @@ class ofQuaternion { inline float length() const; /// \brief Length of the quaternion = vec . vec - inline float length2() const; - + inline float lengthSquared() const; + [[deprecated("use lengthSquare")]] inline float length2() const { return lengthSquared(); }; + /// \brief Conjugate inline ofQuaternion conj() const; @@ -462,13 +463,11 @@ float ofQuaternion::length() const { return sqrt(_v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w); } - //---------------------------------------- -float ofQuaternion::length2() const { - return _v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w; +float ofQuaternion::lengthSquared() const { + return _v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w; } - //---------------------------------------- ofQuaternion ofQuaternion::conj() const { return ofQuaternion(-_v.x, -_v.y, -_v.z, _v.w); @@ -477,7 +476,7 @@ ofQuaternion ofQuaternion::conj() const { //---------------------------------------- const ofQuaternion ofQuaternion::inverse() const { - return conj() / length2(); + return conj() / lengthSquared(); }