image thumbnail
from Animations by Ankur Pawar
Some animation in MATLAB

[xd,yd]=transform2d(x,y,tx,ty,phi,xr,yr)
function [xd,yd]=transform2d(x,y,tx,ty,phi,xr,yr)
xd=x.*cos(phi)-y.*sin(phi)+xr.*(1-cos(phi))+yr.*sin(phi)+tx;
yd=x.*sin(phi)+y.*cos(phi)+yr.*(1-cos(phi))-xr.*sin(phi)+ty;

Contact us at files@mathworks.com