Consider a vector as shown below on the x-y-z plane. The angles made by this line with the +ve direactions of the coordinate axes: θx, θy, and θz are used to find the direction cosines of the line: cos θx, cos θy, and cos θz. Likewise, the direction cosine of θx, θy, and θz in the opposite direction of the line are –cos θx, -cos θy, and -cos θz
Note that the angles θx, θy, and θz are the direction angles that satisfy the condition: 0<θx, θy,θz<π. Also, the sum of direction angles: θx + θy + θz≠ 2π because these angles do not lie on the same plane.
For a line on the x-axis, the direction cosines are cos 0, cos π/2, cos π/2 = 1, 0, 0.
For a line on the y-axis, the direction cosines are cos π/2, cos 0, cos π/2 = 0, 1, 0.
For a line on the x-axis, the direction cosines are cos π/2, cos π/2,cos 0 =0, 0, 1.
Consider a point P (x, y, z) on a 3D plane such that OP = →r and let l, m and n be the direction cosine of →r then we can conclude that: x=l→r, y=m→r, and z=n→r.
Hence,
l=x→r=x√x2+y2+z2
m=y→r=y√x2+y2+z2
n=z→r=z√x2+y2+z2
The equation of the line can be written as: l2+m2+n2=1
Proof:
We know that l = cosθx, m = cosθy, and n = cosθz
And, cos2θx + cos2θy + cos2θz = 1
cos2θx + cos2θy + cos2θz= (x→r)2+(y→r)2+(z→r)2=x2+y2+y2r2=r2r2=1
Now consider two points in a line segment →AB, with the coordinates A (x1, y1, z1) and B (x2, y2, z2). Then, their direction cosines can be written a(x2−x1→r,y2−y1→r,z2−z1→r).
In this case, →|r|=√(x2−x1)2+(y2−y1)2+(z2−z1)2
Example: A line makes 30°, 60° and 90° with the x, y and z axes respectively. Find their direction cosines.
Solution:
l = cosθx = cos 30° = √32
m = cosθy = cos 60° = 12
and n = cosθz= cos 90° = 0
The direction cosines are: (√32,12,0)
Example: Consider a point P (√3,1,2√3) in a 3D space, find the direction cosines of →OP
Solution: The direction ratios of point P= (√3,1,2√3)
Recall that l=x→r=x√x2+y2+z2
m=y→r=y√x2+y2+z2
n=z→r=z√x2+y2+z2
In this case, →r=→OP and (x, y, z) = (√3,1,2√3)
|→OP|=√(√3−0)2+(1−0)2+(2√3−0)2=√3+1+12=4
The direction cosine of →OP are: (√34,14,2√34)=(√34,14,√32)