Talk:Conversion between quaternions and Euler angles: Difference between revisions

Content deleted Content added
Line 49:
 
The '''Quaternion to Euler Angles Conversion''' when used with a Quaternion created with '''Euler Angles to Quaternion Conversion''' does not provide back the same Euler angles originally used for input. Take for example inputs for creating the quaternion of <code>roll = 180, pitch = 90, yaw = 45</code>, if you create a quaternion using the <code>ToQuaternion()</code> function and then use the result as input for <code>ToEulerAngles()</code> the result is <code>roll = 180, pitch = 90, yaw = 26.565</code>. This is likely due to multiple sets of Euler angles satisfying any quaternion, but the page should make that more clear. [[User:Drankinatty|Drankinatty]] ([[User talk:Drankinatty|talk]]) 04:27, 11 February 2020 (UTC)
 
:The C++ code got the pitch computation wrong it should be:
:'''double sinp = std::sqrt(1 + 2 * (q.w * q.y - q.x * q.z))'''
:'''double cosp = std::sqrt(1 - 2 * (q.w * q.y - q.x * q.z))'''
:Rather than:
:double sinp = std::sqrt(1 + 2 * (q.w * q.x - q.y * q.z));
:double cosp = std::sqrt(1 - 2 * (q.w * q.x - q.y * q.z)); [[User:Rfspadaro|Rfspadaro]] ([[User talk:Rfspadaro|talk]]) 18:20, 5 January 2023 (UTC)
 
== Matrices and handedness ==