determining the magnitude and angle of a vector