Scan the output image. For each row, column location usethe Rotation matrix (from Wikipedia) to determine where in the input image the pixel should come from, and assign it.
Try using imtranslate() or circshift() to shift the centroid to the middle, then call imrotate(), then shift back to the original location. Otherwise, just use the rotation matrix (seeWikipedia).
Best Answer