The direction cosines of a line are in the same ratio as that of the direction ratios, but the addition of their squares must yield 1. Thus, we find the direction cosines as under:
2/√(4+1+4), 1/√(4+1+4), 2/√(4+1+4)
It can be verified that (2)² + (1)² + (2)² / (4+1+4) = 1
Thus, the direction cosines are 2/3, 1/3, 2/3