 
clear; close

disp(' ')
disp('             Transformation of area    ')
disp(' ')
disp('  We study the area of the rectangle R = [1,2]x[0,2]  under ')
disp('  the mapping (u,v) -> T(u,v) = (u^2 - v^2, 2*u*v)  ')
disp('  We divide the rectangle into smaller rectangles and ')
disp('  approximate the mapping T(u,v) = (u^2 - v^2, 2*u*v) ')
disp('  by a linear mapping on each rectangle. The image of each ')
disp('  subrectangle is a parallelogram, and the sum of the ')
disp('  the areas of the parallelograms is an approximation to')
disp('  area of T(R). ') 
disp(' ')
disp('  First use m = n = 1, no subdivisions to see that the image')
disp('  of a rectangle under a linear approximation is a parallelogram')
disp('  Then use m = n = 4 to get a better approximation, finally use')
disp('  m = n = 10  to get a better approximation.  The exact answer is')
disp('  29+1/3 ')

f = inline('u.^2 - v.^2', 'u', 'v');
g = inline(' 2*u.*v', 'u', 'v');

corners = [ 1 2 0 2];
 
for j = 1:3
  trf(f,g,corners)
  pause
end
close

