00001 #ifndef _WINC_SPLINE
00002 #define _WINC_SPLINE
00003
00004 #include <WXP/Point.h>
00005 #include <WXP/Points.h>
00006
00007 namespace WXP {
00008 class Spline {
00009 int num;
00010 int type;
00011 float *x;
00012 float *y;
00013 float *d;
00014 float *coeffx;
00015 float *coeffy;
00016 int poly;
00017
00018 int initResrc();
00019 float *createCoeffs( float *x, float *y );
00020 float interp( float z, float *coeffs, float *x, float *y );
00021
00022 public:
00023 Spline();
00024 Spline( Points &pts, int rtype );
00025 int set( Points &pts, int rtype );
00026 ~Spline();
00027 float getValue( float z );
00028 int getPoint( float z, Point &pt );
00029 float getDist();
00030 float getDist( Point &pt );
00031 float getDist( int ind );
00032
00033 enum Type { D1, D2 };
00034 };
00035 }
00036 #endif