24 lines
487 B
C++
24 lines
487 B
C++
|
|
#ifndef MATRIX_H
|
|
#define MATRIX_H MATRIX_H
|
|
|
|
#include "Vector.h"
|
|
|
|
class Matrix
|
|
{
|
|
public:
|
|
typedef double Matrix_row_t[4];
|
|
Matrix_row_t & operator[](int idx) { return m_matrix[idx]; }
|
|
const Matrix_row_t & operator[](int idx) const { return m_matrix[idx]; }
|
|
static Matrix identity();
|
|
|
|
protected:
|
|
double m_matrix[4][4];
|
|
};
|
|
|
|
Matrix operator*(const Matrix & m1, const Matrix & m2);
|
|
Vector operator*(const Matrix & m, const Vector & v);
|
|
|
|
#endif
|
|
|