}
+inline float Bezier::power( float x, int n )
+{
+#if 0
+ return n <= 0 ? 1 : x * power( x, n - 1 );
+#else
+ return powf( x, n );
+#endif
+}
+
+
+inline float Bezier::computeCoeff( int i, int n, float t ) const
+{
+ return (power( t, i ) * power( 1 - t, (n - i) ) *
+ (m_ft[n] / m_ft[i] / m_ft[n - i]));
+}
+
+
void Bezier::computePoint( float t, int &x, int &y ) const
{
// See http://astronomy.swin.edu.au/~pbourke/curves/bezier/ for a simple
y = lrintf(yPos);
}
-
-inline float Bezier::computeCoeff( int i, int n, float t ) const
-{
- return (power( t, i ) * power( 1 - t, (n - i) ) *
- (m_ft[n] / m_ft[i] / m_ft[n - i]));
-}
-
-
-inline float Bezier::power( float x, int n ) const
-{
- if( n > 0 )
- return x * power( x, n - 1);
- else
- return 1;
-}