def dot_product(vec1, vec2):
    """Dot product of two vectors is a scalar that, when normalized, measures
    how colinear are the two input vectors. e.g. vec1.vec2/|vec1||vec2| = -1
    implies they are aligned exactly opposite to each other, while a value of 1
    implies that they are aligned in the same direction.
    """

    (px1, py1), (px2, py2) = vec1, vec2
    return px1 * px2 + py1 * py2