Darrien Galid
/
Fused_Boat_Program
Self-navigating boat program with sensors and control system fused
constants.h@1:736ae4695570, 2019-05-24 (annotated)
- Committer:
- Deanatius
- Date:
- Fri May 24 16:12:40 2019 +0000
- Revision:
- 1:736ae4695570
- Parent:
- 0:cf5854b3296f
New update to fix motor output
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
omar28744 | 0:cf5854b3296f | 1 | #ifndef __CONSTANTS_H |
omar28744 | 0:cf5854b3296f | 2 | #define __CONSTANTS_H |
omar28744 | 0:cf5854b3296f | 3 | |
omar28744 | 0:cf5854b3296f | 4 | //#define ULONG_MAX 4294967295UL |
omar28744 | 0:cf5854b3296f | 5 | |
omar28744 | 0:cf5854b3296f | 6 | #define PI 3.1415926535897932384626433832795 |
omar28744 | 0:cf5854b3296f | 7 | #define HALF_PI 1.5707963267948966192313216916398 |
omar28744 | 0:cf5854b3296f | 8 | #define TWO_PI 6.283185307179586476925286766559 |
omar28744 | 0:cf5854b3296f | 9 | #define DEG_TO_RAD 0.017453292519943295769236907684886 |
omar28744 | 0:cf5854b3296f | 10 | #define RAD_TO_DEG 57.295779513082320876798154814105 |
omar28744 | 0:cf5854b3296f | 11 | #define EULER 2.718281828459045235360287471352 |
omar28744 | 0:cf5854b3296f | 12 | |
omar28744 | 0:cf5854b3296f | 13 | /* |
omar28744 | 0:cf5854b3296f | 14 | #ifndef min |
omar28744 | 0:cf5854b3296f | 15 | #define min(a,b) ((a)<(b)?(a):(b)) |
omar28744 | 0:cf5854b3296f | 16 | #endif // min |
omar28744 | 0:cf5854b3296f | 17 | |
omar28744 | 0:cf5854b3296f | 18 | #ifndef max |
omar28744 | 0:cf5854b3296f | 19 | #define max(a,b) ((a)>(b)?(a):(b)) |
omar28744 | 0:cf5854b3296f | 20 | #endif // max |
omar28744 | 0:cf5854b3296f | 21 | |
omar28744 | 0:cf5854b3296f | 22 | #define abs(x) ((x)>0?(x):-(x)) |
omar28744 | 0:cf5854b3296f | 23 | */ |
omar28744 | 0:cf5854b3296f | 24 | |
omar28744 | 0:cf5854b3296f | 25 | #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
omar28744 | 0:cf5854b3296f | 26 | #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) |
omar28744 | 0:cf5854b3296f | 27 | #define radians(deg) ((deg)*DEG_TO_RAD) |
omar28744 | 0:cf5854b3296f | 28 | #define degrees(rad) ((rad)*RAD_TO_DEG) |
omar28744 | 0:cf5854b3296f | 29 | #define sq(x) ((x)*(x)) |
omar28744 | 0:cf5854b3296f | 30 | |
omar28744 | 0:cf5854b3296f | 31 | |
omar28744 | 0:cf5854b3296f | 32 | #endif |