From 26959f14484c7a3d5e88e1c73d88379270e31db1 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 5 Apr 2016 18:10:35 -0300 Subject: [PATCH] AP_Math: define golden ratio constant --- libraries/AP_Math/definitions.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Math/definitions.h b/libraries/AP_Math/definitions.h index a9256f5574..92652a8e10 100644 --- a/libraries/AP_Math/definitions.h +++ b/libraries/AP_Math/definitions.h @@ -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 @@ -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)