Curve interpolators for line and area generators.
Curves define how points are connected in a path.
Summary
Functions
Basis spline interpolation
The B-spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveBasisClosed
Cardinal spline interpolation
The cardinal spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveCardinalClosed
Catmull-Rom spline interpolation
Generates path commands for a list of points using the specified curve type.
Linear interpolation - straight lines between points
Monotone interpolation in x (preserves monotonicity)
Monotone interpolation in y (preserves monotonicity)
Natural cubic spline interpolation.
Step interpolation with configurable step position
Types
Functions
@spec basis([point()]) :: Visualize.IR.Path.t()
Basis spline interpolation
@spec basis_closed([point()]) :: Visualize.IR.Path.t()
The B-spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveBasisClosed
@spec cardinal([point()], number()) :: Visualize.IR.Path.t()
Cardinal spline interpolation
@spec cardinal_closed([point()], number()) :: Visualize.IR.Path.t()
The cardinal spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveCardinalClosed
@spec catmull_rom([point()], number()) :: Visualize.IR.Path.t()
Catmull-Rom spline interpolation
@spec generate(curve_type(), [point()], keyword()) :: Visualize.IR.Path.t()
Generates path commands for a list of points using the specified curve type.
@spec linear([point()]) :: Visualize.IR.Path.t()
Linear interpolation - straight lines between points
@spec monotone_x([point()]) :: Visualize.IR.Path.t()
Monotone interpolation in x (preserves monotonicity)
@spec monotone_y([point()]) :: Visualize.IR.Path.t()
Monotone interpolation in y (preserves monotonicity)
@spec natural([point()]) :: Visualize.IR.Path.t()
Natural cubic spline interpolation.
The spline through every point with zero second derivative at both ends, as d3-shape's
curveNatural. The Bézier control points come from the tridiagonal system solved by
control_points/1, once for the x coordinates and once for the y coordinates.
@spec step([point()], number()) :: Visualize.IR.Path.t()
Step interpolation with configurable step position