Looking to get the inverse of this function

55 Views Asked by At

So I'm trying to get the inverse of this function. So a little context.. I have a score that can range from 0-100. When the score is 100 I'm looking for an output of 255 - for one value and with the same 100 score to get a value of 0 using its inverse function

255 and 0 are the targets because I'm dealing with RGB values. So when the score is 100 I need a function that will yield both 0 and 255 to both Red and Green respectively.

So so far this is what I've come up with:

100(x) = 255

So x would be 2.5. I'll set the Green value to be 2.5. Cool

But I'm struggling trying to find out what the value for the red would be.

I think the inverse function would be:

y = 100x - 255

1

There are 1 best solutions below

2
On BEST ANSWER

Try finding the line which goes through $(100,255)$ and $(0,100)$. Here each point will correspond to “When the score is $100$…output of $225$” and “same score 100 to get a value of 0 using its inverse”. Here is graphical proof.

Using slope intercept form, just like the name implies, one sets up the line as follows:

$$y=\frac{255-100}{100-0}x+100=\frac54x+100$$ For the inverse:

$$x=\frac45(y-100)=\frac45x-80\implies y=\frac45x-80$$.

This final result gets the line. It this what you meant? Please correct me and give me feedback!

-I will add more if this is the result you wanted.