- Home /
Quick Math Help with Normalized numbers
Ok, i have a normalised number (in the range 0 - 1) which represents a point along a line. Or a percentage.
How do i convert this into a number in the range 0.5 - 2, making it represent the same point/percentage along that scale?
i'm sure this is pretty basic math, but my brain seems to not be working today
aha, that's what im looking for, now it makes sense. multiply by the range then add the $$anonymous$$imum. Ty
Answer by _creatio_ · Apr 21, 2015 at 02:45 PM
Almost the same as the previous answer but a bit more reliable. Your percentage value will be normalized in 0 .. 1 range with this call:
float result = Mathf.Lerp(0.5, 2.0, yourPercentage);
Answer by sid_creations · Apr 21, 2015 at 12:27 PM
float valueChange(float value,float newMin,float newMax){
return newMin + value * (newMax - newMin); }