Class BezierCurve
java.lang.Object
org.episteme.core.mathematics.geometry.curves.BezierCurve
- All Implemented Interfaces:
Function<Real, Vector<Real>>, ContinuousFunction<Real, Vector<Real>>, DifferentiableFunction<Real, Vector<Real>>, Function<Real, Vector<Real>>, Relation<Real, Vector<Real>>, ParametricCurve
Represents a Bézier curve.
A Bézier curve is defined by control points Pâ‚€, Pâ‚Â, ..., Pâ‚™. The curve is computed using the Bernstein polynomial basis:
C(t) = Σᵢ Bᵢ,ₙ(t) * Pᵢ where Bᵢ,ₙ(t) = C(n,i) * t^i * (1-t)^(n-i)
Properties: - Passes through first and last control points - Tangent at endpoints determined by adjacent control points - Lies within convex hull of control points - Affine invariant
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionBezierCurve(List<PointND> controlPoints) Creates a Bézier curve from control points. -
Method Summary
Modifier and TypeMethodDescriptionEvaluates the curve at parameter t.intReturns the dimension of the ambient space.Elevates the degree of the Bézier curve.Returns the control points.intReturns the degree of the Bézier curve.Subdivides the Bézier curve at parameter t.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContinuousFunction
isContinuousMethods inherited from interface DifferentiableFunction
isDifferentiableMethods inherited from interface Function
andThen, apply, compose, contains, evaluate, getBackend, setBackendMethods inherited from interface ParametricCurve
arcLength, curvature, differentiate, evaluate, getOutputDimension, normal, tangent, unitTangentMethods inherited from interface Relation
getCodomain, getDomain
-
Constructor Details
-
BezierCurve
-
-
Method Details
-
at
Description copied from interface:ParametricCurveEvaluates the curve at parameter t.- Specified by:
atin interfaceParametricCurve- Parameters:
t- the parameter value- Returns:
- the point on the curve
-
dimension
public int dimension()Description copied from interface:ParametricCurveReturns the dimension of the ambient space.- Specified by:
dimensionin interfaceParametricCurve- Returns:
- the dimension
-
getControlPoints
-
getDegree
public int getDegree()Returns the degree of the Bézier curve.- Returns:
- the degree (number of control points - 1)
-
elevateDegree
Elevates the degree of the Bézier curve.Degree elevation adds a control point while keeping the curve shape unchanged.
- Returns:
- a new Bézier curve with elevated degree
-
subdivide
Subdivides the Bézier curve at parameter t.Returns two Bézier curves that together form the original curve.
- Parameters:
t- the parameter at which to subdivide- Returns:
- array of two Bézier curves [left, right]
-
toString
-