Quaternion type: Difference between revisions

m
Fix math, again - this time I think I've gotten it right...
m (Fix math mistake for the grid suggestion...)
m (Fix math, again - this time I think I've gotten it right...)
Line 2,909:
Finally, note that when quaternions are used to represent [[wp:Quaternions_and_spatial_rotation|orientation or rotation]], we are typically only interested in unit length quaternions. As this is the typical application for quaternions, you will sometimes see quaternion multiplication expressed using "simplifications" which are only valid for unit length quaternions. But note also that in many of those contexts you also need to normalize the quaternion length after multiplication.
 
(An exception to this need to normalize unit length quaternions after multiplication might be when quaternions are represented as an index into a [[wp:Geodesic_grid|geodesic grid]]. For example, a grid with 25x2016x20 faces would have <code>a total of 15 vertices for each face (5+4+3+2+1), 3 of those vertices would be from the original 20 vertices of the icosahedron, and 9 of those vertices (5+4+3-3) would be on the edge of the original face (and, thus, use for two faces), the remaining 3 vertices would be interior. This means we would have 170 vertices (20+(20*189%2</code> vertices)+20*3, which would allow a quaternion to be represented in a single byte index into a list of 200170 quaternions, and would allow quaternion multiplication to be represented as a 40kbyte29kbyte lookup table. In some contexts - where quaternion multiplication is needed in high volume for secondary or tertiary issues (where precision isn't vital), such low precision quaternions might be adequate or even an advantage...)
 
=={{header|Java}}==
6,951

edits