Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cubic.h

Go to the documentation of this file.
00001 #ifndef CUBIC_H
00002 #define CUBIC_H
00003 
00004 /*
00005    cubic.h
00006 
00007    Cubic polynomial interpolation code
00008 
00009    Modification history:
00010 
00011    13-Mar-2000 WPS added unused attribute to cubic_h to avoid 'defined but not used' compiler warning.
00012    2-Aug-1999  FMP added cubicOffset()
00013    22-Oct-1998  FMP removed '_' from _filled and _needNextPoint
00014    18-Dec-1997  FMP took out C++ interface
00015    16-Jun-1997  FMP added cubicDrain()
00016    16-Apr-1997  FMP created from C and C++ separate versions
00017 */
00018 
00019 /*
00020    Coefficients of a cubic polynomial,
00021 
00022    a * x^3 + b * x^2 + c * x + d
00023 */
00024 
00025 /* ident tag */
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, /* same as return val */
00069                                double *v, /* velocity */
00070                                double *a, /* accel */
00071                                double *j); /* jerk */
00072 extern int cubicNeedNextPoint(CUBIC_STRUCT *ci);
00073 extern int cubicDrain(CUBIC_STRUCT *ci);
00074 
00075 #endif /* CUBIC_H */

Generated on Sun Dec 2 15:27:36 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001