function [x,y]=gpos1(h,a,f1,F1,L,x,y,u,v,a2)

set(h	,'WindowButtonDownFcn','gpos0(h);');
set(h	,'WindowButtonMotionFcn','gpos1(h,a,f1,F1,L,x,y,u,v,a2);');




[xyf]=get(gca,'CurrentPoint');
xp = xyf(1,1);
yp = xyf(1,2);



% pos_rect_window = get(h,'Position');
% vpos_rect = get(gca,'Position');

% [xy]=get(h,'CurrentPoint');
% W = pos_rect(3);
% H = pos_rect(4);
% 
% 
% xx  = xy(1);	x0 = pos_rect(1);
% yy  = xy(2);	y0 = pos_rect(2);
% 
% xp = (2*a/W)*(xx - x0) - a;
% yp = (2*a/H)*(yy - y0) - a;
% 




x20=xp;
y20=yp;
f2 = ( 1 / ( 4 * pi * a2 ) ) * exp( -( ( x - x20 ).^2 + ( y - y20 ).^2 ) / ( 4 * a2 ) );
F2 = exp( -a2 * ( u.^2 + v.^2 ) ) .* exp( -j * ( u * x20 + v * y20 ) );

subplot(122)
imagesc( L/2 , L/2 , abs(F1+F2) );axis square;axis xy
xlabel('u');ylabel('v');title('Fourier Amplitude')
subplot(121)
imagesc( L , L , f1+f2 );axis square;axis xy
xlabel('x');ylabel('y');title('Image')
%title(num2str([xp yp]))
