I can't figure out how to create a function that takes as input a value between 0 and 180 and returns a percentage:
For a value 1 for example : 176 return 100%
For a value 2 for example : 86 return 0%
and return a big value of percentage if the value is near value 1 for example: 176
and return a small value of percentage if the value is near value 2 for example: 86
I created the image below to simplify my problem :
Edit 1 : The input of the function is always between 0 and 180.
If the first value is $a$ and the second is $b$, you have $$f(x)=\frac {x-b}{a-b}\cdot 100\%$$