Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace (or augment) Math.scale with Math.lerp/unlerp (possibly with better names) #6

Open
thomcc opened this issue Sep 12, 2016 · 0 comments

Comments

@thomcc
Copy link

thomcc commented Sep 12, 2016

Names obviously can be bikeshedded over to infinity, I'll admit that lerp/unlerp are bad ones. (GLSL goes with mix, HLSL goes with lerp, i've seen packages do linearInterpolate or interpolate and inverseLinearInterpolate, etc -- although those seem much too verbose to me).

Anyway, it seems extremely likely to me that linear interpolation is more common than linear remapping, and so a lerp/unlerp pair would get more use than Math.scale (even if they can be implemented by passing 0 and 1 as lo/hi values for Math.scale).

Including all 3 would be fine by me as well.

(P.S. other than that I'd like to thank you for including RAD_PER_DEG/DEG_PER_RAD as a constant in addition to a function!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant