Struct Segment
Represents a straight line segment from P0 to P1. Implements the ICurve interface for compatibility with other curve types.
public readonly struct Segment : ICurve
- Implements
- Inherited Members
Constructors
Segment(Point, Point)
Initializes a new line from p0
to p1
.
public Segment(Point p0, Point p1)
Parameters
Fields
P0
The starting point of the line segment.
public readonly Point P0
Field Value
P1
The ending point of the line segment.
public readonly Point P1
Field Value
Properties
this[NFloat]
Provides indexer access as an alias for Lerp(NFloat).
public Point this[NFloat t] { get; }
Parameters
t
NFloat
Property Value
Methods
Length()
Computes an approximate arc length using 16 steps.
public NFloat Length()
Returns
Length(NFloat)
Computes a refined approximation of arc length with a specified precision.
public NFloat Length(NFloat precision)
Parameters
precision
NFloat
Returns
Lerp(NFloat)
Evaluates the curve at the given normalized parameter t in [0, 1].
public Point Lerp(NFloat t)
Parameters
t
NFloat
Returns
Tangent(NFloat)
Computes the tangent vector at the specified t.
public Vector Tangent(NFloat t)
Parameters
t
NFloat
Returns
Operators
implicit operator Segment((Point p0, Point p1))
Converts a tuple to a Segment.
public static implicit operator Segment((Point p0, Point p1) value)