Calculating the phase and magnitude in polar co-ordinates