function vec = dotnorm(vec); vec = (1/sqrt(sum(vec.*vec)))*vec;