KJB
|
#include <g2_rotation.h>
Public Member Functions | |
Rotation_axis (const Vector &pt, const Vector &dir) | |
Vector | rotate (const Vector &pt, double angle) const |
Matrix | get_transformation_matrix (double a) const |
This class facilitates rotating around an arbitrary axis, not necesarilly through the origin. Unlike quaternions, which are pure rotations, this operation generally involves translation to the origin, rotation, and translation back.
Currently, this class is quite thin, and it provides no value caching like quaternion does. Multiple calls to get_rotation_matrix() will recompute every time.
Create from a rotation axis line. Line is represented in vector form:
l(t) = p + t * dir
pt | A point lying on the rotation axis. Must have size = 3. |
dir | The direction of the rotation axis. Must have size = 3. |
Matrix kjb::Rotation_axis::get_transformation_matrix | ( | double | a | ) | const |
Get the rigid transformation matrix that rotates by a degrees around this axis.
Rotate a point around this axis.