# Mapping and Interpolation

Does Mathematica have a mapping function like scipy or any of the multidimensional ones?

By this I mean something like mapping $[1,100]$ onto $[7,20]$ for example.

Looking at Interpolate I only see interpolation with regards to estimating a line given points.

To make it more clear I mean a simple example using a linear mapping would be $[0,512]$ onto $[0,10]$ would give 5 for a value of 256.

1. What would make the question more clear? An example would be reading in a sensor that gives values on $[0,256]$ and using those to operate say a servo which accepts values on $[0,10]$

2. in this scale that is exactly what I'm looking for! thanks. Is it possible to use mappings of other orders, ex. a normal distribution or a quadratic mapping? This being a linear mapping. –

• I don't understand what your asking for. – rcollyer Apr 10 '12 at 1:13
• Do you mean splines? reference.wolfram.com/mathematica/guide/Splines.html – Vitaliy Kaurov Apr 10 '12 at 1:55
• Are you looking for Rescale[256, {0,512}, {0,10}] (==> 5)? – Brett Champion Apr 10 '12 at 2:22
• @BrettChampion in this scale that is exactly what I'm looking for! thanks. Is it possible to use mappings of other orders, ex. a normal distribution or a quadratic mapping? This being a linear mapping. – Eiyrioü von Kauyf Apr 10 '12 at 2:25
• The reason why your question was unclear is that you mention interpolation when you need a linear transformation (they're unrelated) and that originally you didn't say at all that you need a linear transformation. There are of course infinitely many (non-linear) mappings from interval $[a,b]$ to interval $[c,d]$. – Szabolcs Apr 10 '12 at 6:57

Your question isn't very clear, but I think you need the Rescale function, especially its 3 argument form:
Rescale[#, {1, 100}, {7, 20}] & /@ Range[1, 100, 5] // N

• @EiyrioüvonKauyf Then Rescale is exactly what you want. You should also look into Clip to use along with this if you don't want to give out of bound values to your servo. – rm -rf Apr 10 '12 at 2:59