beziercurve.h

来自「This is a 2d bezier interpolation algori」· C头文件 代码 · 共 32 行

H
32
字号
#pragma once
#include <cmath>

class BezierCurve
{
private:

//INSTANT C++ WARNING: Since the array size is not known in this declaration, Instant C++ has converted this array to a pointer.  You will need to call 'delete[]' where appropriate:
	double *FactorialLookup;

public:
	BezierCurve();
	~BezierCurve( void ) ;

	// just check if n is appropriate, then return the result
private:
	double factorial(int n);

	// create lookup table for fast factorial calculation
	void CreateFactorialTable();

	double Ni(int n, int i);

	// Calculate Bernstein basis
	double Bernstein(int n, int i, double t);

	double *a;

public:
	void Bezier2D(double b[], int npts, int cpts, double p[]);
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?