title: Affine transformation not composing with translation as expected
body: <p>Well, the title isn't completely accurate. The transformation I am dealing with is a perspective transformation that can be very well approximated as an affine transformation--yet it doesn't produce results close to what I'd expect of an affine transformation, and even when I <em>do</em> use a pure affine transformation the results are still modify the translation part of the transformation in unexpected ways.</p>
  
  <p>I start with <code>numpy</code> arrays, representing transformation matrices, as follows:</p>
  
  <pre><code>transformation = np.array([[.5, .1, 40],
                             [.06, -.18, 725],
                             [.00003, .00001, 1]])
  
  real_affine= np.array([[.5, .1, 40],
                         [.06, -.18, 725],
                         [0, 0, 1]])
  
  translation = np.array([[1, 0, 0],
                          [0, 1, 50],
                          [0, 0, 1]])
  </code></pre>
  
  <p>Then I compose them, expecting to get (at least approximately) this as a result for <code>transformation.dot(translation)</code>:</p>
  
  <pre><code>np.array([[.5, .1, 40],
            [.06, -.18, 775],
            [.00003, .00001, 1]])
  </code></pre>
  
  <p>and this one for <code>real_affine.dot(translation)</code>:</p>
  
  <pre><code>np.array([[.5, .1, 40],
            [.06, -.18, 775],
            [0, 0, 1]])
  </code></pre>
  
  <p>That is, the same exact transformation with the y translation value modified. Instead, I get this:</p>
  
  <pre><code>&gt;&gt;&gt; transformation.dot(translation)
  array([[  5.00000000e-01,   1.00000000e-01,   4.50000000e+01],
         [  6.00000000e-02,  -1.80000000e-01,   7.16000000e+02],
         [  3.00000000e-05,   1.00000000e-05,   1.00050000e+00]])
  
  &gt;&gt;&gt; real_affine.dot(translation)
  array([[  5.00000000e-01,   1.00000000e-01,   4.50000000e+01],
         [  6.00000000e-02,  -1.80000000e-01,   7.16000000e+02],
         [  0.00000000e+00,   0.00000000e+00,   1.00000000e+00]])
  </code></pre>
  
  <p>What's going on here? It is the same exact transformation (aside from the translation) but the translation values are out of whack with what I'd expect. </p>
  
  <p>Apologies for my ignorance, I've never formally studied matrices or transformations. The answer may well be extremely obvious.</p>