@@ -100,8 +100,9 @@ class ofQuaternion {
100100 inline float length () const ;
101101
102102 // / \brief Length of the quaternion = vec . vec
103- inline float length2 () const ;
104-
103+ inline float lengthSquared () const ;
104+ [[deprecated(" use lengthSquare" )]] inline float length2 () const { return lengthSquared (); };
105+
105106 // / \brief Conjugate
106107 inline ofQuaternion conj () const ;
107108
@@ -459,13 +460,11 @@ float ofQuaternion::length() const {
459460 return std::sqrt (_v.x *_v.x + _v.y *_v.y + _v.z *_v.z + _v.w *_v.w );
460461}
461462
462-
463463// ----------------------------------------
464- float ofQuaternion::length2 () const {
465- return _v.x *_v.x + _v.y *_v.y + _v.z *_v.z + _v.w *_v.w ;
464+ float ofQuaternion::lengthSquared () const {
465+ return _v.x *_v.x + _v.y *_v.y + _v.z *_v.z + _v.w *_v.w ;
466466}
467467
468-
469468// ----------------------------------------
470469ofQuaternion ofQuaternion::conj () const {
471470 return ofQuaternion (-_v.x , -_v.y , -_v.z , _v.w );
@@ -474,7 +473,7 @@ ofQuaternion ofQuaternion::conj() const {
474473
475474// ----------------------------------------
476475const ofQuaternion ofQuaternion::inverse () const {
477- return conj () / length2 ();
476+ return conj () / lengthSquared ();
478477}
479478
480479
0 commit comments