The direction cosines of a vector, #vecv#, are:
#alpha = (vecv*hati)/(|vecv|)#
#beta = (vecv*hatj)/(|vecv|)#
#gamma = (vecv*hatk)/(|vecv|)#
Compute the magnitude of #vecv#:
#|vecv| = sqrt(3^2+ (-4)^2+5^2)#
#|vecv| = 5sqrt2#
#alpha = ((3hati-4hatj+5hatk)*hati)/(5sqrt2)#
#alpha = 3sqrt2/10#
Similarly
#beta = -4sqrt2/10 = -2sqrt2/5#
and
#gamma = 5sqrt2/10 = sqrt2/2#
These are the same as the coordinates of the head of the unit vector of #vecv# with the tail placed at the origin:
#hatv = (3sqrt2/10, -2sqrt2/5, sqrt2/2)#