#ifndef MATRIX_MATH
#define MATRIX_MATH

#include <GL/glew.h>

void vec3Zero(GLfloat* out);
void vec3Add(GLfloat* out, GLfloat* a, GLfloat* b);
void vec3Multiply(GLfloat* out, GLfloat* a, GLfloat x);
void vec3Subtract(GLfloat* out, GLfloat* a, GLfloat* b);
void vec3Cross(GLfloat* out, GLfloat* a, GLfloat* b);
void vec3Normalise(GLfloat* out, GLfloat* a);
GLfloat vec3Length(GLfloat* a);
GLfloat vec3Dot(GLfloat* a, GLfloat* b);

void identity(GLfloat* out);
void translation(GLfloat* out, GLfloat* v);
void scaling(GLfloat* out, GLfloat* v);
void rotationZ(GLfloat* out, GLfloat angle);
void rotationY(GLfloat* out, GLfloat angle);
void rotationX(GLfloat* out, GLfloat angle);

void multiplyAny(GLfloat* A, GLfloat* B, GLfloat* out, int wA, int hA, int wB);
void multiply(GLfloat* A, GLfloat* B, GLfloat* out);

void translate(GLfloat* out, GLfloat* in, GLfloat* v);
void scale(GLfloat* out, GLfloat* in, GLfloat* v);
void rotateZ(GLfloat* out, GLfloat* in, GLfloat angle);
void rotateY(GLfloat* out, GLfloat* in, GLfloat angle);
void rotateX(GLfloat* out, GLfloat* in, GLfloat angle);

void transposeAny(GLfloat* out, GLfloat* in, int w, int h);
void transpose(GLfloat* out, GLfloat* in);

void printAny(GLfloat* M, int w, int h);
void vec3Print(GLfloat* a);
void mat4Print(GLfloat* m);

void lookAt(GLfloat* out, GLfloat* eye, GLfloat* center, GLfloat* up);

#endif