Originally Posted by Vrul
Based off your intended use your values should not exceed the +/-90 degree range, so if your array contained -7 instead of 353 it would work just fine. That pushes the problem boundary to the 180 degree area where your values should never realistically be. You're not taking full advantage of the available ways to store what you have and are trying to create a needlessly complex system to compensate for it.
|
Ok. Let me see if I understand what you mean.
Lets assume
14, 6, 340 again.
The calculated value should be
357 .
You are saying I should use
14, 6, -20 instead.
The calculated value should be
-3.
Resike's code
Code:
degrees[i] = (degrees[i - 1] + degrees[i + 1]) / 2
translates into
(14 + -20) / 2 = -3
Which is the desired result.
Well. That is simple. Even if it does not use the values I've posted below. Thank you for pushing me into this direction.