def angle_difference(a, b):
    """ Compute angle difference (b-a) in the range of -180 deg to 180 deg.

    :param a: Angle in degrees.
    :paramtype: float

    :param b: Angle in degrees.
    :paramtype b: float:

    :returns: (b-a) in range of -180 deg to 180 deg.
    :rtype: float

    Usage:

    .. code-block:: python

        >> angle_difference(1,3)
        2
        >> angle_difference(1,358)
        -3
        
    """
    c = (b - a) % 360
    if c > 180:
       c -= 360
    return c