(in three dimensions)
As in two dimensions there are a number of standard formats which can be used. With the exception of the two-point form the 2-dimensional forms are not extensible to three dimensions, while the parametric and vector forms given below can be reduced to two dimensions, but are not commonly used. The following refer to the equation of the line through A (x1, y1, z1) and B (x2, y2, z2).
The condition that the general point P (x, y, z) lies on the line through AB is equivalent to requiring the direction ratios of AP = the direction ratios of AB.
If the vector is parallel to AB then the point P can be expressed in the form (x1+λl, y1+λm, z1+λn), in terms of the parameter λ.
If the vector is parallel to AB then the position vector of the point P can be expressed in the form from which the parametric form can be derived immediately. If is the position vector of the point A, and b is defined similarly, the vector form can be written as r=a+λ(b−a) or alternatively defined by (r−a)×(b−a)=0. This last form is relying on the fact that A, B, P are in a straight line, so the angle between AB and AP is zero, and therefore the vector product will be zero.