Peter Maas <peter.maas at mplusr.de> writes: > r = sqrt(x**2 + y**2) > phi = atan(y/x) Better use phi=atan2(y,x) in case x=0. Similarly for the other atan calls.