Next / Previous / Contents / Shipman's homepage

8.10. Xform.angle(): Net rotation of the transform

To find out how much this transform rotates, we transform point (1,0), which lies at 0°, and then measure the angle from the origin to the transformed point.

homcoord.py
# - - -   X f o r m . a n g l e

    def angle(self):
        '''Return the net rotation 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.__angle