- constant :: y -> T y
- linear :: C y => y -> y -> T y
- linearMultiscale :: C y => y -> y -> T y
- linearMultiscaleNeutral :: C y => y -> T y
- linearStable :: C y => y -> y -> T y
- linearMean :: C y => y -> y -> T y
- linearSubdivision :: C y => T y -> T y
- line :: C y => Int -> (y, y) -> T y
- exponentialMultiscale :: C y => y -> y -> T y
- exponentialStable :: C y => y -> y -> T y
- exponential :: C y => y -> y -> T y
- exponentialMultiscaleNeutral :: C y => y -> T y
- exponential2Multiscale :: C y => y -> y -> T y
- exponential2Stable :: C y => y -> y -> T y
- exponential2 :: C y => y -> y -> T y
- exponential2MultiscaleNeutral :: C y => y -> T y
- exponentialFromToMultiscale :: C y => y -> y -> y -> T y
- exponentialFromTo :: C y => y -> y -> y -> T y
- exponentialStableGen :: (C y, C t) => (t -> y) -> t -> y -> T y
- vectorExponential :: (C y, C y v) => y -> v -> T v
- vectorExponential2 :: (C y, C y v) => y -> v -> T v
- cosineMultiscale :: C y => y -> y -> T y
- cosineSubdiv :: C y => y -> y -> T y
- cosineStable :: C y => y -> y -> T y
- cosine :: C y => y -> y -> T y
- cosineSubdivision :: C y => y -> T y -> T y
- cosineWithSlope :: C y => (y -> y -> signal) -> y -> y -> signal
- cubicHermite :: C y => (y, (y, y)) -> (y, (y, y)) -> T y
- cubicFunc :: C y => (y, (y, y)) -> (y, (y, y)) -> y -> y
- cubicHermiteStable :: C y => (y, (y, y)) -> (y, (y, y)) -> T y
- cubicSubdivision :: C y => T y -> T y
- data Control y
- = CtrlStep
- | CtrlLin
- | CtrlExp {
- ctrlExpSaturation :: y
- | CtrlCos
- | CtrlCubic {
- ctrlCubicGradient0 :: y
- ctrlCubicGradient1 :: y
- data ControlPiece y = ControlPiece {}
- newtype PieceRightSingle y = PRS y
- newtype PieceRightDouble y = PRD y
- type ControlDist y = (y, Control y, y)
- (#|-) :: (y, Control y) -> (PieceRightSingle y, [ControlPiece y]) -> (ControlDist y, [ControlPiece y])
- (-|#) :: y -> (ControlDist y, [ControlPiece y]) -> (PieceRightSingle y, [ControlPiece y])
- (#|=) :: (y, Control y) -> (PieceRightDouble y, [ControlPiece y]) -> (ControlDist y, [ControlPiece y])
- (=|#) :: (y, y) -> (ControlDist y, [ControlPiece y]) -> (PieceRightDouble y, [ControlPiece y])
- (#|) :: (y, Control y) -> y -> (ControlDist y, [ControlPiece y])
- (|#) :: y -> (ControlDist y, [ControlPiece y]) -> [ControlPiece y]
- piecewise :: (C y, C y) => [ControlPiece y] -> T y
- piecewisePart :: C y => y -> y -> y -> y -> Int -> Control y -> T y
- curveStable :: C t => (t -> y) -> (y -> y -> y) -> t -> y -> T y
- unreachable :: a
- double :: C t => t -> t
- concatMapPair :: (a -> (b, b)) -> T a -> T b
- flattenPairs :: T (a, a) -> T a
- subdivide :: (y -> y -> y) -> T y -> T y
- concatMapPair' :: (a -> (b, b)) -> T a -> T b
- curveMultiscale :: (y -> y -> y) -> y -> y -> T y
- curveMultiscaleNeutral :: (y -> y -> y) -> y -> y -> T y
Control curve generation
linearMultiscale :: C y => y -> y -> T ySource
Minimize rounding errors by reducing number of operations per element to a logarithmuc number.
linearMultiscaleNeutral :: C y => y -> T ySource
Linear curve starting at zero.
linearStable :: C y => y -> y -> T ySource
As stable as the addition of time values.
linearMean :: C y => y -> y -> T ySource
It computes the same like linear
but in a numerically more stable manner,
namely using a subdivision scheme.
The division needed is a division by two.
0 4 8 0 2 4 6 8 0 1 2 3 4 5 6 7 8
linearSubdivision :: C y => T y -> T ySource
Intersperse linearly interpolated values.
Linear curve of a fixed length. The final value is not actually reached, instead we stop one step before. This way we can concatenate several lines without duplicate adjacent values.
exponentialStableGen :: (C y, C t) => (t -> y) -> t -> y -> T ySource
:: (C y, C y v) | |
=> y | time where the function reaches 1/e of the initial value |
-> v | initial value |
-> T v | exponential decay |
This is an extension of exponential
to vectors
which is straight-forward but requires more explicit signatures.
But since it is needed rarely I setup a separate function.
cosineSubdivision :: C y => y -> T y -> T ySource
cosineWithSlope :: C y => (y -> y -> signal) -> y -> y -> signalSource
cubicHermite :: C y => (y, (y, y)) -> (y, (y, y)) -> T ySource
cubicFunc :: C y => (y, (y, y)) -> (y, (y, y)) -> y -> ySource
0 16 0 8 16 0 4 8 12 16 0 2 4 6 8 10 12 14 16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
cubicHermiteStable :: C y => (y, (y, y)) -> (y, (y, y)) -> T ySource
cubicSubdivision :: C y => T y -> T ySource
The curve type of a piece of a piecewise defined control curve.
data ControlPiece y Source
The full description of a control curve piece.
Eq y => Eq (ControlPiece y) | |
Show y => Show (ControlPiece y) |
newtype PieceRightSingle y Source
PRS y |
newtype PieceRightDouble y Source
PRD y |
type ControlDist y = (y, Control y, y)Source
(#|-) :: (y, Control y) -> (PieceRightSingle y, [ControlPiece y]) -> (ControlDist y, [ControlPiece y])Source
The 6 operators simplify constructing a list of ControlPiece a
.
The description consists of nodes (namely the curve values at nodes)
and the connecting curve types.
The naming scheme is as follows:
In the middle there is a bar |
.
With respect to the bar,
the pad symbol #
is at the side of the curve type,
at the other side there is nothing, a minus sign -
, or an equality sign =
.
- Nothing means that here is the start or the end node of a curve.
- Minus means that here is a node where left and right curve meet at the same value. The node description is thus one value.
- Equality sign means that here is a split node, where left and right curve might have different ending and beginning values, respectively. The node description consists of a pair of values.
(-|#) :: y -> (ControlDist y, [ControlPiece y]) -> (PieceRightSingle y, [ControlPiece y])Source
(#|=) :: (y, Control y) -> (PieceRightDouble y, [ControlPiece y]) -> (ControlDist y, [ControlPiece y])Source
(=|#) :: (y, y) -> (ControlDist y, [ControlPiece y]) -> (PieceRightDouble y, [ControlPiece y])Source
(#|) :: (y, Control y) -> y -> (ControlDist y, [ControlPiece y])Source
(|#) :: y -> (ControlDist y, [ControlPiece y]) -> [ControlPiece y]Source
Auxiliary functions
curveStable :: C t => (t -> y) -> (y -> y -> y) -> t -> y -> T ySource
unreachable :: aSource
concatMapPair :: (a -> (b, b)) -> T a -> T bSource
flattenPairs :: T (a, a) -> T aSource
concatMapPair' :: (a -> (b, b)) -> T a -> T bSource
curveMultiscale :: (y -> y -> y) -> y -> y -> T ySource
curveMultiscaleNeutral :: (y -> y -> y) -> y -> y -> T ySource