]> git.mxchange.org Git - flightgear.git/commitdiff
Improve readability.
authorThorstenB <brehmt@gmail.com>
Fri, 21 Sep 2012 14:44:16 +0000 (16:44 +0200)
committerThorstenB <brehmt@gmail.com>
Fri, 21 Sep 2012 14:44:16 +0000 (16:44 +0200)
src/Instrumentation/heading_indicator_dg.cxx

index 52fe89834e6dd27d2a68ff32939251f785d60235..efca5713b16046a004f87159c69e60653dfb233b 100644 (file)
@@ -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)
     {