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.

I have a value generated from complex circle geometry. That value is about 1 for the bottom edge of the circle and 0.2 for the top edge. I don't have the luxury of changing that variable. However, I can make an additional variable calculation from it.

I wish to apply an effect to the circle where the top edge has a value of 5 and the bottom edge has a value of 0 - see diagram to illustrate - the blue values are what I need to achieve and the red values are all I have to work with:

Calculation of reversing values

How do I make a calculation that given the top edge is 0.2 the answer is 5, and given that the bottom edge is 1 then the answer is 0 (or close enough to it). I apologise if I've not explained myself properly. The smallest number has to achieve the greatest output and the largest number has to achieve the the smallest output

share|improve this question

1 Answer 1

up vote 2 down vote accepted

$$\text{blue}=6.25(1-\text{red})$$

Plotting the three pairs $(\text{red},\text{blue})$ from your diagram shows that all three points lie on a single line. From any two points, the slope (change in blue over change in red) can be computed ($-6.25$). An equation for the line is then $\text{blue}-\text{known blue}=\text{slope}(\text{red}-\text{known red})$, where $(\text{known red},\text{known blue})$ is any one of the known points. Using $(1,0)$, $\text{blue}-0=-6.25(\text{red}-1)$, which can be rewritten as I did above.

share|improve this answer
    
Cheers, this is exactly what I'm looking for. Thanks! –  Dan Hanly Feb 15 '11 at 15:55

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.