Search code examples
c#visual-studiomathwindows-phone-8.1symbolic-math

Unity mathematical Rule to deduce the value from given maximum value in C#


I know its a very silly question I am sorry for that but I wanted to know how to apply Unity Rule(Maths) in C#. I have a TotalScore variable(T) that ranges from 0-18, and I have a ring progress bar of which the values ranges from 0-360. How can I carry the following function out in C#...

if 18 = 360 degree, then 1 = 360/18 degree thus T = ? degree //where T is the TotalScore.


Solution

  • 18T = 360 degree progress

    1T = 360/18 = 20 degree progress.

    So the following one line will do..

    Progress bar = T * 20