Struct LineSegment2D
A line segment
public struct LineSegment2D
- Inherited Members
Constructors
LineSegment2D(Point, Point)
Create a line segment with the specific starting point and end point
public LineSegment2D(Point p1, Point p2)
Parameters
Properties
Direction
The direction of the line, the norm of which is 1
public PointF Direction { get; }
Property Value
Length
Get the length of the line segment
public double Length { get; }
Property Value
P1
A point on the line
public Point P1 { get; set; }
Property Value
P2
An other point on the line
public Point P2 { get; set; }
Property Value
Methods
GetExteriorAngleDegree(LineSegment2D)
Get the exterior angle between this line and otherLine
public double GetExteriorAngleDegree(LineSegment2D otherLine)
Parameters
otherLine
LineSegment2DThe other line
Returns
- double
The exterior angle between this line and
otherLine
Side(Point)
Determine which side of the line the 2D point is at
public int Side(Point point)
Parameters
point
Pointthe point
Returns
- int
1 if on the right hand side; 0 if on the line; -1 if on the left hand side;