forked from jontodd/r.refine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.h
73 lines (57 loc) · 1.63 KB
/
constants.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* ************************************************************
*
* MODULE: r.refine
*
* Authors: Jon Todd <[email protected]>, Laura Toma <[email protected]>
* Bowdoin College, USA
*
* Purpose: convert grid data to TIN
*
* COPYRIGHT:
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
*
************************************************************ */
/******************************************************************************
*
* constants.h defines constants used in many of the files
*
* AUTHOR(S): Jonathan Todd - <[email protected]>
*
* UPDATED: jt 2005-08-15
*
* COMMENTS:
*
*****************************************************************************/
#ifndef __constants_h
#define __constants_h
#define X 0
#define Y 1
#define Z 2
#define FALSE 0
#define TRUE 1
#define DIR_TOP 2
#define DIR_BOTTOM 3
#define DIR_LEFT 4
#define DIR_RIGHT 5
#define IN 1
#define INBACK 3
#define OUT 2
#define OUTBACK 4
#define EDGE12 0
#define EDGE13 1
#define EDGE23 2
#define EPSILON 0.0001 // small double for vertex closeness
// This is a spcial point which is used only for corners which have no
// data values
extern R_POINT NODATA_CORNER;
#define ABS(x) ( (x) < 0 ? -(x) : (x) )
#define MIN(x,y) ( x < y ? x : y )
#define MAX(x,y) ( x < y ? y : x )
#define MODULUS(p) (sqrt((p).x * (p).x + (p).y * (p).y + (p).z * (p).z) )
#define SIGN(x) ( x < 0 ? -1 : 1 )
#define DOTPRODUCT(v1,v2) ( v1.x*v2.x + v1.y*v2.y + v1.z*v2.z )
#define INVERTVECTOR(p1) p1.x = -p1.x; p1.y = -p1.y; p1.z = -p1.z
#endif