def cross_v2 ( vec1 , vec2 ) : return vec1 . y * vec2 . x - vec1 . x * vec2 . y
python cosine similarity of two vectors
Return the crossproduct of the two vectors as a Vec2 . Cross product doesn t really make sense in 2D but return the Z component of the 3d result .
def cross_v2(vec1, vec2):
    """Return the crossproduct of the two vectors as a Vec2.
    Cross product doesn't really make sense in 2D, but return the Z component
    of the 3d result.
    """

    return vec1.y * vec2.x - vec1.x * vec2.y