[nnm] No Nonsense Math 0.5.0
A No-Nonsense, C++ 17, single-header-only Math library geared towards graphics programming.
|
#include <nnm.hpp>
Public Member Functions | |
constexpr | Transform2 () |
template<typename Other> | |
constexpr | Transform2 (const Transform2< Other > &transform) |
constexpr | Transform2 (const Matrix3< Real > &matrix) |
constexpr Real | trace () const |
constexpr Real | determinant () const |
constexpr Transform2 | unchecked_inverse () const |
constexpr std::optional< Transform2 > | inverse () const |
constexpr bool | valid () const |
constexpr bool | affine () const |
constexpr Basis2< Real > | basis () const |
constexpr Vector2< Real > | translation () const |
constexpr Transform2 | translate (const Vector2< Real > &offset) const |
constexpr Transform2 | translate_local (const Vector2< Real > &offset) const |
Transform2 | rotate (const Real angle) const |
Transform2 | rotate_local (const Real angle) const |
constexpr Transform2 | scale (const Vector2< Real > &factor) const |
constexpr Transform2 | scale_local (const Vector2< Real > &factor) const |
constexpr Transform2 | shear_x (const Real factor) const |
constexpr Transform2 | shear_x_local (const Real factor) const |
constexpr Transform2 | shear_y (const Real factor) const |
constexpr Transform2 | shear_y_local (const Real factor) const |
constexpr Transform2 | transform (const Transform2 &by) const |
constexpr Transform2 | transform_local (const Transform2 &by) const |
constexpr bool | approx_equal (const Transform2 &other) const |
constexpr const Vector3< Real > & | at (const uint8_t column) const |
constexpr Vector3< Real > & | at (const uint8_t column) |
constexpr const Real & | at (const uint8_t column, const uint8_t row) const |
constexpr Real & | at (const uint8_t column, const uint8_t row) |
constexpr const Vector3< Real > & | operator[] (const uint8_t column) const |
constexpr Vector3< Real > & | operator[] (const uint8_t column) |
constexpr bool | operator== (const Transform2 &other) const |
constexpr bool | operator!= (const Transform2 &other) const |
constexpr bool | operator< (const Transform2 &other) const |
Static Public Member Functions | |
static constexpr Transform2 | from_basis_translation (const Basis2< Real > &basis, const Vector2< Real > &translation) |
static constexpr Transform2 | from_basis (const Basis2< Real > &basis) |
static constexpr Transform2 | from_translation (const Vector2< Real > &translation) |
static Transform2 | from_rotation (const Real angle) |
static constexpr Transform2 | from_scale (const Vector2< Real > &factor) |
static constexpr Transform2 | from_shear_x (const Real factor) |
static constexpr Transform2 | from_shear_y (const Real factor) |
Public Attributes | |
Matrix3< Real > | matrix |
Two-dimensional transformation matrix.
Real | Floating-point type. |
|
inlineconstexpr |
Initialize with identity.
|
inlineexplicitconstexpr |
Cast from other transform type.
Other | Other transform type. |
transform | Transform to cast from. |
|
inlineexplicitconstexpr |
Initialize from 3x3 matrix. No validation is done.
matrix | 3x3 matrix. |
|
inlinenodiscardconstexpr |
If the transform is affine. A transform is affine if all lines remain straight and parallel lines are preserved.
|
inlinenodiscardconstexpr |
Element-wise approximately equal.
other | Other transform. |
|
inlineconstexpr |
Reference to column
column | Column. |
|
inlinenodiscardconstexpr |
Constant reference to column at index.
column | Column. |
|
inlineconstexpr |
Reference to element at column and row.
column | Column. |
row | Row. |
|
inlinenodiscardconstexpr |
Constant reference to element at column and row.
column | Column. |
row | Row. |
|
inlinenodiscardconstexpr |
Two-dimensional basis sub-matrix.
|
inlinenodiscardconstexpr |
Determinant.
|
inlinestaticconstexpr |
Transform with basis.
basis | Basis. |
|
inlinestaticconstexpr |
Transform from two-dimensional basis and two-dimension translation. No validation is done.
basis | Basis. |
translation | Translation. |
|
inlinestatic |
Transform with rotation.
angle | Angle in radians. |
|
inlinestaticconstexpr |
Transform with scale.
factor | Scale factor. |
|
inlinestaticconstexpr |
Transform with shear along x-axis.
factor | Factor. |
|
inlinestaticconstexpr |
Transform with shear along y-axis.
factor | factor. |
|
inlinestaticconstexpr |
Transform with translation
translation | Translation |
|
inlinenodiscardconstexpr |
Inverse which returns null if there is none.
|
inlinenodiscardconstexpr |
Element-wise inequality.
other | Other transform. |
|
inlinenodiscardconstexpr |
Lexicographical comparison between elements.
other | Other transform. |
|
inlinenodiscardconstexpr |
Element-wise equality.
other | Other transform. |
|
inlineconstexpr |
Reference to column at index.
column | Column. |
|
inlinenodiscardconstexpr |
Constant reference to column at index.
column | Column. |
|
inlinenodiscard |
Rotate by angle.
angle | Angle in radians. |
|
inlinenodiscard |
Local rotate by angle.
angle | Angle in radians. |
|
inlinenodiscardconstexpr |
Scale by factor.
factor | Scale factor. |
|
inlinenodiscardconstexpr |
Local scale by factor.
factor | Scale factor. |
|
inlinenodiscardconstexpr |
Shear along x-axis.
factor | factor. |
|
inlinenodiscardconstexpr |
Local shear along x-axis.
factor | Factor. |
|
inlinenodiscardconstexpr |
Shear along y-axis.
factor | Factor. |
|
inlinenodiscardconstexpr |
Local shear along y-axis.
factor | Factor. |
|
inlinenodiscardconstexpr |
Trace which is the sum of the matrix diagonal.
|
inlinenodiscardconstexpr |
Transform by another transform.
by | Transform to transform by. |
|
inlinenodiscardconstexpr |
Local transform by another transform.
by | Transform to transform by. |
|
inlinenodiscardconstexpr |
Translate.
offset | Offset. |
|
inlinenodiscardconstexpr |
Local translate.
offset | Offset. |
|
inlinenodiscardconstexpr |
Translation of the transform.
|
inlinenodiscardconstexpr |
Inverse without checking if there is one.
|
inlinenodiscardconstexpr |
If the transform is valid.
Matrix3<Real> nnm::Transform2< Real >::matrix |