Academy
Formulas/maths/3d Geometry/Line Through Two Points

Line Through Two Points

Line through P(x₁, y₁, z₁) and Q(x₂, y₂, z₂). Direction ratios are (x₂−x₁, y₂−y₁, z₂−z₁).
Derivation

For P1(x1,y1,z1)P_1(x_1, y_1, z_1) and P2(x2,y2,z2)P_2(x_2, y_2, z_2), the direction vector of the line is:

b=P1P2=(x2x1,  y2y1,  z2z1)\mathbf{b} = \overrightarrow{P_1P_2} = (x_2-x_1,\; y_2-y_1,\; z_2-z_1)

Line through P1P_1 with this direction:

xx1x2x1=yy1y2y1=zz1z2z1\frac{x-x_1}{x_2-x_1} = \frac{y-y_1}{y_2-y_1} = \frac{z-z_1}{z_2-z_1}

Parameter meaning: λ=0\lambda = 0 gives P1P_1; λ=1\lambda = 1 gives P2P_2; λ=1/2\lambda = 1/2 gives the midpoint.

Collinearity of three points AA, BB, CC: CC lies on line ABAB iff the DRs of ABAB and ACAC are proportional:

xCxAxBxA=yCyAyByA=zCzAzBzA\frac{x_C-x_A}{x_B-x_A} = \frac{y_C-y_A}{y_B-y_A} = \frac{z_C-z_A}{z_B-z_A}

Alternatively, AB×AC=0\overrightarrow{AB} \times \overrightarrow{AC} = \mathbf{0}.