1
$\begingroup$

I have a float that goes from 1 to 0 .Im trying to make it so that the order is reversed and scaled so it goes from 0 to -80

Just wondering if there is a straight forward way to do this?

$\endgroup$

1 Answer 1

5
$\begingroup$

Say that your value is $x$ in a value between 1 and 0. We can reverse the order by taking $1-x$ instead.

Multiply this by $-80$ to get a number from 0 to -80.

In other words:

$$(1-x) \cdot (-80)$$ is in the from 0 to -80.

(The expression can be simplified as $(x-1) \cdot 80$)

$\endgroup$
2
  • $\begingroup$ Brilliant thank you, worked perfectly :) $\endgroup$
    – Ke.
    Mar 17, 2014 at 19:13
  • $\begingroup$ @Ke. You're welcome, please mark the answer as accepted if you are satisified with it. $\endgroup$
    – naslundx
    Mar 18, 2014 at 0:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .