BSNS102 Study Guide - Final Guide: Coordinate Space, Rotation Matrix, Euler Angles

33 views4 pages

Document Summary

Unfortunately, this does not always work, since the square root will always yield positive results. (more accurately, we have no basis for choosing the positive or negative root. ) However, since q and q represent the same orientation, we can arbitrarily choose to use the nonnegative root for one of the four components and still always return a correct quaternion. We just can"t use the above technique for all four values of the quaternion. Another trick that works is to examine the sum and difference of diagonally opposite matrix elements: Thus, once we know one of the four values using the square root of the sum/difference of diagonal elements, we can compute the other three, as shown below: It seems that the simplest strategy would be to always use the same component, say w, and then compute x, y, and z by diving the sums of diagonally opposite matrix elements by 4w. If w = 0, then the division is undefined.