Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATCurveFit Class Reference

CATCurveFit Class Reference
[Common Accessibility Technology [CAT] library]

#include <CATCurveFit.h>

List of all members.


Detailed Description

Fit a curve to a set of points.

Fits a curve of the specified degree to a set of data. Based off the algorithm presented in "Introduction to Algorithms" Second Edition, by Cormen, Leiserson, Rivest, and Stein (MIT press)

Definition at line 28 of file CATCurveFit.h.


Public Member Functions

 CATCurveFit (CATUInt32 curveDegree=3)
virtual ~CATCurveFit ()
bool AddPoint (CATFloat64 x, CATFloat64 y)
 Add a point to the interpolation data.
bool Clear ()
 Clear out all current data.
bool GetDegree (CATUInt32 &degree)
 Get the polynomial degree.
bool GetCoefficient (CATUInt32 deg, CATFloat64 &coef)
 Get a specific coefficient.
CATUInt32 GetNumPoints ()
 Get the number of data points acquired.
bool GetDataPoint (CATUInt32 n, CATFloat64 &x, CATFloat64 &y)
 Get an individual data point.
bool CalcYVal (CATFloat64 x, CATFloat64 &y)
 Calculate the Y val from a specified x val.
bool GetCurrentErr (CATFloat64 &err)
 Get error value.
bool GetMinMax (CATFloat64 &minX, CATFloat64 &minY, CATFloat64 &maxX, CATFloat64 &maxY)
bool LangrangianCalcY (CATFloat64 x, CATFloat64 &y)

Protected Member Functions

bool CalcFit ()

Protected Attributes

std::vector< CATPointfPointList
 list of X points
std::vector< CATFloat64fCoef
 list of coefficients (double's)
CATFloat64 fLastErr
 last calculated err
CATUInt32 fDegree
 Degree of coefficient to calculate with fit.
bool fDirty
 Are the coefficients dirty? (i.e. need to call CalcFit?).

The documentation for this class was generated from the following files:
Generated on Mon Feb 11 04:10:26 2008 for Game Accessibility Suite by doxygen 1.5.4