18 data[0][0] = 1.0f; data[0][1] = 0.0f;
19 data[1][0] = 0.0f; data[1][1] = 1.0f;
22 Matrix2(
float v00,
float v01,
float v10,
float v11) {
23 data[0][0] = v00; data[0][1] = v01;
24 data[1][0] = v10; data[1][1] = v11;
28 return Matrix2(1.0f, 0.0f, 0.0f, 1.0f);
32 return Vector2(data[0][0] * v[0] + data[0][1] * v[1],
33 data[1][0] * v[0] + data[1][1] * v[1]);
37 return Matrix2(data[1][1], -data[0][1],
42 return Matrix2(data[0][0], data[1][0],
43 data[0][1], data[1][1]);
47 return data[0][0] * data[1][1] - data[0][1] * data[1][0];
51 return Matrix2(data[0][0] * f, data[0][1] * f,
52 data[1][0] * f, data[1][1] * f);
56 return Matrix2(data[0][0] / f, data[0][1] / f,
57 data[1][0] / f, data[1][1] / f);
62 return (
float*)&data[i][0];
67 return (
const float*)&data[i][0];
70 inline operator float* () {
71 return (
float*)&data[0][0];
74 inline operator const float* ()
const{
75 return (
const float*)&data[0][0];
float determinant() const
Definition: Matrix2.h:46
float data[2][2]
Definition: Matrix2.h:13
Matrix2(float v00, float v01, float v10, float v11)
Definition: Matrix2.h:22
Vector2 operator*(const Vector2 &v) const
Definition: Matrix2.h:31
float * operator[](int i)
Definition: Matrix2.h:60
#define debugAssert(exp)
Definition: debugAssert.h:160
Matrix2 inverse() const
Definition: Matrix2.h:36
Matrix2 operator/(float f) const
Definition: Matrix2.h:55
Matrix2 operator*(float f) const
Definition: Matrix2.h:50
Matrix2 transpose() const
Definition: Matrix2.h:41
static Matrix2 identity()
Definition: Matrix2.h:27
Matrix2()
Definition: Matrix2.h:17