Let a,b and c be direction ratios of a line and I,m and n be the direction cosines (DC's) of the line.
Then, al=bm=cn=k (say), k being a constant.
Therefore, I=ak,m=bk,n=ck...(i)
But l2+m2+n2=1
Therefore, k2(a2+b2+c2)=1
or k=±a2+b2+c21
Hence, from Eq. (i), the DC's of the line are I=±a2+b2+c2a,m=±a2+b2+c2b, n=±a2+b2+c2c
where, depending on the desired sign of k, either a positive or a negative sign is to be taken for l,m and n.