#include <MRMatrix2.h>
Public Types | |
using | ValueType = T |
using | VectorType = Vector2<T> |
Public Member Functions | |
constexpr | Matrix2 () noexcept=default |
constexpr | Matrix2 (const Vector2< T > &x, const Vector2< T > &y) |
initializes matrix from its 2 rows | |
template<typename U > | |
constexpr | Matrix2 (const Matrix2< U > &m) |
constexpr const Vector2< T > & | operator[] (int row) const noexcept |
row access | |
constexpr Vector2< T > & | operator[] (int row) noexcept |
constexpr Vector2< T > | col (int i) const noexcept |
column access | |
constexpr T | trace () const noexcept |
computes trace of the matrix | |
constexpr T | normSq () const noexcept |
compute sum of squared matrix elements | |
constexpr auto | norm () const noexcept |
constexpr T | det () const noexcept |
computes determinant of the matrix | |
constexpr Matrix2< T > inverse() const noexcept MR_REQUIRES_IF_SUPPORTED(std constexpr Matrix2< T > | transposed () const noexcept |
computes inverse matrix | |
Matrix2 & | operator+= (const Matrix2< T > &b) |
Matrix2 & | operator-= (const Matrix2< T > &b) |
Matrix2 & | operator*= (T b) |
Matrix2 & | operator/= (T b) |
Static Public Member Functions | |
static constexpr Matrix2 | zero () noexcept |
static constexpr Matrix2 | identity () noexcept |
static constexpr Matrix2 | scale (T s) noexcept |
returns a matrix that scales uniformly | |
static constexpr Matrix2 | scale (T sx, T sy) noexcept |
returns a matrix that has its own scale along each axis | |
static constexpr Matrix2 | scale (const Vector2< T > &s) noexcept |
static constexpr Matrix2 | fromColumns (const Vector2< T > &x, const Vector2< T > &y) noexcept |
Public Attributes | |
Vector2< T > | x { 1, 0 } |
rows, identity matrix by default | |
Vector2< T > | y { 0, 1 } |
Static Public Attributes | |
static constexpr Matrix2 static rotation(T angle) noexcept MR_REQUIRES_IF_SUPPORTED(std constexpr Matrix2 static rotation(const Vector2< T > &from, const Vector2< T > &to) noexcept MR_REQUIRES_IF_SUPPORTED(std constexpr Matrix | fromRows )(const Vector2< T > &x, const Vector2< T > &y) noexcept |
creates matrix representing rotation around origin on given angle | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T > | |
Vector2< T > | operator* (const Matrix2< T > &a, const Vector2< T > &b) |
x = a * b | |
template<typename T > | |
T | dot (const Matrix2< T > &a, const Matrix2< T > &b) |
double-dot product: x = a : b | |
template<typename T > | |
Matrix2< T > | operator* (const Matrix2< T > &a, const Matrix2< T > &b) |
product of two matrices | |
template<typename T > | |
Matrix2< T > | outer (const Vector2< T > &a, const Vector2< T > &b) |
x = a * b^T | |
arbitrary 2x2 matrix
using MR::Matrix2< T >::ValueType = T |
using MR::Matrix2< T >::VectorType = Vector2<T> |
|
constexprdefaultnoexcept |
|
inlineconstexpr |
initializes matrix from its 2 rows
|
inlineexplicitconstexpr |
|
inlineconstexprnoexcept |
column access
|
constexprnoexcept |
computes determinant of the matrix
|
inlinestaticconstexprnoexcept |
constructs a matrix from its 2 columns; use this method to get the matrix that transforms basis vectors ( plusX, plusY ) into vectors ( x, y ) respectively
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
compute sum of squared matrix elements
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexprnoexcept |
row access
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
returns a matrix that scales uniformly
|
inlinestaticconstexprnoexcept |
returns a matrix that has its own scale along each axis
|
inlineconstexprnoexcept |
computes trace of the matrix
|
constexprnoexcept |
computes inverse matrix
computes transposed matrix
|
inlinestaticconstexprnoexcept |
double-dot product: x = a : b
|
related |
product of two matrices
|
related |
x = a * b
x = a * b^T
|
inlinestaticconstexprnoexcept |
creates matrix representing rotation around origin on given angle
creates matrix representing rotation that after application to (from) makes (to) vector constructs a matrix from its 2 rows
Vector2<T> MR::Matrix2< T >::x { 1, 0 } |
rows, identity matrix by default
Vector2<T> MR::Matrix2< T >::y { 0, 1 } |