Microsoft has Quaternions.
Glenn Scheper
glenn_scheper at earthlink.net
Wed Jul 9 14:20:40 CDT 2008
Seeking Sleep(), I stumbled upon Slerp(), quaternions.
This URL is local to my Visual Studio .NET installation,
but then I sought URLs, below, into the MSDN on the web:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref1/html/T_Microsoft_WindowsMobile_DirectX_Quaternion.htm
Remarks
Quaternions extend the concept of rotation in three dimensions to rotation in four dimensions. You can use quaternions to rotate an object about the (x, y, z) vector by an angle theta, where w = cos(theta/2). Quaternion operations are computationally more efficient than 4 × 4 matrix multiplications used for transformations and rotations. A quaternion also represents the most efficient rotation to interpolate between two orientations of an object.
Quaternions add a fourth element to the [x, y, z] values that define a vector, resulting in arbitrary 4-D vectors. However, the following formulas illustrate how each element of a unit quaternion relates to an axis-angle rotation, where q represents a unit quaternion (x, y, z, w), axis is normalized, and theta is the desired counterclockwise (CCW) rotation around the axis.
q.x = sin(theta/2) * axis.x
q.y = sin(theta/2) * axis.y
q.z = sin(theta/2) * axis.z
q.w = cos(theta/2)
The top MSDN query for quaternions:
http://search.msdn.microsoft.com/Default.aspx?query=quaternion&brand=msdn&locale=en-us&refinement=
Remarks
Quaternions represent a rotation and are typically used for smooth interpolation between two angles and for avoiding the gimbal lock problem that can occur with euler angles.
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.quaternion.slerp.aspx
Quaternion.Slerp Method
Interpolates between two quaternions, using spherical linear interpolation.
More information about the Pynchon-l
mailing list