Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2345 - trunk/Core/Math


Chronological Thread 
  • From: "Thiago Ize" < >
  • To:
  • Subject: [Manta] r2345 - trunk/Core/Math
  • Date: Wed, 5 Nov 2008 18:06:48 -0700 (MST)

Author: thiago
Date: Wed Nov  5 18:06:47 2008
New Revision: 2345

Modified:
   trunk/Core/Math/Trig.h
Log:
Added SinCos() function which on gnu compilers can do the sin and cos
computation faster.


Modified: trunk/Core/Math/Trig.h
==============================================================================
--- trunk/Core/Math/Trig.h      (original)
+++ trunk/Core/Math/Trig.h      Wed Nov  5 18:06:47 2008
@@ -105,6 +105,15 @@
     return acosh(x);
   }
 
+  inline void SinCos(double d, double &s, double &c) {
+#if defined(_GNU_SOURCE)
+      sincos(d, &s, &c);
+#else
+      s = Sin(d);
+      c = Cos(d);
+#endif
+  }
+
 /////////////////////////////////////////////////////
 //
 // Float versions
@@ -148,6 +157,15 @@
   inline float RtoD(float r)
   {
     return r*(float)(180.0/M_PI);
+  }
+
+  inline void SinCos(float d, float &s, float &c) {
+#if defined(_GNU_SOURCE)
+      sincosf(d, &s, &c);
+#else
+      s = Sin(d);
+      c = Cos(d);
+#endif
   }
 }
 


  • [Manta] r2345 - trunk/Core/Math, Thiago Ize, 11/05/2008

Archive powered by MHonArc 2.6.16.

Top of page