title: Matlab rotating image-point in 2D around arbitrary point
body: <p>I want to rotate a point in 2D around an arbitrary point using Matlab. I am implementing following equation:
  <img src="https://i.stack.imgur.com/O0QRO.jpg" alt="enter image description here"></p>
  
  <p>I have the following code. In my implementation </p>
  
  <pre><code>original = [eye_left(1); eye_left(2);1];    
  m= size(im,2)/2  % width/2  (I want to rotate around the center of the image)
  n= size(im,1)/2   % height/2
  first = [1,0,-(size(im,2)/2); 0, 1,-(size(im,1)/2);0, 0, 1];
  second = [cos(angle), -sin(angle),0; sin(angle), cos(angle), 0;0, 0, 1];
  third = [1,0,size(im,2)/2; 0, 1,size(im,1)/2;0, 0, 1];
  
  rotated = third* second* first * original;
  </code></pre>
  
  <p>But in the <code>rotated</code> variable the y-values is always soo far away from where I expect it to be...</p>