splines- B-Splines, other splines, and NURBS.

Safe HaskellNone




data BezierCurve t Source

A Bezier curve on 0 <= x <= 1.

bezierCurve :: Vector t -> BezierCurve tSource

Construct a Bezier curve from a list of control points. The degree of the curve is one less than the number of control points.

splitBezierCurve :: VectorSpace v => BezierCurve v -> Scalar v -> (BezierCurve v, BezierCurve v)Source

Split and rescale a Bezier curve. Given a BezierCurve b and a point t, splitBezierCurve b t creates 2 curves (b1, b2) such that (up to reasonable numerical accuracy expectations):

 evalSpline b1  x    == evalSpline b (x * t)
 evalSpline b2 (x-t) == evalSpline b (x * (1-t))

evalSpline :: Spline s v => s v -> Scalar v -> vSource