Struct LinearSpline
Represents a linear spline segment between two points.
public readonly struct LinearSpline : ICurve
- Implements
- Inherited Members
Remarks
A linear spline defines a straight-line interpolation between P0 and P1. It is the simplest form of spline, useful for polyline paths, control handles, and degenerate Bézier cases.
Constructors
LinearSpline(Point, Point)
Initializes a new LinearSpline segment between two points.
public LinearSpline(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]
Evaluates the point on the spline at the specified parameter.
public Point this[NFloat t] { get; }
Parameters
t
NFloat
Property Value
Methods
Length()
Returns the length of the segment.
public NFloat Length()
Returns
Length(NFloat)
Returns the length of the segment. Precision is ignored for linear splines.
public NFloat Length(NFloat precision)
Parameters
precision
NFloat
Returns
Lerp(NFloat)
Interpolates a point on the segment at the specified parameter.
public Point Lerp(NFloat t)
Parameters
t
NFloatA normalized parameter in the range [0, 1].
Returns
- Point
The interpolated point on the line.
Tangent(NFloat)
Gets the constant tangent vector of the line segment.
public Vector Tangent(NFloat t)
Parameters
t
NFloatA normalized parameter (unused, since the tangent is constant).
Returns
Operators
implicit operator LinearBezier(LinearSpline)
Converts this linear spline to a LinearBezier.
public static implicit operator LinearBezier(LinearSpline s)