aboutsummaryrefslogtreecommitdiff
path: root/src/vec2.h
blob: 95dc3b61d69f471321c18bcacd8bfe18ef63550f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef INCLUDED_VEC2_H
#define INCLUDED_VEC2_H

struct vec2 {
  double x, y;
};

double      vec2_norm   (struct vec2 a);
struct vec2 vec2_unit   (struct vec2 a);
struct vec2 vec2_scale  (struct vec2 a, double k);
struct vec2 vec2_add    (struct vec2 a, struct vec2 b);
struct vec2 vec2_sub    (struct vec2 a, struct vec2 b);
double      vec2_dot    (struct vec2 a, struct vec2 b);
double      vec2_dist   (struct vec2 a, struct vec2 b);
double      vec2_angle  (struct vec2 a, struct vec2 b);
double      vec2_angle0 (struct vec2 a);

#endif // INCLUDED_VEC2_H