Skip to content

Commit 26959f1

Browse files
guludolucasdemarchi
authored andcommitted
AP_Math: define golden ratio constant
1 parent 48c243b commit 26959f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/AP_Math/definitions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef M_PI_2
1414
#define M_PI_2 (M_PI / 2)
1515
#endif
16+
17+
#define M_GOLDEN 1.618033988749894
1618
#else // Standard single precision math
1719
#ifdef M_PI
1820
#undef M_PI
@@ -23,6 +25,8 @@
2325
#undef M_PI_2
2426
#endif
2527
#define M_PI_2 (M_PI / 2)
28+
29+
#define M_GOLDEN 1.6180339f
2630
#endif
2731

2832
#define M_2PI (M_PI * 2)

0 commit comments

Comments
 (0)