def intersects(p1, p2, p3, p4):
    """
    Checks if the lines [p1, p2] and [p3, p4] intersect.

    :param p1, p2: line
    :param p3, p4: line
    :return: lines intersect
    """
    p0x, p0y = p1
    p1x, p1y = p2
    p2x, p2y = p3
    p3x, p3y = p4

    s10x = p1x - p0x
    s10y = p1y - p0y
    s32x = p3x - p2x
    s32y = p3y - p2y

    denom = s10x * s32y - s32x * s10y
    if denom == 0:
        return False

    denom_positive = denom > 0
    s02x = p0x - p2x
    s02y = p0y - p2y
    s_numer = s10x * s02y - s10y * s02x
    if (s_numer < 0) == denom_positive:
        return False

    t_numer = s32x * s02y - s32y * s02x
    if (t_numer < 0) == denom_positive:
        return False

    if (s_numer > denom) == denom_positive or (t_numer > denom) == denom_positive:
        return False

    t = t_numer / denom
    x = p0x + (t * s10x)
    y = p0y + (t * s10y)

    return (x, y) not in [p1, p2, p3, p4]