function [newIm] = imageWarp(origIm,T)

  s = size(origIm);

  % 1 if rotate about corner, else rotate about center
  [xgrid,ygrid] = meshgrid(-s(1)/2 + 1:s(1)/2,-s(2)/2 + 1:s(2)/2);

  % homogeneous coords of current axis H
  H(1,:) = reshape(xgrid,1,s(1)*s(2));
  H(2,:) = reshape(ygrid,1,s(1)*s(2));
  H(3,:) = ones(1,s(1)*s(2));

  % homogeneous coords mapping old image to new
  A = T*H;

  newIm = interp2(xgrid,ygrid,origIm,A(1,:),A(2,:));
  pts = find(isnan(newIm)); newIm(pts) = 0;
  newIm = reshape(newIm,s);

return;