public struct LineF
Defines a line segment.

Constructors

LineF

#
public LineF(float x0, float y0, float x1, float y1)
Create a new line.
x0 (float)X of start.
y0 (float)Y of start.
x1 (float)X of end.
y1 (float)Y of end.

LineF

#
public LineF(PointF start, float length, float angle)
Create a new line from polar coordinates.
start (PointF)Start of line.
length (float)Lenght of line.
angle (float)Angle of line, in degrees, clockwise from positive X.

LineF

#
public LineF(PointF start, PointF end)
Create a new line.
start (PointF)Start point.
end (PointF)End point.

LineF

#
public LineF(RectangleF rectangle, RectangleLine line)
Create a line based on a rectangle.
rectangle (RectangleF)
line (RectangleLine)

Properties

Bounds

#
public RectangleF Bounds { get; }
Gets the bounding box of this line segment.

End

#
public PointF End { get; }
Gets the end point of the line.

IsValid

#
public bool IsValid { get; }
Gets whether this line is invalid in any way.

IsZero

#
public bool IsZero { get; }
Gets whether this line has zero length.

Length

#
public float Length { get; }
Gets the length of the line.

Start

#
public PointF Start { get; }
Gets the start point of the line.

TangentX

#
public float TangentX { get; }
Gets the x component of the unit tangent vector.

TangentY

#
public float TangentY { get; }
Gets the y component of the unit tangent vector.

Unset

#
public static LineF Unset { get; }
Gets an unset line.

X0

#
public float X0 { get; }
Gets the x-component of the start point of the line.

X1

#
public float X1 { get; }
Gets the x-component of the end point of the line.

Y0

#
public float Y0 { get; }
Gets the y-component of the start point of the line.

Y1

#
public float Y1 { get; }
Gets the y-component of the end point of the line.

Methods

ClosestParameter

#
[Pure] public float ClosestParameter(PointF point, bool finiteSegment)
Find the parameter on the line closest to a point.
point (PointF)Point.
finiteSegment (bool)If true, only the finite line segment will be taken into account.
Parameter on line closest to point.

ClosestPoint

#
[Pure] public PointF ClosestPoint(PointF point, bool finiteSegment)
Find the point on the line closest to another point.
point (PointF)Point.
finiteSegment (bool)If true, only the finite line segment will be taken into account.
Point on line closest to point.

Extend

#
[Pure] public LineF Extend(float start, float end)
Extend the ends of the line by a physical distance.
start (float)Start extension length. Negative values result in shortening.
end (float)End extension length, Negative values result in shortening.
Modified line.

FillBox

#
[Pure] public LineF FillBox(RectangleF box)
Extend or clip this line so that it fills the interior of a box. If the line does not intersect with the box interior, a zero length segment is returned.
box (RectangleF)Boundary box.
Modified line.

Intersect

#
[Pure] public bool Intersect(LineF other, out float parameter0, out float parameter1)
Find the intersection parameters between two lines.
other (LineF)Other line.
parameter0 (out float)Parameter on this line at intersection.
parameter1 (out float)Parameter on other line at intersection.
True if intersection was found.

Intersect

#
[Pure] public int Intersect(RectangleF box, out float parameter0, out float parameter1)
Find the intersection points between this line and a box.
box (RectangleF)Box to intersect.
parameter0 (out float)Parameter on line at first intersection.
parameter1 (out float)Parameter on line at second intersection.
Number of intersections.

Move

#
[Pure] public LineF Move(float dx, float dy)
Move this line.
dx (float)Motion in x.
dy (float)Motion in y.

PointAt

#
[Pure] public PointF PointAt(float parameter)
Gets the point along the line at the specified parameter.
parameter (float)Line parameter.
Point at parameter.

Convertors

OperationResultDescription
implicitLineLineFDefines widening conversion from Rhino.Geometry.Line to Eto.LineF.