We are going to describe the direction of a line through the origin. I need to tell you how, starting at the origin, you walk so many steps parallel to the x-axis, then so many steps parallel to the y-axis, then so many steps parallel to the z-axis, to arrive at a point on the line distant exactly one from the origin. If I stood at that point and dropped a perpendicular on each of the axes in turn, the perpendicular would hit the axis at the point with coordinates (cosΘx,0,0), (0,cosΘy,0),(0,0,cosΘz). I need to say that Θx is the angle between the line and the x-axis, and similarly for the other angles.
If you need to walk on a line which doesn't go through the origin, then the same exercise is applied by walking from any point on the line, say (a,b,c), and the answers change to (a+cosΘx,b,c),(a,b+cosΘy,c),(a,b,c+cosΘz) which is seen by drawing a set of axes through (a,b,c) rather than the origin.