mirror of
https://github.com/GayPizzaSpecifications/padlab.git
synced 2025-08-03 21:21:33 +00:00
18 lines
295 B
C
18 lines
295 B
C
#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
|