smoothie-0.2.1: Smooth curves via several splines and polynomials.

Copyright(C) 2015 Dimitri Sabadie
MaintainerDimitri Sabadie <>
Safe HaskellNone




A Spline s a represents a curve in which a is very likely to be Additive (see "linear") and s is the sampling type.

The library exports two useful functions: spline and smooth. The former enables you to create splines while the latter enables you to sample from them using their control points.



data Spline s a Source

A Spline is a collection of control points with associated polynomials. Given two control points which indices are i and i+1, interpolation on the resulting curve is performed using the polynomial of indice i. Thus, the latest control point is ignored and can be set to whatever the user wants to, even undefined – you should use hold, though. Yeah, don’t go filthy.

spline :: (Ord a, Ord s) => [(CP s a, Polynomial s a)] -> Spline s a Source

Create a spline using a list of control points and associated polynomials. Since spline sorts the list before creating the Spline, you don’t have to ensure the list is sorted – even though you should, setting control points with no order might be… chaotic.

unspline :: Spline s a -> [(CP s a, Polynomial s a)] Source

Deconstruct a 'Spline s a' to yield '[(CP s a,Polynomial s a)]'.

Sampling values from splines

sample :: Ord s => Spline s a -> s -> Maybe a Source

Sample a point on a spline.