LinearSegment

References
public struct LinearSegment
Represents a line by origin and span vector.

Constructors

LinearSegment

#
public LinearSegment(double x0, double y0, double x1, double y1)
Create a 2d spatial line from start and end coordinates.
x0 (double)X of start.
y0 (double)Y of start.
x1 (double)X of end.
y1 (double)Y of end.

LinearSegment

#
public LinearSegment(double x0, double y0, double z0, double x1, double y1, double z1)
Create a spatial line from start and end coordinates.
x0 (double)X of start.
y0 (double)Y of start.
z0 (double)Z of start.
x1 (double)X of end.
y1 (double)Y of end.
z1 (double)Z of end.

LinearSegment

#
public LinearSegment(Line line)
Create a new spatial line from a RhinoCommon line.
line (Line)Line.

LinearSegment

#
public LinearSegment(LineF line)
Create a new spatial line from an Eto line.
line (LineF)

LinearSegment

#
public LinearSegment(Locus point0, Locus point1)
Create a new line.
point0 (Locus)
point1 (Locus)

Properties

Point

#
public Locus Point { get; }
Gets the line start point.

Span

#
public Locus Span { get; }
Gets the line span vector.

Tangent

#
public Locus Tangent { get; }
Gets the line unit tangent vector.

Methods

ClosestParameter

#
public double ClosestParameter(Locus point)
Get the parameter on the line closest to a point.
point (Locus)Point to approach.
Parameter on line.

ClosestPoint

#
public Locus ClosestPoint(Locus point)
Project a point onto the line.
point (Locus)Point.
Point on plane.

CrossingPoint

#
public bool CrossingPoint(InfinitePlane slice, out double t)
Find the parameter on the line at which it intersects a given slice.
slice (InfinitePlane)Slice to intersect.
t (out double)Parameter on line.
True if line and slice intersect.

CrossingPoint

#
public bool CrossingPoint(LinearSegment line, out double t0, out double t1)
Find the crossing points for two lines. The crossing point is where they approach each other the closest.
line (LinearSegment)Line to cross.
t0 (out double)Parameter of crossing on this line.
t1 (out double)Parameter of crossing on other line.
True if lines cross, false if not.

DistanceTo

#
public double DistanceTo(LinearSegment line)
Gets the distance to a line.
line (LinearSegment)Line.
Distance to line.

DistanceTo

#
public double DistanceTo(Locus point)
Gets the distance to a point.
point (Locus)Point.
Distance to point.

Evaluate

#
public Locus Evaluate(double t)
Evaluate this line a given parameter.
t (double)Parameter to evaluate.
Point on line at parameter.

QuadranceTo

#
public double QuadranceTo(LinearSegment line)
Gets the quadrance to a line.
line (LinearSegment)Line.
Quadrance to line.

QuadranceTo

#
public double QuadranceTo(Locus point)
Gets the quadrance to a point.
point (Locus)Point.
Quadrance to point.

To2D

#
public LinearSegment To2D()
Flatten this line by removing all z data.