mirror of
https://github.com/GayPizzaSpecifications/padlab.git
synced 2025-08-03 21:21:33 +00:00
Initial workspace 6/1/2019 - 13/10/2019
This commit is contained in:
17
maths.h
Normal file
17
maths.h
Normal 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
|
Reference in New Issue
Block a user