1
$\begingroup$

I'm working on an Android component which is a circular component. It represents a specific range of weight. My math knowledge is very limited. I would like to convert angle in this specifica range. For example, angles comes from 0 to 360. And my scale is from 45 to 100. How can I convert angle values considering my scale?

  • 0
    Including 45 and 100?2017-01-06
  • 0
    For linear scaling use $45+\frac{\theta}{360}(100-45)$2017-01-06
  • 0
    @KanwaljitSingh Yes2017-01-06
  • 0
    @user1131274 THANK YOU2017-01-06

2 Answers 2

0

If your value is 0. So on scale must be 45.

For angle 360 on scale 100.

We have already 45 + 55 * $\frac{\text{angle}}{360}$

  • 0
    Exactly what I looking for.2017-01-06
0

You want to find constants, $a$ and $b$, so that the function $f(x) = ax + b$ has the properties $f(0) = 45$ and $f(360) = 100$:

\begin{align} f(0) &= 45 \\ a \cdot 0 + b &= 45 \\ b &= 45 \\ \hline f(360) &= 100 \\ a \cdot 360 + b &= 100 \\ 360a + b &= 100\\ \hline 360a + 45 &= 100 \\ 360a &= 55 \\ a &= \dfrac{55}{360} \\ a &= \dfrac{11}{72} \\ \hline f(x) &= \dfrac{11}{72}x + 45 \end{align}