code: def _wrap_angle(self, theta):
          
          result = ((theta + pi) % (2*pi)) - pi
          if result == -pi: result = pi
          return result
docs: Helper method: Wrap any angle to lie between -pi and pi
  
          Odd multiples of pi are wrapped to +pi (as opposed to -pi)