themaster
themaster

Reputation: 375

convert degree within a range

I'm trying to work out how I can convert an angle to a number range.

for example if I have a max value of 38 and a min value of 10 and I want to convert that angle between the min and max.

Any idea how I would go about that?

Thanks

Upvotes: 0

Views: 997

Answers (1)

Pransh Tiwari
Pransh Tiwari

Reputation: 4182

I assume you want to convert degrees (d) whose range varies from (0 - 360), to a number range (a1 - b1). Suppose rng = b1 - a1, so the value of the number, say x is a1 + (d * rng) / 360.

If any doubts please comment.

Upvotes: 2

Related Questions