00001 #ifndef CUBIC_H
00002 #define CUBIC_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __GNUC__
00027 #ifndef __attribute__
00028 #define __attribute__(x)
00029 #endif
00030 #endif
00031
00032 static char __attribute__((unused)) cubic_h[] = "$Id: cubic.h,v 1.2 2000/10/27 20:34:42 terrylr Exp $";
00033
00034 typedef struct
00035 {
00036 double a;
00037 double b;
00038 double c;
00039 double d;
00040 } CUBIC_COEFF;
00041
00042 typedef struct
00043 {
00044 int configured;
00045 double segmentTime;
00046 int interpolationRate;
00047 double interpolationTime;
00048 double interpolationIncrement;
00049 double x0, x1, x2, x3;
00050 double wp0, wp1;
00051 double velp0, velp1;
00052 int filled;
00053 int needNextPoint;
00054 CUBIC_COEFF coeff;
00055 } CUBIC_STRUCT;
00056
00057 extern int cubicInit(CUBIC_STRUCT *ci);
00058 extern int cubicSetSegmentTime(CUBIC_STRUCT *ci, double time);
00059 extern double cubicGetSegmentTime(CUBIC_STRUCT *ci);
00060 extern int cubicSetInterpolationRate(CUBIC_STRUCT *ci, int rate);
00061 extern int cubicGetInterpolationRate(CUBIC_STRUCT *ci);
00062 extern int cubicAddPoint(CUBIC_STRUCT *ci, double point);
00063 extern int cubicOffset(CUBIC_STRUCT *ci, double offset);
00064 extern double cubicGetInterpolationIncrement(CUBIC_STRUCT *ci);
00065 extern CUBIC_COEFF cubicGetCubicCoeff(CUBIC_STRUCT *ci);
00066 extern int cubicFilled(CUBIC_STRUCT *ci);
00067 extern double cubicInterpolate(CUBIC_STRUCT *ci,
00068 double *x,
00069 double *v,
00070 double *a,
00071 double *j);
00072 extern int cubicNeedNextPoint(CUBIC_STRUCT *ci);
00073 extern int cubicDrain(CUBIC_STRUCT *ci);
00074
00075 #endif