Next / Previous / Contents / Shipman's homepage

7.8. Pt.toPolar(): Convert to polar coordinates

homcoord.py
# - - -   P t . t o P o l a r

    def toPolar(self):
        '''Convert to polar coordinates.
        '''
        x, y = self.xy()
        return Polar(num.sqrt(x*x + y*y), num.arctan2(y, x))