diff options
Diffstat (limited to 'mons_math/include/mons_math/mat2.h')
-rw-r--r-- | mons_math/include/mons_math/mat2.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mons_math/include/mons_math/mat2.h b/mons_math/include/mons_math/mat2.h new file mode 100644 index 0000000..b1a8ca0 --- /dev/null +++ b/mons_math/include/mons_math/mat2.h @@ -0,0 +1,39 @@ +#ifndef MONS_MAT2_H +#define MONS_MAT2_H + +#include "mons_math/vec2.h" + +typedef struct mons_mat2 { + mons_vec2 m1; + mons_vec2 m2; +} mons_mat2; + +mons_mat2 mons_mat2_add(mons_mat2 a, mons_mat2 b); +void mons_mat2_add_inplace(mons_mat2 *a, mons_mat2 b); + +mons_mat2 mons_mat2_mul_f(mons_mat2 a, float b); +mons_mat2 mons_mat2_mul_i(mons_mat2 a, int b); +mons_mat2 mons_mat2_mul(mons_mat2 a, mons_mat2 b); + +void mons_mat2_mul_f_inplace(mons_mat2 *a, float b); +void mons_mat2_mul_i_inplace(mons_mat2 *a, int b); + +mons_mat2 mons_mat2_inverse(mons_mat2 a); +void mons_mat2_inverse_inplace(mons_mat2 *a); + +mons_mat2 mons_mat2_transpose(mons_mat2 a); +void mons_mat2_transpose_inplace(mons_mat2 *a); + +mons_vec2 mons_mat2_n1(mons_mat2 a); +mons_vec2 mons_mat2_n2(mons_mat2 a); + +float mons_mat2_determinant(mons_mat2 a); +mons_mat2 mons_mat2_adjoint(mons_mat2 a); +mons_mat2 mons_mat2_inverse(mons_mat2 a); + +extern const mons_mat2 MONS_MAT2_ZERO; +extern const mons_mat2 MONS_MAT2_IDENTITY; + +int mons_mat2_equal(mons_mat2 a, mons_mat2 b); + +#endif |