summaryrefslogtreecommitdiff
path: root/include/common/geom.h
blob: 4445998ef538593a3cd1ac7ff3f827fbc71eb7f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef UPEM_MORPHING_GEOM
#define UPEM_MORPHING_GEOM

/**
 * File: geom.h
 */

#include <stdbool.h>
#include <inttypes.h>

/**
 * Type: IntVector
 * An abstract 1-D vector.
 */
typedef int32_t IntVector;

/**
 * Type: CartesianVector
 * An abstract 2-D vector in cartesian coordinates.
 */
typedef struct {
  IntVector x, y;
} CartesianVector;

/**
 * Type: CartesianMapping
 * A tuple of cartesian vectors representing a mapping.
 */
typedef struct {
  CartesianVector origin, target;
} CartesianMapping;

/**
 * Function: vector_equals
 * Compares two cartesian vectors.
 *
 * Parameters:
 *   v1 - the first vector
 *   v2 - the second vector
 *
 * Returns:
 *   T(v1 is equal to v2)
 */
bool vector_equals(CartesianVector v1, CartesianVector v2);

#endif