% 4 corners of figure shawn drew, for rechirp

% A  % corners in points measured from printout
% x down, y across
%
%       _______________________> Y
%       |
%       |
%       |
%       V
%       X

% ------------------------------
% comment out to get one you want: 
% little affine one for rechirp (light bulb) fig:
A = [353,209; 368,224; 405,209; 420,224]; N=25; % measured with ruler in pts
% big perspective one for rechirp (light bulb) fig:
%% A = [128,549; 257,667; 433,294; 469,328]; N=400;% measured with ruler in pts
% perspective for dechirp (eye) fig:
% N = 400 % choose 400 for perspective and 20 for little affine one

B = A-ones(4,1)*[min(A(:,1)),min(A(:,2))];       % start them at 0
x4 = B(4,1);   % height in points, because x1 = 0
y2 = B(2,2);   % width in points, becuase y3 = 0
aspect_ratio = x4/y2
C = [B(:,1)/max(B(:,1)), B(:,2)/max(B(:,2))];    % put on [0,1] for no reason

M = N * aspect_ratio   % should be 125/168.5

D(:,1) = C(:,1) * M                              % desired height
D(:,2) = C(:,2) * N                              % desired width

if ~exist('Fr')
  Fr = real(fourierop(700,700,.05)); % .05 gives about 9cy cent to corner
                                     % .07 gives about 13 cy cent to corner
  dispmatb(Fr);
end%if

% comment out appropriate s0 for appropriate source file
s0='!/u/steve/src/dechirp/rechirp2 deletemecolor deleteme_rechirped_color '
s0='!/u/steve/src/dechirp/rechirp2 deleteme_dispmatb deleteme_rechirped '
s1=sprintf('%g %g ', D(1,1), D(1,2))
s2=sprintf('%g %g ', D(2,1), D(2,2))
s3=sprintf('%g %g ', D(3,1), D(3,2))
s4=sprintf('%g %g ', D(4,1), D(4,2))
s5=sprintf('-M %g -N %g -NaN 255', round(M), round(N))
s = [s0 s1 s2 s3 s4 s5]
eval(s)

