• 15
• 15
• 11
• 9
• 10

# arranging the hud degrees

This topic is 3762 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hi there guys this may be a simple problem some of you have done before i am trying to get the angles correct for my hud, it is just a round dial with a needle that shows the speed i am going , the speed is calculated from a 0 - 1 range the initial 0 position is 178 degrees the end 1 position is 110 degrees so there is a 68 degree difference from start to end. how can a work out the current angle needed if say fuel was 0.5?

##### Share on other sites
Linear interpolation: w = u + (1 - t) * (v - u)
where
w = the angle representing the current speed
u = the angle representing the minimum speed
v = the angle representing the maximum speed
t = the current speed on a normalized 0 - 1 scale

So for a [178, 110] angular range and a current speed of 0.5:
w = 178 + (1 - 0.5) * (110 - 178)  = 178 + 0.5 * -68  = 178 - 34  = 144