On 01/12/2015 07:54 AM, Peter P. wrote:
Hi list,
I am trying to calculate the change of angles I do get from a sensor as degrees between -180° and 180 by subtracting subsequent values.
As the jump from -180 to 180 would cause a jump here,
why? -180 and +180 are equivalent. the only problem you might have is, if you interpolating between say -179 and +179 (which might go through 0 rather than 180)
what i usually do in such cases is to check whether the difference is
180° and if so, apply wrapping, so that i always interpolate on the
shortest path.
see attached abstraction
gfdsar IOhannes