% Theodemo.m

% Demonstration of Theodorsen's method for mapping from the 
% unit disk to the interior of a simple closed curve.

clear, clf
clear global
global ratio

%  Input selections

fprintf('Choose a method\n');
fprintf('Type 1 for Theodorsen method\n');
method = input('method = ');
fprintf('  \n');
fprintf('Choose a region\n');
fprintf('Type 1 for an ellipse\n');
fprintf('Type 2 for an inverted ellipse\n');
region = input('region = ');
fprintf('  \n');
m = input('For n = 2 ^ m Fourier points, m = ');
n = 2^m;
if (region == 1 | region == 2 )
   ratio = input('Enter the ratio of the minor to the major axis = ');
  end
itmax = input('Enter maximum number of iterations, itmax = ');

%  Run conformal mapping routine

if method == 1
   f = theoint(n, region, itmax);
end


% Plot image of disk

igraph = input('Graphics ? (1-yes):');
if igraph == 1
   clf
   pinter2(f);
end