Glam Prestige Journal

Bright entertainment trends with youth appeal.

$\begingroup$

I need a formula (preferably something I can write with JavaScript, so simple arithmetic) that will map my value that is between 0.5 and 1, to a new value between 0 and 1. My brain is dead, this seems trivial, yet I can't say I ever learned how to do this. I'm sure someone here can help!

.5 => 0
.6 => .2
.7 => .4
.8 => .6
.9 => .8
1 => 1

Update

I found this answer which is excellent for linear mappings! My linear mapping equation is $y=2x-1$

And what if I wanted something non-linear?

.5 => 0
.75 => .25
.875 => .5
1 => 1
$\endgroup$ 1

1 Answer

$\begingroup$

Would a polynomial function work for you? If so, just construct the Lagrange or Newton-form interpolating polynomial. If you don't know how to do this, WolframAlpha has an interpolating polynomial calculator: .

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy