interpolate.h

来自「Source code for cnc controlling three di」· C头文件 代码 · 共 46 行

H
46
字号
// interpolate.h: interface for the interpolate class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INTERPOLATE_H__10532244_775B_11D4_80BF_0000E8DA28BE__INCLUDED_)
#define AFX_INTERPOLATE_H__10532244_775B_11D4_80BF_0000E8DA28BE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define TRUE  1
#define FALSE 0
#define BIG (1.0e12f)

#define MAXDIM 3
typedef float Vect[MAXDIM];
typedef float Knot;
typedef int Bool;

#define V_Op(vdst,gets,vsrc,n) {register int V_i;\
    for(V_i=(n)-1;V_i>=0;V_i--) (vdst)[V_i] gets  ((vsrc)[V_i]);}



class interpolate  
{
public:
	interpolate();
	virtual ~interpolate();
 
	void DoInterp( float t );
 	void SetInterp(int pos, double x, double y, double z);
	int flavor;
	double newx,newy,newz;
private:
	static void lerp(Knot t, Knot a0, Knot a1, Vect p0, Vect p1, int m, Vect p);
	int DialASpline(Knot t, Knot a[], Vect p[], int m, int n, Vect work[],
                    int Cn, Bool interp, Vect val);



};

#endif // !defined(AFX_INTERPOLATE_H__10532244_775B_11D4_80BF_0000E8DA28BE__INCLUDED_)

⌨️ 快捷键说明

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