GetFNCApproximationLine
Calculates the straight approximation line (Using original algorithm FNC.)
int GetFNCApproximationLine(
const double *dataX,
const double *dataY,
const int dataNum,
const int selectNum,
double *coefficient
)
Parameters
*dataX
|
Coordinates X of points
|
*dataY
|
Coordinates Y of points
|
dataNum
|
Count of points
|
selectNum
|
The point number to be extructed
|
*coefficient
|
Straight line element(measurement result)
|
Return Value
NORMAL(0): Successful completion
Otherwise: Unsuccessful completion
Description
Calculates and outputs the coefficients of the approximation straight line based on input point sequence.
The least square method is used for the approximation.
Calculates the straight line coefficients after the number of inputs is extracted to [selectNum] with original algorithm FNC.
Output is a,b,c as for a straight line expression ax + by + c = 0. It is stored in coefficient[0], coefficient[1], and coefficient [2] respectively.
Notes
Returns ERR_PARAM when the point sequence number is less than one.
When two or more straight lines can be calculated, outputs one of them.