Angle between two straight lines

In the space, two straight lines can coincide, can be parallels, secants or intersect. The angles that they form are defined in a different way in every case. We will say:

  • If two straight lines coincide or are parallel they form an angle of 0.
  • If two straight lines are secant, they determine four angles that are equal in pairs. The smallest angle will be said to be the angle between the lines.
  • If two straight lines cross, the angle between them is the smallest of the angles that is formed by the parallel to one of the lines that intersects the other one.

Therefore, as on the plane, the cosine of the angle α will coincide (except maybe the sign) with the angle formed by the governing vectors of the straight line. Therefore,

cos(r s^)=cosα=|cos(u v^)|=|uv|u||v||=|uv||u||v|

where u and v governing vectors of the straight lines r and s.

Therefore,

α=arccos(|uv||u||v|)α[0,π2]

Finally, if u=(u1,u2,u3) and v=(v1,v2,v3), the expression - given in components - of the previous formula is:

cos(α)=|u1v1+u2v2+u3v3|u12+u22+u32v12+v22+v32

Example

Compute the angle between the following lines: r:x+25=y12=z and s:{x+y+2z=3xyz=1

First of all we must look for the governing vector of r and s:

  • A governing vector of r is u=(5,2,1).
  • To find a governing vector of s, we choose z as a parameter and solve the equations system using Cramer, obtaining:

s:{x=212ky=132kz=k

and therefore a governing vector of s is u=(1,3,2).

Now we can already apply the formula previously described:

cos(α)=|u1v1+u2v2+u3v3|u12+u22+u32v12+v22+v32=|51+23+1(2)|52+22+1212+32+(2)2=93014=0.439

Therefore,

α=arccos(0.439)=63,95