From f1c0772af07f0339bda5a9abeaf4f869de9868e1 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 13 Jun 2010 16:02:07 +0200 Subject: Added vector- and matrix-classes. --- matrix.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 matrix.h (limited to 'matrix.h') diff --git a/matrix.h b/matrix.h new file mode 100644 index 0000000..8be483a --- /dev/null +++ b/matrix.h @@ -0,0 +1,26 @@ +#ifndef MATRIX_H +#define MATRIX_H + +#include "vector.h" + +template +class Matrix { + public: + float m[M][N]; +}; + +class Matrix2 : Matrix<2, 2> { + public: + Matrix2(); + Matrix2(float m00, float m01, float m10, float m11); + + Matrix2 operator*(const Matrix2& mat); + + Matrix2 operator*(float f); + + Vector2 operator*(const Vector2& v); +}; + +Matrix2 rotation_matrix(float rot); + +#endif -- cgit v1.2.3