IMSL C# Numerical Library

PickEventArgs.PointToLine Method 

Compute the distance from the point (Px, Py) to the line segment AB.

public static double PointToLine(
   int Px,
   int Py,
   int[] devA,
   int[] devB
);

Parameters

Px
An int which specifies the x coordinate of the point (Px,Py).
Py
An int which specifies the y coordinate of the point (Px,Py).
devA
An int[] which specifies the point that defines the head of the line segment.
devB
An int[] which specifies the point that defines the tail of the line segment.

Return Value

A double which contains the distance from the point (Px,Py) to the line segment AB.

Remarks

If the closest point from P to the line AB is not between A and B then the distance to the closer of A and B is returned.

See Also

PickEventArgs Class | Imsl.Chart2D Namespace