3#include "../vec/vec2.h"
20 values[0][0] =
static_cast<T
>(0);
values[0][1] =
static_cast<T
>(0);
21 values[1][0] =
static_cast<T
>(0);
values[1][1] =
static_cast<T
>(0);
31 mat2(
const T& _a,
const T& _b,
const T& _c,
const T& _d) {
58 return mat2<T>(
static_cast<T
>(1),
static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(1));
114 return vec2<T>(lhs[0][0] * rhs.
x + lhs[0][1] * rhs.
y, lhs[1][0] * rhs.
x + lhs[1][1] * rhs.
y);
167 values[0][0] = _a * rhs[0][0] + _b * rhs[1][0];
values[0][1] = _a * rhs[0][1] + _b * rhs[1][1];
168 values[1][0] = _c * rhs[0][0] + _d * rhs[1][0];
values[1][1] = _c * rhs[0][1] + _d * rhs[1][1];
223 out <<
"[\n\t" << mat[0][0] <<
", " << mat[0][1] <<
";\n\t" << mat[1][0] <<
", " << mat[1][1] <<
"\n]\n";
std::ostream & operator<<(std::ostream &out, const mat2< U > &mat)
Definition: mat2.h:221
T values[2][2]
loosely packed data
Definition: mat2.h:13
const T * operator[](const int &index) const
Definition: mat2.h:208
float Determinant()
Definition: mat2.h:76
static mat2< T > Unit()
Definition: mat2.h:57
T * operator[](const int &index)
Definition: mat2.h:202
mat2< T > & operator*=(const mat2< T > &rhs)
Definition: mat2.h:163
mat2()
Definition: mat2.h:18
mat2< T > & operator+=(const mat2< T > &rhs)
Definition: mat2.h:139
mat2< T > & operator/=(const T &rhs)
Definition: mat2.h:189
mat2< T > & operator*=(const T &rhs)
Definition: mat2.h:177
friend mat2< T > operator/(mat2< T > lhs, const T &rhs)
Definition: mat2.h:131
friend mat2< T > operator-(mat2< T > lhs, const mat2< T > &rhs)
Definition: mat2.h:97
mat2< T > Inverse() const
Definition: mat2.h:78
friend vec2< T > operator*(mat2< T > lhs, const vec2< T > &rhs)
Definition: mat2.h:113
friend mat2< T > operator+(mat2< T > lhs, const mat2< T > &rhs)
Definition: mat2.h:89
friend mat2< T > operator*(mat2< T > lhs, const T &rhs)
Definition: mat2.h:105
mat2(const vec2< T > &A, const vec2< T > &B)
Definition: mat2.h:42
friend std::ostream & operator<<(std::ostream &, const mat2< U > &)
Definition: mat2.h:221
mat2< T > & operator-=(const mat2< T > &rhs)
Definition: mat2.h:151
mat2< T > Transpose()
Definition: mat2.h:65
bool IsSymmetric()
Definition: mat2.h:71
mat2(const T &_a, const T &_b, const T &_c, const T &_d)
Definition: mat2.h:31
friend mat2< T > operator*(mat2< T > lhs, const mat2< T > &rhs)
Definition: mat2.h:123