-í
A²Ş<c       sj   d  Z  d k Z d   Z d d d  Z e d d  Z d d d  Z d d d  Z d	   Z d
   Z	 d S(   s  A module that should help create the affine transformations you would use
for transforming GnomeCanvas items.

As a little background, an affine transformation is a linear transformation
and a translation.  The linear transformationcan be represented by a matrix
and the translation by a vector.  So a general affine transformation looks
like this:
   [ x ] -> [ a b ][ x ] + [ e ]
   [ y ]    [ c d ][ y ]   [ f ]

As you can see, the affine transformation is defined by the six numbers in
the matrix and column vector.  For the GnomeCanvas item functions, affine
transformations are represented by a flat sequence of the form
  (a, c, b, d, e, f)
  
This module attempts to make it easy to create complex affine transformations
from simpler ones like rotation, scaling and translation.
Nc      s   d d d d d d f Sd S(   s"   The identity affine transformationi   i    N(    (    (    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   identity s     i   c    s   |  d d | d d f Sd S(   s@   Scale by a factor of sx in the X direction and sy in Y directioni    N(   s   sxs   sy(   s   sxs   sy(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   scale s     i    c    sV   |  o | t i d }  n t i |   } t i |   } | | | | d d f Sd S(   s#   Rotate in either degrees or radiansf180.0i    N(   s   radianss   degreess   maths   pis   sins   ss   coss   c(   s   radianss   degreess   cs   s(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   rotate! s      c    s   d | |  d d d f Sd S(   s>   Creates a shear transformation in either X and/or Y directoioni   i    N(   s   yshears   xshear(   s   xshears   yshear(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   shear( s     c    s   d d d d |  | f Sd S(   s   Translate by (tx,ty)i   i    N(   s   txs   ty(   s   txs   ty(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys	   translate, s     c  	  sö   | f  j o |  Sn t t |  } |  d | d |  d | d |  d | d |  d | d |  d | d |  d | d |  d | d |  d | d |  d | d |  d | d |  d |  d | d |  d | d |  d f Sd S(   s£   Compose a number of affine transformations together

	If the affines a1,a2,a3 are passed as arguments, then the resulting
	affine A will give A(x) == a1(a2(a3(x)))i    i   i   i   i   i   N(   s   affiness   a1s   applys   composes   a2(   s   a1s   affiness   a2(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   compose4 s
      c  	  s˘   d |  d |  d |  d |  d } |  d | |  d | |  d | |  d | |  d |  d |  d |  d | |  d |  d |  d |  d | f Sd  S(   Ni   i    i   i   i   i   (   s   affs   det_inv(   s   affs   det_inv(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   invertB s    &(
   s   __doc__s   maths   identitys   scales   Nones   rotates   shears	   translates   composes   invert(   s   composes   scales   identitys   inverts	   translates   rotates   shears   math(    (    s0   /usr/lib/python2.2/site-packages/gnome/affine.pys   ? s   			