directions cosines for a vector in 3D