How to find the magnitude and unit vector from a given vector