BSNS102 Study Guide - Final Guide: Atan2, Coordinate Space, Euler Angles

28 views4 pages

Document Summary

Here are the values of the matrix elements involved from equation 10. 23: Now we can translate this directly into code, as shown in the listing below, which converts an iner- tial-to-object quaternion into euler angles: Listing 10. 5: converting an inertial-to-object quaternion to euler angles. // use global variables for input and output float w,x,y,z; float h,p,b; // extract sin(pitch) float sp = 2. 0f * (y*z + w*x); // compute heading, slam bank to zero h = atan2( x*z w*y, 0. 5f y*y z*z); Chapter 10: orientation and angular displacement in 3d. // compute angles p = asin(sp); h = atan2(x*z w*y, 0. 5f x*x y*y); = atan2(x*y w*z, 0. 5f x*x z*z); To convert an object-to-inertial quaternion to euler angle format, we use code very similar to the above code. We just negate the x, y, and z values, since we assume the object-to-inertial quaternion is the conjugate of the inertial-to-object quaternion. Listing 10. 6: converting an object-to-inertial quaternion to euler angles.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents