image
Physics Forums Logo
image
image
* Register * Upgrade Blogs Library Staff Rules Mark Forums Read
image
image   image
image

image range mapping Share It Thread Tools Search this Thread image
Old Jun26-09, 06:57 PM                  #1
jla2125

jla2125 is Offline:
Posts: 6
range mapping

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
  Reply With Quote
Old Jun26-09, 07:54 PM                  #2
mathman
 
mathman's Avatar

mathman is Offline:
Posts: 2,439
Recognitions:
Science Advisor Science Advisor
Re: range mapping

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.
  Reply With Quote
Old Jun26-09, 08:48 PM                  #3
jla2125

jla2125 is Offline:
Posts: 6
Re: range mapping

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)
  Reply With Quote
Old Jun27-09, 07:03 PM                  #4
mathman
 
mathman's Avatar

mathman is Offline:
Posts: 2,439
Recognitions:
Science Advisor Science Advisor
Re: range mapping

Originally Posted by jla2125 View Post
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)
  Reply With Quote
image image
Reply
Thread Tools


Similar Threads for: range mapping
Thread Thread Starter Forum Replies Last Post
mapping 0207 General Physics 0 Jun21-09 07:57 AM
Linear mapping. affans Calculus & Beyond 2 May27-09 06:37 AM
Conformal Mapping latentcorpse Calculus & Beyond 3 Mar22-09 08:00 PM
Another mapping question pivoxa15 Calculus & Beyond 3 May13-07 07:46 AM
mapping? pivoxa15 Calculus & Beyond 8 May8-07 08:29 AM

Powered by vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. © 2009 Physics Forums
Sciam | physorgPhysorg.com Science News Partner
image
image   image