BSNS102 Study Guide - Final Guide: Angle Of Rotation, Linear Interpolation, Cross Product

14 views4 pages

Document Summary

// setup the euler angles, given a rotation matrix. // extract sin(pitch) from m23. float sp = m. m23; // check for gimbel lock if (fabs(sp) > 9. 99999f) { // looking straight up or down pitch = kpiover2 * sp; // compute heading, slam bank to zero heading = atan2( m. m31, m. m11); bank = 0. 0f; We don"t have to use the "safe" asin. // function because we already checked for range errors when. // checking for gimbel lock heading = atan2(m. m13, m. m33); pitch = asin(sp); bank = atan2(m. m21, m. m22); Class quaternion is used to store an orientation or angular displacement in quaternion form. For more information on quaternions, see section 10. 4. From the complete set of mathematical operations that can be performed on quaternions, only those operations that are meaningful for unit quaternions are used for storing angular displacement. For example, quaternion negation, addition, subtraction, multiplication by a scalar, log, and exp are not provided.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers