smoothie-0.1.0.0: Smooth curves via several spline and polynomials.

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Spline

Contents

Description

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.

Synopsis

Spline

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.

Smoothing values along splines

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

Smoothly interpolate a point on a spline.