mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-25 23:24:35 +00:00
chased down more math
vs mathx
usage (and actually fixed the random_lerp usage)
This commit is contained in:
parent
4460a94933
commit
7767802433
@ -71,8 +71,8 @@ end
|
|||||||
--bilinear interpolation between 4 samples
|
--bilinear interpolation between 4 samples
|
||||||
function mathx.bilerp(a, b, c, d, u, v)
|
function mathx.bilerp(a, b, c, d, u, v)
|
||||||
return mathx.lerp(
|
return mathx.lerp(
|
||||||
math.lerp(a, b, u),
|
mathx.lerp(a, b, u),
|
||||||
math.lerp(c, d, u),
|
mathx.lerp(c, d, u),
|
||||||
v
|
v
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@ -139,7 +139,7 @@ end
|
|||||||
|
|
||||||
--return a random value between two numbers (continuous)
|
--return a random value between two numbers (continuous)
|
||||||
function mathx.random_lerp(min, max, _r)
|
function mathx.random_lerp(min, max, _r)
|
||||||
return math.lerp(min, max, _random(_r))
|
return mathx.lerp(min, max, _random(_r))
|
||||||
end
|
end
|
||||||
|
|
||||||
--nan checking
|
--nan checking
|
||||||
|
Loading…
Reference in New Issue
Block a user