geirs2Panic
Richard J. Mathar
Fits header keyword batch editor
|
A rotation followed by a translation. More...
#include <RotTrans2D.h>
Public Member Functions | |
RotTrans2D (double ang, double tx, double ty) | |
RotTrans2D (double ang, const Point2D &t) | |
RotTrans2D (double ang, const Point2D &fixpt, const Point2D &t) | |
RotTrans2D () | |
RotTrans2D | inv () const |
Generate the inverse operation of this. More... | |
Point2D | apply (const Point2D &pt) const |
Public Attributes | |
double | angle |
The angle of rotation (radians). More... | |
Point2D | trans |
The translation vector. More... | |
double | sc [2] |
The sine and cosine of the angle. More... | |
A rotation followed by a translation.
A rotation around another fixed point followed by a translation is also represented by this class, but mapped on a rotation around (0,0).
Note that the two components of the transformation, the rotation and translation, are not commutative operations in general.
Note also that the translation vector is to be interpreted in the original coordinate system (as indicated by active).
RotTrans2D::RotTrans2D | ( | double | ang, |
double | x, | ||
double | y | ||
) |
Create a rotation-translation given the angle and translation vector.
ang | The angle (ccw, radians) |
x | The x coordinate of the translation. |
y | The y coordinate of the translation |
RotTrans2D::RotTrans2D | ( | double | ang, |
const Point2D & | t | ||
) |
Create a rotation-translation given the angle and translation vector.
ang | The angle (ccw, radians) |
t | The translation vector represented by a point in the original coordinates. |
Create a rotation-translation given the angle and translation vector. The initial rotation is specified by an angle and a fixed point of the rotation.
ang | The angle (ccw, radians) |
fixpt | The fixed point for the rotation. |
t | The translation vector represented by a point in the original coordinates. |
RotTrans2D::RotTrans2D | ( | ) |
Create a dummy rotation-translation (which is not rotating or translating). This results in a rotation by an angle of zero and translation by a vector of zero length.
RotTrans2D RotTrans2D::inv | ( | ) | const |
Generate the inverse operation of this.
Apply the transformation to a point.
pt | The point to be rotated-translated. |
double RotTrans2D::angle |
The angle of rotation (radians).
Points are rotated ccw in the 2D plane by this angle.
Point2D RotTrans2D::trans |
The translation vector.
double RotTrans2D::sc[2] |
The sine and cosine of the angle.
Stored separately to avoid re-computation of these two values if the rotation is applied often.