def Intersection(S1x, S1y, D1x, D1y, S2x, S2y, D2x, D2y):
    """
    Find intersection of 2 line segments
    :param S1x: x coordinate of segment 1's start point
    :param S1y: y coordinate of segment 1's start point
    :param D1x: x coordinate of segment 1's end point
    :param D1y: y coordinate of segment 1's end point
    :param S2x: x coordinate of segment 2's start point
    :param S2y: y coordinate of segment 2's start point
    :param D2x: x coordinate of segment 2's end point
    :param D2y: y coordinate of segment 2's end point
    :return: Intersection point [x,y]
    """
    if ((D1y - S1y) * (S2x - D2x) - (D2y - S2y) * (S1x - D1x)) == 0:
        return [None, None]
    else:
        x = ((S2x - D2x) * (((D1y - S1y) * (S1x) + (S1x - D1x) * (S1y))) - (S1x - D1x) * ((D2y - S2y) * (S2x) + (S2x - D2x) * (S2y))) / ((D1y - S1y) * (S2x - D2x) - (D2y - S2y) * (S1x - D1x))
        y = ((D1y - S1y) * ((D2y - S2y) * (S2x) + (S2x - D2x) * (S2y)) - (D2y - S2y) * (((D1y - S1y) * (S1x) + (S1x - D1x) * (S1y)))) / ((D1y - S1y) * (S2x - D2x) - (D2y - S2y) * (S1x - D1x))
        return [x,y]