Math Formula - mapping large range to smaller range of numbers

Thanks ,but the formula doesn't work. I came up with a new example and tried keesa's formula.

A = 124
B = 970
X = 124 (input)

Mapped to:


C = 0
D = 100
Y = 14.66 (output)

Y output should be 0, but it comes up as 14.66.
 
standardize your input list from 0 to 1 and then multiply that by
(max_newrange-min_newrange) +min_newrange

input_list=124, 345, 654, 784, 970
std = (input_list - min(input_list)) / ( max(input_list) - min(input_list))
std *( 10-1 )+1

output_list mapped from 1 to 10
1. , 3.35106383, 6.63829787, 8.0212766 , 10.
 
Y=(X-A)/(B-A) where C,D is 0,100. Change the values of C and D and you have to solve for a system of linear equations.
 
a0=140; a1=970;
b0=0; b1=100;

y=(x-a0)/(a1-a0)*(b1-b0)+b0

for a0 < x < a1 and b0 < y <b1

if x= 140 then y= 0
if x=555 then y = 50
if x= 970 then y= 100

Edit: doesn't work yet ... 2s
Corrected

a0=140; a1=970;
b0=100; b1=200;

if x= 555 then y=150
 
Last edited:
The secret is out.
https://www.ajdesigner.com/phpinterpolation/linear_interpoolation_equation.php
upload_2020-4-15_22-6-54.png
 
Back
Top