GetNearestPosLinePoint

The shortest section calculation of straight line and point

int     GetNearestPosLinePoint(
        const double    *coefficient,
        const double    posX,
        const double    posY,
        double          *nearestPosX,
        double          *nearestPosY,
        double          *distance
)

Parameters
*coefficient
Straight line element
posX
Coordinates X
posY
Coordinates Y
*nearestPosX
Shortest coordinates X on straight line X (Measurement results)
*nearestPosY
Shortest coordinates Y on straight line Y (Measurement results)
*distance
Shortest distance between straight line and point (Measurement results)

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

Description
Calculates the shortest part between straight line and point.

Notes
The straight line is specified 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.