The intersection of two lines and
in two dimensions with,
containing the points
and
, and
containing the points
and
, is given by
(1) | |||
(2) |
where denotes a determinant. This corresponds to simultaneously solving
(3) | |||
(4) |
for and
. Other treatments are given by Antonio (1992) and Hill (1994).
The intersections of two lines given in trilinear coordinates as
(5) | |||
(6) |
is
(7) |
Pseudocode for segment intersection is given by de Berg et al. (2000).
Three lines in trilinear coordinates
(8) | |||
(9) | |||
(10) |
concur if their trilinear coordinates satisfy
(11) |
in which case the point is
(12) |
Three lines in Cartesian coordinates concur if the coefficients of the lines
(13) | |||
(14) | |||
(15) |
satisfy
(16) |
In three dimensions, the algebra becomes more complicated. The intersection of two lines containing the points and
, and
and
, respectively, can also be found directly by simultaneously solving
(17) | |||
(18) |
together with the condition that the four points be coplanar (i.e., the lines are not skew),
(19) |
for , eliminating
and
. This set of equations can be solved for
to yield
(20) |
where
(21) | |||
(22) | |||
(23) |
(Hill 1994).
The point of intersection can then be immediately found by plugging back in for to obtain
(24) |
A slightly more symmetrical and concise form can obtained by additionally defining
(25) | |||
(26) | |||
(27) |
where denotes a unit vector, then
(28) |
(Goldman 1990).