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

public class BezierCurve extends Object implements 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 Details

    • BezierCurve

      public BezierCurve(List<PointND> controlPoints)
      Creates a Bézier curve from control points.
      Parameters:
      controlPoints - the control points (must have at least 2)
  • Method Details

    • at

      public PointND at(Real t)
      Description copied from interface: ParametricCurve
      Evaluates the curve at parameter t.
      Specified by:
      at in interface ParametricCurve
      Parameters:
      t - the parameter value
      Returns:
      the point on the curve
    • dimension

      public int dimension()
      Description copied from interface: ParametricCurve
      Returns the dimension of the ambient space.
      Specified by:
      dimension in interface ParametricCurve
      Returns:
      the dimension
    • getControlPoints

      public List<PointND> getControlPoints()
      Returns the control points.
      Returns:
      the control points
    • getDegree

      public int getDegree()
      Returns the degree of the Bézier curve.
      Returns:
      the degree (number of control points - 1)
    • elevateDegree

      public BezierCurve 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

      public BezierCurve[] subdivide(Real t)
      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

      public String toString()
      Overrides:
      toString in class Object