Struct QuadraticBezier3
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
Fields
P0
The starting point of the curve.
public readonly Point3 P0
Field Value
P1
The control point, which influences the curvature.
public readonly Point3 P1
Field Value
P2
The ending point of the curve.
public readonly Point3 P2
Field Value
Properties
this[float]
Evaluates the curve at the given parameter t.
Alias for Lerp(float).
public Point3 this[float t] { get; }
Parameters
tfloat
Property Value
Methods
Length()
Approximates the arc length using 16 uniform samples.
public float Length()
Returns
Length(float)
Approximates the arc length using adaptive subdivision until the error per
segment is within precision.
public float Length(float precision)
Parameters
precisionfloat
Returns
Lerp(float)
Evaluates the curve at parameter t using De Casteljau's algorithm.
public Point3 Lerp(float t)
Parameters
tfloatA normalized parameter in the range [0, 1].
Returns
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
tfloatThe split parameter in the range (0, 1).
Returns
Tangent(float)
Returns the tangent vector of the curve at parameter t.
public Vector3 Tangent(float t)
Parameters
tfloatA normalized parameter in the range [0, 1].
Returns
ToCubic()
Elevates this quadratic curve to an equivalent CubicBezier3.
public CubicBezier3 ToCubic()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.