From be076e5b1aff9cb1de4ebeca1f42e905e8ad26a0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 17 Aug 2021 18:32:49 +1000 Subject: [PATCH] AP_Math: correct descriptions of quaternion functions --- libraries/AP_Math/quaternion.cpp | 4 ++-- libraries/AP_Math/quaternion.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Math/quaternion.cpp b/libraries/AP_Math/quaternion.cpp index 9760a1aac4..c6e9a5d16e 100644 --- a/libraries/AP_Math/quaternion.cpp +++ b/libraries/AP_Math/quaternion.cpp @@ -51,7 +51,7 @@ void QuaternionT::rotation_matrix(Matrix3d &m) const m.c.z = 1.0f-2.0f*(q2q2 + q3q3); } -// return the rotation matrix equivalent for this quaternion +// populate the supplied rotation matrix equivalent from this quaternion template void QuaternionT::rotation_matrix(Matrix3f &m) const { @@ -76,7 +76,7 @@ void QuaternionT::rotation_matrix(Matrix3f &m) const m.c.z = 1.0f-2.0f*(q2q2 + q3q3); } -// return the rotation matrix equivalent for this quaternion +// make this quaternion equivalent to the supplied matrix // Thanks to Martin John Baker // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm template diff --git a/libraries/AP_Math/quaternion.h b/libraries/AP_Math/quaternion.h index 3a0c479fa6..ce14159382 100644 --- a/libraries/AP_Math/quaternion.h +++ b/libraries/AP_Math/quaternion.h @@ -63,11 +63,11 @@ public: return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4); } - // return the rotation matrix equivalent for this quaternion + // populate the supplied rotation matrix equivalent from this quaternion void rotation_matrix(Matrix3f &m) const; void rotation_matrix(Matrix3d &m) const; - // return the rotation matrix equivalent for this quaternion + // make this quaternion equivalent to the supplied matrix void from_rotation_matrix(const Matrix3 &m); // create a quaternion from a given rotation