Replaced binom coeff function with macro
This commit is contained in:
parent
bc94b6f87b
commit
b2d23a0992
1 changed files with 2 additions and 5 deletions
|
@ -5,10 +5,7 @@
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
Uint32 BinomCoeff(int n, int k)
|
#define C(n, k) (tgamma(n+1) / (tgamma(k+1) * tgammal(n-k+1)))
|
||||||
{
|
|
||||||
return (tgamma(n+1) / (tgamma(k+1) * tgammal(n-k+1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
BezierCurve::BezierCurve()
|
BezierCurve::BezierCurve()
|
||||||
{
|
{
|
||||||
|
@ -56,7 +53,7 @@ void BezierCurve::ConstructBezier(float resolution)
|
||||||
|
|
||||||
std::vector<Uint32> binoms;
|
std::vector<Uint32> binoms;
|
||||||
for (int i = 0; i <= grade; i++)
|
for (int i = 0; i <= grade; i++)
|
||||||
binoms.push_back(BinomCoeff(grade, i));
|
binoms.push_back(C(grade, i));
|
||||||
|
|
||||||
SDL_FPoint vert;
|
SDL_FPoint vert;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue