Next / Previous / Contents / Shipman's homepage

8.9. Xform.offset(): Net translation of the transform

To compute the total translation that this transform achieves, we transform the origin to see how far it moved.

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

    def offset(self):
        '''Return the net translation of this transform.
        '''
        #-- 1 --
        # [ if self.__offset is None ->
        #     self.__offset  :=  net translation of self
        #     self.__angle  :=  net rotation of self
        #     self.__mag  :=  net uniform scaling of self
        #   else -> I ]
        self.__analyze()

        #-- 2 --
        return self.__offset