# Skew line

In geometry, two lines are said to be skew lines if they do not intersect but are not parallel.

Skew lines only exist in three or more dimensions; any two lines in the plane which are not parallel must intersect at some point. In fact, two lines are skew lines if and only if they do not lie in a single plane together. This means that if each line is defined by two points, these four points must not be coplanar; put another way, they must be the vertices of a tetrahedron of nonzero volume. Any three of them will still be coplanar, since three points define a plane, but no three points will be collinear, since this would make all four points coplanar.

The signed volume of a tetrahedron with vertices v1=(x1,y1,z1), v2=(x2,y2,z2), v3=(x3,y3,z3), and v4=(x4,y4,z4) can be found using the determinant below. Since this volume must be nonzero for the four points to define skew lines, we can identify skew lines as those satisfying:

$\displaystyle \begin{vmatrix} x_1 & y_1 & z_1 & 1 \\ x_2 & y_2 & z_2 & 1 \\ x_3 & y_3 & z_3 & 1 \\ x_4 & y_4 & z_4 & 1 \end{vmatrix} \ne 0.$

Using the definition of the cross product and dot product, we can express this as the equivalent vector inequality:

$\displaystyle (\mathbf{v}_1 - \mathbf{v}_3) \cdot [(\mathbf{v}_2 - \mathbf{v}_1) \times (\mathbf{v}_4 - \mathbf{v}_3)] \ne 0.$

Letting a=v3v1, b=v4v2 and c=v3v1, the LHS is the triple product of a, b, and c.

The distance D between two skew lines is given by:

$\displaystyle D=\sqrt{{(\mathbf{c}\cdot(\mathbf{a}\times\mathbf{b}))^2}\over{(\mathbf{a}\times\mathbf{b})^2}}$

Two randomly chosen lines will almost surely be skew lines, because given any three points defining a plane, that plane has zero volume, and so there is zero probability that a randomly-chosen fourth point will fall on it (the probability that the first three points will not define a plane is also zero). Similarly, a very small perturbation of two parallel or intersecting lines will almost surely turn them into skew lines. In this sense, skew lines are the "usual" case, and parallel or intersecting lines are special cases.