summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/common/geom.h14
-rw-r--r--src/common/geom.c5
2 files changed, 19 insertions, 0 deletions
diff --git a/include/common/geom.h b/include/common/geom.h
index 15a1d57..4445998 100644
--- a/include/common/geom.h
+++ b/include/common/geom.h
@@ -5,6 +5,7 @@
5 * File: geom.h 5 * File: geom.h
6 */ 6 */
7 7
8#include <stdbool.h>
8#include <inttypes.h> 9#include <inttypes.h>
9 10
10/** 11/**
@@ -29,4 +30,17 @@ typedef struct {
29 CartesianVector origin, target; 30 CartesianVector origin, target;
30} CartesianMapping; 31} CartesianMapping;
31 32
33/**
34 * Function: vector_equals
35 * Compares two cartesian vectors.
36 *
37 * Parameters:
38 * v1 - the first vector
39 * v2 - the second vector
40 *
41 * Returns:
42 * T(v1 is equal to v2)
43 */
44bool vector_equals(CartesianVector v1, CartesianVector v2);
45
32#endif 46#endif
diff --git a/src/common/geom.c b/src/common/geom.c
new file mode 100644
index 0000000..7abb422
--- /dev/null
+++ b/src/common/geom.c
@@ -0,0 +1,5 @@
1#include "common/geom.h"
2
3bool vector_equals(CartesianVector v1, CartesianVector v2) {
4 return v1.x == v2.x && v1.y == v2.y;
5}