Quaternion type: Difference between revisions

Content added Content deleted
m (Fix math mistake for the grid suggestion...)
Line 2,909: 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.
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 16x20 faces would have 16x12 vertices, which would allow a quaternion to be represented in a single byte index into a list of 192 quaternions, and would allow quaternion multiplication to be represented as a 37kbyte 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...)
(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 25x20 faces would have <code>20 + 20*18%2</code> vertices, which would allow a quaternion to be represented in a single byte index into a list of 200 quaternions, and would allow quaternion multiplication to be represented as a 40kbyte 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}}==
=={{header|Java}}==