title: Image rotation about an arbitrary point
body: <p>I was asked to perform an image rotation about an arbitrary point. The framework they provided was in matlab so I had to fill a function called <code>MakeTransformMat</code> that receives the angle of rotation and the point where we want to rotate.</p>
  
  <p>As I've seen in class to do this rotation first we translate the point to the origin, then we rotate and finally we translate back.</p>
  
  <p>The framework asks me to return a Transformation Matrix. Am I right to build that matrix as the multiplication of the translate-rotate-translate matrices? otherwise, what am I forgetting?</p>
  
  <pre><code>function TransformMat = MakeTransformMat(theta,center_y,center_x) 
  
  %Translate image to origin
  trans2orig = [1 0 -center_x;
                0 1 -center_y;
                0 0 1];
  %Rotate image theta degrees
  rotation = [cos(theta) -sin(theta) 0;
              sin(theta) cos(theta)  0;
              0          0           1];
  %Translate back to point
  trans2pos = [1 0 center_x;
               0 1 center_y;
               0 0 1];
  
  TransformMat = trans2orig * rotation * trans2pos;
  
  end
  </code></pre>