[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 | Basis2 () |
template<typename Other> | |
constexpr | Basis2 (const Basis2< Other > &basis) |
constexpr | Basis2 (const Matrix2< Real > &matrix) |
constexpr Real | trace () const |
constexpr Real | determinant () const |
constexpr Basis2 | unchecked_inverse () const |
constexpr std::optional< Basis2 > | inverse () const |
constexpr bool | valid () const |
Basis2 | rotate (const Real angle) const |
Basis2 | rotate_local (const Real angle) const |
constexpr Basis2 | scale (const Vector2< Real > &factor) const |
constexpr Basis2 | scale_local (const Vector2< Real > &factor) const |
constexpr Basis2 | shear_x (const Real factor) const |
constexpr Basis2 | shear_x_local (const Real factor) const |
constexpr Basis2 | shear_y (const Real factor) const |
constexpr Basis2 | shear_y_local (const Real factor) const |
constexpr Basis2 | transform (const Basis2 &by) const |
constexpr Basis2 | transform_local (const Basis2 &by) const |
constexpr bool | approx_equal (const Basis2 &other) const |
constexpr const Vector2< Real > & | at (const uint8_t column) const |
constexpr Vector2< 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 Vector2< Real > & | operator[] (const uint8_t index) const |
constexpr Vector2< Real > & | operator[] (const uint8_t index) |
constexpr bool | operator== (const Basis2 &other) const |
constexpr bool | operator!= (const Basis2 &other) const |
constexpr bool | operator< (const Basis2 &other) const |
Static Public Member Functions | |
static Basis2 | from_rotation (const Real angle) |
static constexpr Basis2 | from_scale (const Vector2< Real > &factor) |
static constexpr Basis2 | from_shear_x (const Real factor) |
static constexpr Basis2 | from_shear_y (const Real factor) |
Public Attributes | |
Matrix2< Real > | matrix |
Two-dimensional basis matrix.
Real | Floating-point type. |
|
inlineconstexpr |
Initialize with identity basis.
|
inlineexplicitconstexpr |
Cast from other basis type.
Other | Other type. |
basis | Basis to cast from. |
|
inlineexplicitconstexpr |
Initialize from 2x2 matrix. No validation is done.
matrix | 2x2 matrix to cast from. |
|
inlinenodiscardconstexpr |
If approximately equal to another basis.
other | Other basis. |
|
inlineconstexpr |
Reference to the matrix column at index.
column | Column. |
|
inlinenodiscardconstexpr |
Constant reference to the matrix column at index.
column | Column |
|
inlineconstexpr |
Reference to the matrix element at column and row.
column | Column. |
row | Row. |
|
inlinenodiscardconstexpr |
Constant reference to the matrix element at column and row.
column | Column. |
row | Row. |
|
inlinenodiscardconstexpr |
Determinant.
|
inlinestatic |
Basis rotate by angle in radians.
angle | Angle in radians. |
|
inlinestaticconstexpr |
Basis scaled by factor.
factor | Scale factor. |
|
inlinestaticconstexpr |
Basis sheared along the x-axis.
factor | Factor. |
|
inlinestaticconstexpr |
Basis sheared along the y-axis.
factor | Factor. |
|
inlinenodiscardconstexpr |
Inverse which returns null if the basis is invalid.
|
inlineconstexpr |
Element-wise inequality.
other | Other basis. |
|
inlineconstexpr |
Lexicographical comparison between the matrix elements.
other | Other basis. |
|
inlineconstexpr |
Element-wise equality.
other | Other basis. |
|
inlineconstexpr |
Reference to the matrix column at index.
index | Index. |
|
inlineconstexpr |
Constant reference to the matrix column at index.
index | Index. |
|
inlinenodiscard |
Rotate by angle.
angle | Angle in radians. |
|
inlinenodiscard |
Local rotation 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 diagonal of the matrix.
|
inlinenodiscardconstexpr |
Transform by another basis.
by | Basis to transform by. |
|
inlinenodiscardconstexpr |
Local transform by another basis.
by | Basis to transform by. |
|
inlinenodiscardconstexpr |
Inverse without checking if the basis is valid first.
|
inlinenodiscardconstexpr |
If the elements of the matrix form a valid basis.
Matrix2<Real> nnm::Basis2< Real >::matrix |