Initial workspace 6/1/2019 - 13/10/2019

This commit is contained in:
2020-02-23 12:01:51 +11:00
commit 837fb145e1
5 changed files with 427 additions and 0 deletions

17
maths.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef VECTOR_H
#define VECTOR_H
typedef double vec_t;
typedef struct {vec_t x, y;} vector;
static inline vector VecAdd(vector l, vector r)
{
return (vector){l.x + r.x, l.y + r.y};
}
static inline vector VecScale(vector v, vec_t x)
{
return (vector){v.x * x, v.y * x};
}
#endif//VECTOR_H