Math formulas and cheat sheets for Lines in three dimensions

Lines in three dimensions

Line forms

Point direction form:

xx1a=yy1b=zz1c

Two point form:

xx1x2x1=yy1y2y1=zz1z2z1

Parametric form:

xyz=x1+tcosα=y1+tcosβ=z1+tcosγ

Distance between two lines in 3 dimensions

The distance from P2(x2,y2,z2) to the line through P1(x1,y1,z1) in the direction (a,b,c) is

d=[c(y2y1)b(z2z1)]2+[a(z2z1)c(x2x1)]2+[b(x2x1)a(y2y1)]2a2+b2+c2

The distance between two lines. First one through P1(x1,y1,z1) in direction (a1,b1,c1), Second one: through P2(x2,y2,z2) in direction (a2,b2,c2) is:

d=x2x1a1a2y2y1b1b2z2z1c1c2b1b2c1c22+c1c2a1a22+a1a2b1b22

The two lines intersect if:

x2x1a1a2y2y1b1b2z2z1c1c2=0