# arranging the hud degrees

This topic is 3972 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

1. 1
Rutin
30
2. 2
3. 3
4. 4
5. 5

• 13
• 13
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632961
• Total Posts
3009494
• ### Who's Online (See full list)

There are no registered users currently online

×