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

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

#include <CATLineFit.h>

List of all members.


Detailed Description

Regression to fit a line to a set of points.

Definition at line 23 of file CATLineFit.h.


Public Member Functions

 CATLineFit ()
virtual ~CATLineFit ()
bool AddPoint (CATFloat64 x, CATFloat64 y)
 Add a point to the interpolation data.
bool Clear ()
 Clear out all current data.
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)
 Get min/max values for x and y.
bool Slope (CATFloat64 &slope)
 Get the slope of the line.
bool Intercept (CATFloat64 &intercept)
 Get the intercept of the line.

Protected Member Functions

bool CalcFit ()
 Internal calculation.

Protected Attributes

std::vector< CATPointfPointList
 list of X points
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?).
CATFloat64 fSlope
 If not dirty, this is the slope of the line.
CATFloat64 fIntercept
 If not dirty, this is the intercept of the line.
CATFloat64 fSumX
 The sum of all X values.
CATFloat64 fSumY
 The sum of all Y values.
CATFloat64 fSumXY
 The sum of all X values times their Y values.
CATFloat64 fSumXSquared
 The sum of all X^2 (e.g. X1^2 + X2^2 .... + Xn^2).

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