Reputation: 572
How can I add this offset to an angle and get a resulting value which should also be from -PI to PI ? Feeling a lil' stupid...
Upvotes: 0
Views: 2031
Reputation: 42748
Just use %:
%
angle = (angle + 0.2 + pi) % (2*pi) - pi
Upvotes: 1