]> git.lizzy.rs Git - nothing.git/blob - src/math/point.h
Introduce LineStream
[nothing.git] / src / math / point.h
1 #ifndef POINT_H_
2 #define POINT_H_
3
4 #include "math/mat3x3.h"
5 #include "math/pi.h"
6
7 typedef struct Point {
8     float x, y;
9 } Point;
10
11 typedef Point Vec;
12
13 Vec vec(float x, float y);
14 Vec vec_from_polar(float arg, float mag);
15 Vec vec_from_ps(Point p1, Point p2);
16
17 float vec_arg(Vec v);
18 float vec_mag(Vec v);
19
20 float rad_to_deg(float a);
21
22 Vec vec_sum(Vec v1, Vec v2);
23 Vec vec_neg(Vec v);
24 void vec_add(Vec *v1, Vec v2);
25 float vec_length(Vec v);
26 Vec vec_scala_mult(Vec v, float scalar);
27 Vec vec_entry_mult(Vec v1, Vec v2);
28 Vec vec_entry_div(Vec v1, Vec v2);
29 Vec vec_norm(Vec v);
30
31 Point point_mat3x3_product(Point p, mat3x3 m);
32
33 #endif  // POINT_H_