Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say i have

N1 = -584

N2 = 110

Z = 0.64

How do i calculate from Z which value is it in range of N1..N2? Z is range from 0 to 1.

share|cite|improve this question
For example, i need to calculate where object should be placed on X axis, but i know only the percentage where it can be (0 - far left = -584, 1 = far right, +110) – Deniss Kozlovs Oct 3 '12 at 23:19
up vote 0 down vote accepted

If by $Z=0.64$ you want a number that $64\%$ of the way from $-584$ to $110,$ the expression is $-584 + 0.64(110-(-584))$

share|cite|improve this answer
Exactly! Thanks! – Deniss Kozlovs Oct 3 '12 at 23:17

We want to map numbers in the interval $[0,1]$ to numbers in your interval $[-584,110]$ by a function $fx)$ of the shape $f(x)=px+q$.

We want $f(0)=-584$, and $f(1)=110$, so $q=-584$ and $p=694$.

So our function is $694x-584$. Plug in $x=0.64$.

Remark: Exactly the same idea will work if our target interval is, say, $[a,b]$. We get $q=a$ and $p=b-a$. So the linear function $f(x)$ that maps $[0,1]$ to $[a,b]$ is given by $f(x)=(b-a)x+a$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.