function cone_angle_sin(phi0,theta0,thmax)
%
% Finds amibiguities between azimuth angle phi and vertical angle theta
%
% phi0		= azimuth angle of signal (negative is sinphi0);
% theta0	= vertical grazing angle of signal;
% thmax		= maximum vertica angle to consider;
%
if nargin<3, thmax=45; end
%
npt=100;
iiback=0,
% Dot product of arrival at (phi0,theta0):
if phi0<0, 
	sinphi0=-phi0;
	phi0=sin_space([],sinphi0,90,0),
end
if phi0>90 | phi0<-90, iiback=1; end
%%sin_beta0=sin(phi0*pi/180)*cos(theta0*pi/180);
% Examine vertical angles steeper than theta0:
theta=linspace(theta0,thmax,npt);
% Steeper angles will show up at sin_beta:
sin_beta=sin(phi0*pi/180)*cos(theta*pi/180);
% But I still steer at theta0, so what phi will it look like?
phi=asin(sin_beta./cos(theta0*pi/180))*180/pi;
if iiback, phi=180-phi; end
%
figure(313); clf;
plot(phi,theta);
xlabel('\phi - deg'); ylabel('Ambig \theta - deg');
hold on;
plot_cfill(phi0,theta0,'o','r',10);
plot_set3(gca,1.5,'Times',14,1);
zoom on; axis('tight'); grid on;
plot_size(gca,'in',3,2);
%
figure(314); clf;
sinphi=sin_space([],phi,90,2);
sinphi0=sin_space([],phi0,90,2);
%
plot(sinphi,theta); hold on;
xlabel('sin(\phi)'); ylabel('Ambig \theta - deg');

plot_cfill(sinphi0,theta0,'o','r',10);
plot_set3(gca,1.5,'Times',14,1);
zoom on; axis('tight'); grid on;
plot_size(gca,'in',3,2);
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
