| Copyright | (C) 2015 Dimitri Sabadie |
|---|---|
| License | BSD3 |
| Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Spline.Curve
Description
This module defines Splines and related functions. Because a Spline
requires Keys, the Data.Spline.Key module is also exported.
Splines
A is a collection of Spline a sKeys with associated interpolation
modes.
Given two Keys 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 Methods 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 Methods 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 Keys. 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 Keys. 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