Files
kOS/library/lib_math.ks
T
2026-05-03 04:14:04 -04:00

29 lines
487 B
Plaintext

declare function Lerp{
parameter a, b, t.
return a + (b - a) * t.
}
declare function Map{
parameter value, a1, a2, b1, b2.
return b1 + (b2 - b1) * ((value - a1) / (a2 - a1)).
}
declare function EaseOutExpo {
parameter x, p is 10.
if x = 1 {
return 1.
} else{
return 1 - (2 ^ (-p * x)).
}
}
declare function EaseOutCirc{
parameter x.
return sqrt(1 - (x - 1)^2).
}
declare function EaseOutExp{
parameter x, n is 2.0.
return x ^ (2.0 * n).
}