Represents a linear transformation in three-dimensional space, as represented by a real 3-by-3 matrix.
More...
|
| Matrix3D ()=default |
| Creates the identity matrix.
|
|
constexpr | Matrix3D (const Matrix3D &)=default |
| Creates a new copy of the given matrix.
|
|
constexpr | Matrix3D (Real m00, Real m01, Real m02, Real m10, Real m11, Real m12, Real m20, Real m21, Real m22) |
| Creates a new matrix containin the given entries.
|
|
Matrix3D & | operator= (const Matrix3D &)=default |
| Sets this to be a copy of the given matrix.
|
|
std::array< Real, 3 > & | operator[] (int row) |
| Gives read-write access to a single row of this matrix.
|
|
constexpr const std::array< Real, 3 > & | operator[] (int row) const |
| Gives read-only access to a single row of this matrix.
|
|
constexpr bool | operator== (const Matrix3D &other) const |
| Determines if this and the given matrix are equal.
|
|
constexpr Matrix3D | operator* (const Matrix3D &rhs) const |
| Returns the composition of this and the given transformation.
|
|
Matrix3D & | operator*= (const Matrix3D &rhs) |
| Composes this with the given transformation, which is to be applied first.
|
|
constexpr Vector3D< Real > | operator* (const Vector3D< Real > &vector) const |
| Returns the image of the given vector under this transformation.
|
|
constexpr Matrix3D | inverse () const |
| Returns the inverse of this transformation.
|
|
template<typename Real = double>
class regina::Matrix3D< Real >
Represents a linear transformation in three-dimensional space, as represented by a real 3-by-3 matrix.
These matrices act on column vectors. Specifically, a transformation represented by the 3-by-3 matrix M
will transform the column vector v
into the vector M * v
.
If you are interested specifically in rotations, then you should use the Rotation3D class instead, which uses a more compact and numerically stable representation (quaternions).
This class is designed specifically to work with transformations, and so it focuses more on operations such as composition and inverse, and less on other more general matrix operations. For a general numerical matrix class you can always use Matrix<double>
(or MatrixReal
in Python) instead.
See Regina's notes on 3-D geometry for important information, including the inexact floating-point nature of the Vector3D class, and the right-handedness of Regina's coordinate system.
These objects are small enough to pass by value and swap with std::swap(), with no need for any specialised move operations or swap functions.
- Python
- The template parameter Real is
double
.
- Template Parameters
-
Real | the floating-point type to use for all storage and computation. |
template<typename Real = double>
Composes this with the given transformation, which is to be applied first.
This transformation will be changed directly.
Composition of transformations is not commutative. Here we follow the same convention as used elsewhere in Regina (e.g., by Regina's permutation classes): writing s *= t
indicates that we should apply transformation t
first, followed by transformation s
, and then change s
to store the resulting composition. This is consistent with the order in which we multiply the underlying 3-by-3 matrices.
- Parameters
-
rhs | the transformation to apply before this. |
- Returns
- a reference to this transformation.