Convert complex numbers between rectangular and polar form