How Do You Map a Range of Values to a Smaller Scale?

  • Thread starter Thread starter jla2125
  • Start date Start date
  • Tags Tags
    Mapping
AI Thread Summary
To map a range of values from 182 to 455 onto a smaller scale of 1 to 50, a linear function can be used. The equation f(x) = 1 + 49*(x-182)/(455-182) effectively transforms the input values. An alternative formula, f(n) = x1 + (x2 - x1)*(n - y1)/(y2 - y1), is also applicable for similar mappings, where x1 and x2 are the new range limits and y1 and y2 are the original range limits. This approach can be adapted for various ranges as long as the parameters are correctly defined. The discussion confirms that the linear mapping method is versatile for different value ranges.
jla2125
Messages
16
Reaction score
0
Hey! I have a really easy question here, but I still can't figure it out.

I have a range of values from 182 to 455. I need a function that gives me back values from 1-50. IE, f(318) = 25. The numbers aren't critical, but I'd love a general equation to use for this kinda stuff. Can anybody help me out?

Thanks,
~Jeremy
 
Mathematics news on Phys.org
The simplest equation would be linear.

f(x)=1 + 49*(x-182)/(455-182)

There are obvious many other possibilities depending on the information you have.
 
will that form work for just about anything?

IE:
given: 1 = x1, 50 = x2, 182 = y1, 455 = y2:
f(n) = x1 + (x2 - 1)*(n - y1)/(y2 - y1)
 
jla2125 said:
will that form work for just about anything?

IE:
given: 1 = x1, 50 = x2, 182 = y1, 455 = y2:
f(n) = x1 + (x2 - 1)*(n - y1)/(y2 - y1)

Yes: after fixing typo - should have (x2-x1)
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top