#C13680. Intersection of Two Lines
Intersection of Two Lines
Intersection of Two Lines
Given two lines on a two-dimensional plane, each defined by two distinct points, your task is to compute their intersection point.
The line through points \((x_1,y_1)\) and \((x_2,y_2)\) and the line through \((x_3,y_3)\) and \((x_4,y_4)\) can be represented by their general equations. Their intersection is determined by computing the determinant:
$$\text{denom} = (x_1 - x_2)(y_3 - y_4) - (y_1 - y_2)(x_3 - x_4)$$
If \(\text{denom} = 0\), then the lines are either parallel (and do not intersect) or coincident (overlap entirely). In the case of a coincident lines, output The lines are coincident, otherwise output None. For non-zero \(\text{denom}\), compute the intersection point using the line equations and output the coordinates as two space-separated numbers.
inputFormat
The input consists of two lines from standard input. The first line contains four space-separated floating-point numbers: x1 y1 x2 y2 (the coordinates defining the first line). The second line contains four space-separated floating-point numbers: x3 y3 x4 y4 (the coordinates defining the second line).
outputFormat
If the two lines intersect at a single point, output the x and y coordinates separated by a space. If the lines are coincident, output "The lines are coincident". If the lines are parallel but do not intersect, output "None".
## sample0 0 1 1
0 1 1 2
None
</p>