Add levelling

This commit is contained in:
2025-10-18 17:43:22 +01:00
parent 2078eb07da
commit 4da5437715
5 changed files with 122 additions and 38 deletions

View File

@@ -3,6 +3,9 @@
#define PI 3.14159265358979323846264
#define MAT2_ID ((mat2_t) { { 1, 0 }, { 0, 1 } })
#define MAT3_ID ((mat3_t) { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } })
typedef struct {
float x, y;
} vec2_t;
@@ -27,6 +30,8 @@ vec3_t vec2_extend(vec2_t v);
vec2_t vec2_norm(vec2_t v);
float vec2_dot(vec2_t v1, vec2_t v2);
vec2_t vec3_reduce(vec3_t v);
mat2_t mat2_rotation(float theta);
vec2_t mat2_mul_vec2(mat2_t m, vec2_t v);
mat2_t mat2_mul_mat2(mat2_t m1, mat2_t m2);