Next / Previous / Contents / Shipman's homepage

7.2. Pt.xy(): Convert to Cartesian coordinates

The .xy() method converts homogeneous coordinates back to Cartesian coordinates by dividing the first two by the third (W) value.

homcoord.py
# - - -   P t . x y

    def xy(self):
        '''Return (x,y)
        '''
        w = self.v[2]
        return (self.v[0]/w, self.v[1]/w)