def cross_product(vec1, vec2):
    """Cross product of two 2d vectors is a vector
       perpendicular to both these vectors. Return value is a
       scalar representing the magnitude and direction(towards
       positive/negative z-axis) of the cross product.
    """

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