def smallest_signed_angle ( source , target ) : dth = target - source dth = ( dth + np . pi ) % ( 2.0 * np . pi ) - np . pi return dth
signed angle between two vectors python
Find the smallest angle going from angle source to angle target .
def smallest_signed_angle(source, target):
    """Find the smallest angle going from angle `source` to angle `target`."""
    dth = target - source
    dth = (dth + np.pi) % (2.0 * np.pi) - np.pi
    return dth