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

Namespace: Imsl.Chart2D
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public static double PointToLine(
	int Px,
	int Py,
	int[] devA,
	int[] devB
)
Visual Basic (Declaration)
Public Shared Function PointToLine ( _
	Px As Integer, _
	Py As Integer, _
	devA As Integer(), _
	devB As Integer() _
) As Double
Visual C++
public:
static double PointToLine(
	int Px, 
	int Py, 
	array<int>^ devA, 
	array<int>^ devB
)

Parameters

Px
Type: System..::.Int32
An int which specifies the x coordinate of the point (Px,Py).
Py
Type: System..::.Int32
An int which specifies the y coordinate of the point (Px,Py).
devA
Type: array< System..::.Int32 >[]()[]
An int[] which specifies the point that defines the head of the line segment.
devB
Type: array< System..::.Int32 >[]()[]
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