Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
1  
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
add comment

2 Answers 2

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|improve this answer
    
Exactly! Thanks! –  Deniss Kozlovs Oct 3 '12 at 23:17
add comment

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|improve this answer
add comment

Your Answer

 
discard

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.