Skip to content

Commit

Permalink
AP_Math: define golden ratio constant
Browse files Browse the repository at this point in the history
  • Loading branch information
guludo authored and lucasdemarchi committed May 16, 2016
1 parent 48c243b commit 26959f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/AP_Math/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#ifndef M_PI_2
#define M_PI_2 (M_PI / 2)
#endif

#define M_GOLDEN 1.618033988749894
#else // Standard single precision math
#ifdef M_PI
#undef M_PI
Expand All @@ -23,6 +25,8 @@
#undef M_PI_2
#endif
#define M_PI_2 (M_PI / 2)

#define M_GOLDEN 1.6180339f
#endif

#define M_2PI (M_PI * 2)
Expand Down

0 comments on commit 26959f1

Please sign in to comment.