Table of Contents

Struct QuadraticBezier3

Namespace
Xui.Core.Curves3D
Assembly
Xui.Core.dll

Represents a quadratic (degree-2) Bézier curve in 3D space, defined by a start point, one control point, and an end point.

public readonly struct QuadraticBezier3 : ICurve3
Implements
Inherited Members

Remarks

A quadratic Bézier provides smooth interpolation from P0 to P2, pulled toward the control point P1. Points are computed using De Casteljau's algorithm for numerical stability.

Constructors

QuadraticBezier3(Point3, Point3, Point3)

Initializes a new QuadraticBezier3 with the specified control points.

public QuadraticBezier3(Point3 p0, Point3 p1, Point3 p2)

Parameters

p0 Point3
p1 Point3
p2 Point3

Fields

P0

The starting point of the curve.

public readonly Point3 P0

Field Value

Point3

P1

The control point, which influences the curvature.

public readonly Point3 P1

Field Value

Point3

P2

The ending point of the curve.

public readonly Point3 P2

Field Value

Point3

Properties

this[float]

Evaluates the curve at the given parameter t. Alias for Lerp(float).

public Point3 this[float t] { get; }

Parameters

t float

Property Value

Point3

Methods

Length()

Approximates the arc length using 16 uniform samples.

public float Length()

Returns

float

Length(float)

Approximates the arc length using adaptive subdivision until the error per segment is within precision.

public float Length(float precision)

Parameters

precision float

Returns

float

Lerp(float)

Evaluates the curve at parameter t using De Casteljau's algorithm.

public Point3 Lerp(float t)

Parameters

t float

A normalized parameter in the range [0, 1].

Returns

Point3

Subdivide(float)

Subdivides this curve at parameter t using De Casteljau's algorithm, returning the left and right sub-curves.

public (QuadraticBezier3 left, QuadraticBezier3 right) Subdivide(float t)

Parameters

t float

The split parameter in the range (0, 1).

Returns

(QuadraticBezier3 left, QuadraticBezier3 right)

Tangent(float)

Returns the tangent vector of the curve at parameter t.

public Vector3 Tangent(float t)

Parameters

t float

A normalized parameter in the range [0, 1].

Returns

Vector3

ToCubic()

Elevates this quadratic curve to an equivalent CubicBezier3.

public CubicBezier3 ToCubic()

Returns

CubicBezier3

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.