Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module defines Spline
s and related functions. Because a Spline
requires Key
s, the Data.Spline.Key module is also exported.
Splines
A
is a collection of Spline
a sKey
s with associated interpolation
modes.
Given two Key
s which indices are i and i+1, the interpolation mode on
the resulting curve is performed using the interpolation mode of the key i.
Thus, the interpolation mode of the latest key might be ignored. There’s an
exception, though, when using the Bezier
interpolation mode. Feel free
to dig in the Key documentation.
Instances
Functor a => Functor (Spline a) Source # | |
Eq (a s) => Eq (Spline a s) Source # | |
Show (a s) => Show (Spline a s) Source # | |
Generic (Spline a s) Source # | |
(FromJSON (a s), Ord s) => FromJSON ((a s -> s) -> Spline a s) Source # | |
Defined in Data.Spline.Curve parseJSON :: Value -> Parser ((a s -> s) -> Spline a s) parseJSONList :: Value -> Parser [(a s -> s) -> Spline a s] | |
ToJSON (a s) => ToJSON (Spline a s) Source # | |
Defined in Data.Spline.Curve toEncoding :: Spline a s -> Encoding toJSONList :: [Spline a s] -> Value toEncodingList :: [Spline a s] -> Encoding | |
type Rep (Spline a s) Source # | |
Defined in Data.Spline.Curve |
Building splines
spline :: Ord s => (a s -> s) -> [Key (a s)] -> Spline a s Source #
Build a
.Spline
a s
a s
is the type held by Key
s. For instance,
.V2
Float
The first argument of the function, which has type a s -> s
, is a function
used to extract the sampling value of each Key
s. In most cases, that value
represents the time or the frame of a simulation. That value is used to
perform sampling comparison.
Sampling splines
Re-exported
module Data.Spline.Key