Check out example codes for "scale between tow ranges c#". It will help you in understanding the concepts better.

Code Example 1

public float scale(float OldMin, float OldMax, float NewMin, float NewMax, float OldValue){
 
    float OldRange = (OldMax - OldMin);
    float NewRange = (NewMax - NewMin);
    float NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin;
 
    return(NewValue);
}

Learn ReactJs, React Native from akashmittal.com