Next / Previous / Contents / Shipman's homepage

8.6. Xform.__str__()

This method displays what the transform does; it can be useful in program checkout. To see the effects of the transform, we apply to coordinates (0,0) and (1,1) and report the transformed values.

homcoord.py
# - - -   X f o r m . _ _ s t r _ _

    def __str__(self):
        '''Display self as a string
        '''
        #-- 1 --
        return ( "<Xform(xlate(%s), rotate(%.1fdeg), "
                 "mag(%.1f)>" %
                 (self.offset(), num.degrees(self.angle()), self.mag()) )