#include <Geometry.h>
This class implements the 3x3 3D rotation matrix. It is implemented in row-major order. Elements are accessed as Rotation::R[row][column] with both row and column being zero based. The rows of the matrix contain the unit coordinates of each of the axes of the resulting coordinate system, and can be accessed through Rotation::x, Rotation::y, Rotation::z. For example, after applying the rotation, a point with coordinate Rotation::x will become (1,0,0).
Public Member Functions | |
| Rotation () | |
| Default constructor. Initializes to identity matrix. | |
| Rotation (point const &v, float angle) | |
| Rotation (float q[4]) | |
| Rotation | operator! () const |
| Returns the inverse of the rotation matrix. | |
| void | Translate (point const &o) |
| void | Orthogonalize () |
| void | OrthogonalizeYZ () |
| float | Quaternion (float q[4]) |
Public Attributes | |
| union { | |
| float R [3][3] | |
| the rotation matrix representing the rotation. | |
| struct { | |
| pointNC x | |
| unit coordinate on 1st (x) axis | |
| pointNC y | |
| unit coordinate on 2nd (y) axis | |
| pointNC z | |
| unit coordinate on 3rd (z) axis | |
| } | |
| }; | |
Constructs a rotation matrix corresponding to rotating about an arbitraty axis.
| v | axis of rotation (should be a unit vector) | |
| angle | counter-clockwise angle of rotation about the axis |
| float Quaternion | ( | float | q[4] | ) | [inline] |
Returns the quaternion representation of the rotation matrix. The norm of the quaternion (before it is normalized) is returned
1.5.1-p1