module Chiphunk.Low.Math where
import Data.VectorSpace
fClamp
:: Double
-> Double
-> Double
-> Double
fClamp :: Double -> Double -> Double -> Double
fClamp Double
x Double
a Double
b
| Double
x Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
< Double
a = Double
a
| Double
x Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
> Double
b = Double
b
| Bool
otherwise = Double
x
fLerp
:: Double
-> Double
-> Double
-> Double
fLerp :: Double -> Double -> Double -> Double
fLerp = Double -> Double -> Double -> Double
forall v. VectorSpace v => v -> v -> Scalar v -> v
lerp
fLerpConst
:: Double
-> Double
-> Double
-> Double
fLerpConst :: Double -> Double -> Double -> Double
fLerpConst Double
x Double
y Double
d = Double
x Double -> Double -> Double
forall a. Num a => a -> a -> a
+ Double -> Double -> Double -> Double
fClamp (Double
y Double -> Double -> Double
forall a. Num a => a -> a -> a
- Double
x) (-Double
d) Double
d