Conversion between quaternions and Euler angles: Difference between revisions

Content deleted Content added
m Minor edit for consistency
Eskivor (talk | contribs)
Source code: add precision, there was sign errors for x and y
Tag: Reverted
Line 166:
};
 
Quaternion ToQuaternion(double roll, double pitch, double yaw) // roll (x), pitch (y), yaw (z) angles are in radians
{
// Abbreviations for the various angular functions
Line 179:
Quaternion q;
q.w = cr * cp * cy + sr * sp * sy;
q.x = sr * cp * cy -+ cr * sp * sy;
q.y = cr * sp * cy +- sr * cp * sy;
q.z = cr * cp * sy - sr * sp * cy;