function showfdn ( A1,P1,phi1,A2,P2,phi2,delta)

%% showfdn() is yet another orbit function.
%
% Pre:   (A1,P1,phi1) and (A2,P2,phi2) are orbits and
%        delta is a 2-vector that specifies the divided 
%        difference parameters.
%
% Post:  Applies Finite Difference Newton method to find an 
%        intersection of the input orbits.
%
% Usage: ShowFDN(15,2,pi/10,20,3,-pi/8,[.000001 .000001])

  fprintf ( 1, '\n' );
  fprintf ( 1, 'showfdn()\n' );

  close all
  plist = [A1 P1 phi1 A2 P2 phi2]; 
  itmax = 20;
  tol = 1e-14;
  
  % Plot Orbits
  
  figure
  Orbit(linspace(0,2*pi),A1,P1,phi1,'-');
  hold on
  Orbit(linspace(0,2*pi),A2,P2,phi2,'--');
  
  % Enter Starting Points
  
  z0 = zeros(2,1);
  tc = zeros(2,1);
  
  title('Enter starting point on solid orbit')
  [z0(1),z0(2)] = ginput(1);
  [tc(1),Orb1] = PtOnOrb(z0,P1,A1,phi1);
  plot(Orb1(1),Orb1(2),'*')
  
  title('Enter starting point on dashed orbit')
  [z0(1),z0(2)] = ginput(1);
  [tc(2),Orb2] = PtOnOrb(z0,P2,A2,phi2);
  plot(Orb2(1),Orb2(2),'*')
  title('Initial Guess')
  pause(.01)
  hold off
  
   
  % Initializations
  
  Fc =  SepV(tc,plist);   r = norm(Fc);
  clc
  disp('Iteration        tc(1)                  tc(2)             norm(Fc)')
  disp('--------------------------------------------------------------------') 
  disp(sprintf('    %2.0f   %20.16f   %20.16f     %8.3e',0,tc(1),tc(2))) 
  
  % The FDNewton Iteration
  
  k=0;
  while (k<itmax) & (r>tol)
  
     % Take a step and display
	 
	 [tc,Fc] = FDNStep('sepV',tc,Fc,plist,delta);
	 
	 k=k+1;
	 figure
	 Orbit(linspace(0,2*pi),A1,P1,phi1,'-');
	 hold on
	 Orbit(linspace(0,2*pi),A2,P2,phi2,'--');
	 Orbit(tc(1),A1,P1,phi1,'*');
	 Orbit(tc(2),A2,P2,phi2,'*');
	 hold off 
	 r = norm(Fc);
	 title(sprintf(' Iteration = %2.0f   norm(Fc) = %8.3e',k,r))
	 disp(sprintf('    %2.0f   %20.16f   %20.16f     %8.3e',k,tc(1),tc(2),r)) 
  end
  
  sol = Orbit(tc(1),A1,P1,phi1);
  disp(sprintf('\n Intersection = ( %17.16f , %17.16f )',sol))

  return
end

