Skip to content

Commit 85feacc

Browse files
committed
rename length2 to lengthSquared
1 parent 7a4d222 commit 85feacc

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

libs/openFrameworks/math/ofQuaternion.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ class ofQuaternion {
103103
inline float length() const;
104104

105105
/// \brief Length of the quaternion = vec . vec
106-
inline float length2() const;
107-
106+
inline float lengthSquared() const;
107+
[[deprecated("use lengthSquare")]] inline float length2() const { return lengthSquared(); };
108+
108109
/// \brief Conjugate
109110
inline ofQuaternion conj() const;
110111

@@ -462,13 +463,11 @@ float ofQuaternion::length() const {
462463
return sqrt(_v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w);
463464
}
464465

465-
466466
//----------------------------------------
467-
float ofQuaternion::length2() const {
468-
return _v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w;
467+
float ofQuaternion::lengthSquared() const {
468+
return _v.x*_v.x + _v.y*_v.y + _v.z*_v.z + _v.w*_v.w;
469469
}
470470

471-
472471
//----------------------------------------
473472
ofQuaternion ofQuaternion::conj() const {
474473
return ofQuaternion(-_v.x, -_v.y, -_v.z, _v.w);
@@ -477,7 +476,7 @@ ofQuaternion ofQuaternion::conj() const {
477476

478477
//----------------------------------------
479478
const ofQuaternion ofQuaternion::inverse() const {
480-
return conj() / length2();
479+
return conj() / lengthSquared();
481480
}
482481

483482

0 commit comments

Comments
 (0)