1
$\begingroup$

I have several numbers, say 3, 1, 4, 8, 5, and I wanted them to be mapped into a fixed domain [0.5, 3]. In this case, 1 should be mapped as 0.5 and 8 is 3. Then the rest numbers should be scaled down to their correspondences.

So, my question is what should I do to deal with this case? what's the name of this processing?

Thanks, Mike

1 Answers 1

2

Suppose you have $I=[a,b]$ and you want to map it to $J=[c,d]$ such that there is a constant C and for every $x,y \in I$ and their images $f(x),f(y)\in J$ you have $(x-y)C = (f(x)-f(y))$ (I hope this is what you mean by "scaled down...").

You also want that $a\mapsto c$ and $b\mapsto d$ (in your case $1\mapsto 0.5,\; 8 \mapsto 3$), then you see that the constant is $\frac{c-d}{a-b}$. Now, for every other $x\in I$ you have (with y=a) $ f(x) = C(x-a) + f(a) = Cx +(f(a)-Ca) $

  • 0
    Thanks so much @Prometheus. Actually, I need a proportion to scale the elements in set A(3, 1, 4, 8, 5) to domain B[0.5, 3]. Your answer inspired me a lot as the way to calculate the proportion is same as the Constant you mentioned.2011-02-05