GetApproximationLine

Calculation of approximation straight line

int     GetApproximationLine(
        const double    *dataX,
        const double    *dataY,
        const int               dataNum,
        double          *coefficient
)

Parameters
*dataX
Coordinates X of points
*dataY
Coordinates Y of points
dataNum
Count of points
*coefficient
Straight line element(measurement result)

Return Value
NORMAL(0): Successful completion
Otherwise: Unsuccessful completion

Description
Calculate the approximation straight line based on the input point, and output the element.
The least square method is used for the approximation.
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.