Line–line intersection
Given two points on each line

First we consider the intersection of two lines L and L in two-dimensional space, with line L being defined by two distinct points (x, y) and (x, y), and line L being defined by two distinct points (x, y) and (x, y).

The intersection P of line L and L can be defined using determinants.

The determinants can be written out as:

When the two lines are parallel or coincident, the denominator is zero.
detectable_format:json_format, length_constraints:number_words[450]