aboutsummaryrefslogtreecommitdiff
path: root/src/vec2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vec2.h')
-rw-r--r--src/vec2.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vec2.h b/src/vec2.h
new file mode 100644
index 0000000..95dc3b6
--- /dev/null
+++ b/src/vec2.h
@@ -0,0 +1,18 @@
1#ifndef INCLUDED_VEC2_H
2#define INCLUDED_VEC2_H
3
4struct vec2 {
5 double x, y;
6};
7
8double vec2_norm (struct vec2 a);
9struct vec2 vec2_unit (struct vec2 a);
10struct vec2 vec2_scale (struct vec2 a, double k);
11struct vec2 vec2_add (struct vec2 a, struct vec2 b);
12struct vec2 vec2_sub (struct vec2 a, struct vec2 b);
13double vec2_dot (struct vec2 a, struct vec2 b);
14double vec2_dist (struct vec2 a, struct vec2 b);
15double vec2_angle (struct vec2 a, struct vec2 b);
16double vec2_angle0 (struct vec2 a);
17
18#endif // INCLUDED_VEC2_H