def line_intersection(line1, line2):
    """
    finds the intersection point of two straight lines
    from: https://stackoverflow.com/questions/20677795/how-do-i-compute-the-intersection-point-of-two-lines-in-python
    by: @paul-draper
    :param line1: 2 point defining a line
    :type line1: tuple
    :param line2: 2 point defining a line
    :type line2: tuple
    :return: x & y coordinates of the intersection point of the two given lines
    :rtype: tuple
    """
    xdiff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0])
    ydiff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1])

    def det(a, b):
        return a[0] * b[1] - a[1] * b[0]

    div = det(xdiff, ydiff)
    if div == 0:
        raise Exception('lines do not intersect')

    d = (det(*line1), det(*line2))
    x = det(d, xdiff) / div
    y = det(d, ydiff) / div
    return x, y