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

30 views4 pages

Document Summary

// to the quaternion class, since we really don"t need any. const quaternion kquaternionidentity = { // setup the quaternion to rotate about the specified axis void. // set the values w = cos(thetaover2); x = sin(thetaover2); y = 0. 0f; z = 0. 0f; void. // set the values w = cos(thetaover2); x = 0. 0f; y = sin(thetaover2); z = 0. 0f; void. // compute the half angle float thetaover2 = theta * . 5f; 209 x = 0. 0f; y = 0. 0f; z = sin(thetaover2); void. // the axis of rotation must be normalized assert(fabs(vectormag(axis) 1. 0f) < . 01f); // compute the half angle and its sin float thetaover2 = theta * . 5f; float sinthetaover2 = sin(thetaover2); // set the values w = cos(thetaover2); x = axis. x * sinthetaover2; y = axis. y * sinthetaover2; z = axis. z * sinthetaover2; // compute values w = ch*cp*cb + sh*sp*sb; x = ch*sp*cb + sh*cp*sb; y = ch*sp*sb + sh*cp*cb; z = sh*sp*cb + ch*cp*sb;

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