smoothie 0.4 → 0.4.0.1
raw patch · 3 files changed
+12/−5 lines, 3 files
Files
- CHANGELOG.md +4/−0
- smoothie.cabal +1/−2
- src/Data/Spline/Key.hs +7/−3
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.4.0.1++- Fixed Bézier interpolation.+ ## 0.4 ### Breaking changes
smoothie.cabal view
@@ -1,5 +1,5 @@ name: smoothie -version: 0.4+version: 0.4.0.1 synopsis: Smooth curves via several interpolation modes description: This package exports several splines you can use to interpolate points in between. It includes instances for @@ -19,7 +19,6 @@ data-files: CHANGELOG.md library - ghc-options: -W -Wall -O2 -funbox-strict-fields default-extensions: DeriveFoldable
src/Data/Spline/Key.hs view
@@ -121,10 +121,14 @@ -> a s -> a s -> a s-interpolateBezier s k0 r0 l1 k1 = (u ^+^ v) ^* s+interpolateBezier s k0 r0 l1 k1 =+ k0 ^* ms3 ^+^ r0 ^* (3 * ms2 * s) ^+^ l1 ^* (3 * ms * s2) ^+^ k1 ^* s3 where- u = k0 ^+^ (r0 ^-^ k0) ^* s- v = l1 ^+^ (k1 ^-^ l1) ^* s+ ms = 1 - s+ ms2 = ms * ms+ ms3 = ms2 * ms+ s2 = s * s+ s3 = s2 * s -- |Normalize a sampling value by clamping and scaling it between two 'Key's. --