% 4 corners of figure shawn drew, for dechirp (figure with eye)

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

% ------------------------------
% comment out to get one you want: 
% planewave perspective for dechirp (eye) fig:
%% A = [ 409,144; 325,293; 460,222; 356,338 ]; N=2.75*85;  %85 dpi across
% planewave affinity for dechirp
A = [476,142; 475,464; 546,248; 546,570]; N=300; %%  N=6*85;% 85 dpi across

u = 0; % number of cycles in the down (x) direction
v = 8; % number of cycles in the across (y) direction

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
height = max(B(:,1));         % max x dimension after origin set to 0
width  = max(B(:,2));
aspect_ratio = height/width;  % maximum xdim / maximum ydim

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('planewave_r')
  planewave_r = real(planewave(u,v,400,800));  % nice and big to be sure
  dispmatb(planewave_r);
end%if

% comment out appropriate s0 for appropriate source file
s0='!/u/steve/src/dechirp/rechirp2 deletemecolor deleteme_dechirped_color '
s0='!/u/steve/src/dechirp/rechirp2 deleteme_dispmatb deleteme_dechirped '
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)
% xdat('deleteme_dechirped','/8 /8')

