Next / Previous / Contents / Shipman's homepage

13.2. Polar.toCartesian(): Convert to rectangular coordinates

homcoord.py
# - - -   P o l a r . t o C a r t e s i a n

    def toCartesian(self):
        '''Return self in rectangular coordinates as a Pt instance.
        '''
        return Pt(self.r * num.cos(self.theta),
                  self.r * num.sin(self.theta))