Struct QuadraticSpline
Represents a 3-point quadratic spline segment (parabolic arc) defined by a start point, control point, and end point.
public readonly struct QuadraticSpline : ICurve
- Implements
- Inherited Members
Remarks
This spline uses the De Casteljau algorithm for interpolation and arc length approximation. The curve passes through P0 and P2, with P1 acting as the control point that defines curvature.
Constructors
QuadraticSpline(Point, Point, Point)
Initializes a new QuadraticSpline with the given start, control, and end points.
public QuadraticSpline(Point p0, Point p1, Point p2)
Parameters
Fields
P0
The start point of the spline.
public readonly Point P0
Field Value
P1
The control point that defines the curvature of the arc.
public readonly Point P1
Field Value
P2
The end point of the spline.
public readonly Point P2
Field Value
Properties
this[NFloat]
Evaluates the point on the spline at parameter t
.
public Point this[NFloat t] { get; }
Parameters
t
NFloat
Property Value
Methods
Length()
Approximates the total arc length of the spline using a fixed 16-sample De Casteljau subdivision.
public NFloat Length()
Returns
Length(NFloat)
Approximates the arc length with adaptive subdivision using the specified precision tolerance.
public NFloat Length(NFloat precision)
Parameters
precision
NFloatThe maximum allowed error in the approximation.
Returns
Lerp(NFloat)
Computes the point on the spline at parameter t
using De Casteljau interpolation.
public Point Lerp(NFloat t)
Parameters
t
NFloatA normalized parameter between 0 and 1.
Returns
Tangent(NFloat)
Computes the tangent vector at parameter t
on the spline.
public Vector Tangent(NFloat t)
Parameters
t
NFloatA normalized parameter between 0 and 1.
Returns
Operators
implicit operator QuadraticBezier(QuadraticSpline)
Converts this spline to a QuadraticBezier curve with the same control points.
public static implicit operator QuadraticBezier(QuadraticSpline s)