From db3c70e235cd6a454523445bc0e7ecb046d7bc0d Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 21 Sep 2012 16:44:16 +0200 Subject: [PATCH] Improve readability. --- src/Instrumentation/heading_indicator_dg.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/heading_indicator_dg.cxx b/src/Instrumentation/heading_indicator_dg.cxx index 52fe89834..efca5713b 100644 --- a/src/Instrumentation/heading_indicator_dg.cxx +++ b/src/Instrumentation/heading_indicator_dg.cxx @@ -22,6 +22,8 @@ #include "heading_indicator_dg.hxx" +/** Macro calculating x^6 (faster than super-slow math/pow). */ +#define POW6(x) (x*x*x*x*x*x) HeadingIndicatorDG::HeadingIndicatorDG ( SGPropertyNode *node ) : name("heading-indicator-dg"), @@ -150,7 +152,7 @@ HeadingIndicatorDG::update (double dt) // Next, calculate the indicated heading, // introducing errors. - double factor = spin * spin * spin * spin * spin * spin; + double factor = POW6(spin); double heading = _heading_in_node->getDoubleValue(); if (spin < 0.9) { -- 2.39.5