Table of Contents

Struct QuadraticSpline

Namespace
Xui.Core.Curves2D
Assembly
Core.dll

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

p0 Point
p1 Point
p2 Point

Fields

P0

The start point of the spline.

public readonly Point P0

Field Value

Point

P1

The control point that defines the curvature of the arc.

public readonly Point P1

Field Value

Point

P2

The end point of the spline.

public readonly Point P2

Field Value

Point

Properties

this[NFloat]

Evaluates the point on the spline at parameter t.

public Point this[NFloat t] { get; }

Parameters

t NFloat

Property Value

Point

Methods

Length()

Approximates the total arc length of the spline using a fixed 16-sample De Casteljau subdivision.

public NFloat Length()

Returns

NFloat

Length(NFloat)

Approximates the arc length with adaptive subdivision using the specified precision tolerance.

public NFloat Length(NFloat precision)

Parameters

precision NFloat

The maximum allowed error in the approximation.

Returns

NFloat

Lerp(NFloat)

Computes the point on the spline at parameter t using De Casteljau interpolation.

public Point Lerp(NFloat t)

Parameters

t NFloat

A normalized parameter between 0 and 1.

Returns

Point

Tangent(NFloat)

Computes the tangent vector at parameter t on the spline.

public Vector Tangent(NFloat t)

Parameters

t NFloat

A normalized parameter between 0 and 1.

Returns

Vector

Operators

implicit operator QuadraticBezier(QuadraticSpline)

Converts this spline to a QuadraticBezier curve with the same control points.

public static implicit operator QuadraticBezier(QuadraticSpline s)

Parameters

s QuadraticSpline

Returns

QuadraticBezier