def angleError(A,B=0.0,bound=180.0):
    """ 
    Find difference/error of A-B within range +/-bound.
    For angles in degrees, bound is +/-180 degrees
    """
    err = A-B
    while err < -bound:
        err += 2*bound
    while err > bound:
        err -= 2*bound
    return err