Click or drag to resize
Accord.NET (logo)

LineSegmentDistanceToPoint Method

Calculate Euclidean distance between a point and a finite line segment.

Namespace:  Accord.Math.Geometry
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
public float DistanceToPoint(
	Point point
Request Example View Source


Type: AccordPoint
The point to calculate the distance to.

Return Value

Type: Single
Returns the Euclidean distance between this line segment and the specified point. Unlike DistanceToPoint(Point), this returns the distance from the finite segment. (0,0) is 5 units from the segment (0,5)-(0,8), but is 0 units from the line through those points.
See Also