(v1, v2)
return math.acos(num / denom)
angle between two vectors v1, v2 in radians
angle between two vectors v1, v2 in radians
angle between two vectors v1 v2 in radians
def vecangle(v1, v2):
    """angle between two vectors v1, v2 in radians"""
    v0 = pt(0, 0)
        
    if np.allclose(v1, v0) or np.allclose(v2, v0):
        return np.nan
    
    if np.allclose(v1, v2):
        return 0
    
    num = np.vdot(v1, v2)
    denom = (np.linalg.norm(v1) * np.linalg.norm(v2))
    
    if np.isclose(num, denom):
        return 0
    
    return math.acos(num / denom)
def vecangle ( v1 , v2 ) : v0 = pt ( 0 , 0 ) if np . allclose ( v1 , v0 ) or np . allclose ( v2 , v0 ) : return np . nan if np . allclose ( v1 , v2 ) : return 0 num = np . vdot ( v1 , v2 ) denom = ( np . linalg . norm ( v1 ) * np . linalg . norm ( v2 ) ) if np . isclose ( num , denom ) : return 0 return math . acos ( num / denom )