0
$\begingroup$

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

1 Answers 1

2

$\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.

  • 0
    Cheers, this is exactly what I'm looking for. Thanks!2011-02-15