# How to make a range thats not 0-1 0-1

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How do I take a range thats from 0-.7 or so and make it 0-1 so that .7 is now 1 and 0 of course is still 0? Thanks

##### Share on other sites
Divide the numbers by 0.7.

##### Share on other sites
no, multiply by 0.7

0.7 / 0.7 = 1
0.7 * 0.7 = 0.49

^^

##### Share on other sites
To adjust a value from the original range (min0 to max0) to the new range (min1 to max1), use this function:
f(v) = ((v - min0) / (max0 - min0)) * (max1 - min1) + min1

If min0 = 0, max0 = 0.7, min1 = 0 and max1 = 1, then the function would simplify to:
f(v) = ((v - 0) / (0.7 - 0)) * 1 + 0     = v / 0.7

Just as uavfun said.

##### Share on other sites
Basically what you have to do is scale the value so that it's in the given range. Here's a visual:
|----|----|0   .4   .7|----|----|0   .5    1

Agony already posted the formula, I just thought I'd explain it a little more.

##### Share on other sites
Thanks all for the help. I am using Value / .7 and I know that my value max is .7 so this works great... Thanks again

• 17
• 10
• 21
• 16
• 9