The class encapsulates 2D line segment and provides some tool methods related to lines.Namespace: AForge.Math.Geometry
Assembly: AForge.Math (in AForge.Math.dll) Version: 126.96.36.199 (188.8.131.52)
public sealed class LineSegment
The class provides some methods which are related to line segments: distance to point, finding intersection point, etc.
A line segment may be converted to a Line.
// create a segment LineSegment segment = new LineSegment( new Point( 0, 0 ), new Point( 3, 4 ) ); // get segment's length float length = segment.Length; // get intersection point with a line Point? intersection = segment.GetIntersectionWith( new Line( new Point( -3, 8 ), new Point( 0, 4 ) ) );