To pin down a line in space, you need just two things: one point on it and the direction it runs in. So we start by learning to describe a direction, using direction cosines and direction ratios. Then we write the equation of a line in vector and Cartesian form, and finally we work out the angle between two lines.
If a line makes angles α,β,γ with the axes, its direction cosines are l=cosα, m=cosβ, n=cosγ, with l2+m2+n2=1. Any numbers a,b,c in the same proportion are called direction ratios, and you can get back to the cosines using l=±a2+b2+c2a, etc.
The angles a line makes with the three axes give its direction cosines.
The line through P(x1,y1,z1) and Q(x2,y2,z2) has direction ratios x2−x1,y2−y1,z2−z1. Just subtract the coordinates.
Example 1. For the line through (2,−1,3) and (4,1,2), the ratios are 2,2,−1 and the cosines are 32,32,−31.
Example 2.A(3,0,1), B(5,2,4), C(9,6,10): ratios of AB are 2,2,3 and of BC are 4,4,6, and these are proportional, so the three points lie on one line.
AB and BC have proportional direction ratios, so A, B and C lie on one line.
The line through the point with position vector a, running parallel to b, is
r=a+λb.
In Cartesian form, the line through (x1,y1,z1) with direction ratios a,b,c is
ax−x1=by−y1=cz−z1.
If you are given two points instead, simply take b=a2−a1.
Example 3. The line through (1,−2,4) parallel to 3i^+j^−2k^ is r=i^−2j^+4k^+λ(3i^+j^−2k^), or in Cartesian form 3x−1=1y+2=−2z−4.
Example 4. The Cartesian line 62x−4=2y+1=33−z is not in standard form yet, and that is a common trap. Rewrite it first as 3x−2=2y+1=−3z−3. Now you can read off the point (2,−1,3) and the ratios 3,2,−3.
Two special cases are worth remembering. The lines are perpendicular when a1a2+b1b2+c1c2=0, and parallel when their ratios are proportional.
Example 5. Take lines with ratios 1,2,2 and 2,−2,1: cosθ=9∣2−4+2∣=0, so they are perpendicular.
Example 6. For ratios 3,4,0 and 0,3,4 we get cosθ=2512.