function varargout=linazim(ang,senter,rx,ry,varargin) % [x,y]=LINAZIM(ang,senter,rx,ry) % [x,y]=LINAZIM(ang,senter,rx,ry,nxy) % ph=LINAZIM(ang,senter,rx,ry) % % Plots lines of given azimuth at a set of points. % % INPUT: % % ang Angles in degrees NORTH from EAST % senter [x(:) y(:)] location of center points % [rx,ry] Radii of a box in which the arrow fits % If ry=[] then scaled in circle of radius rx % nxy Number of points calculated [Default: 100] % % OUPUT: % % [x,y] Coordinates of lines to be plotted % ph Handles to the lines plotted % % % EXAMPLE: % % ph=linazim([0:10:179],[5 8],5,3); axis image % ph=linazim([0:10:179],[5 8],5,[]); axis image % ph=linazim([0:10:179],[rand(18,1) rand(18,1)],0.15,0.15); axis image % ph=linazim([0:10:179],[rand(18,1) rand(18,1)],0.15,[]); axis image % ph=linazim([0:10:179],[rand(18,1) rand(18,1)],0.2*rand(18,1),[]); axis image % ph=linazim([0:10:179],[(1:18)' repmat(0,18,1)],1,[]); axis image % % % See also RUMPKER % % Last modified by fjsimons-at-alum.mit.edu, Feb 21st, 2004. defval('senter',[0 0]) defval('rx',10) defval('ry',[]) ang=ang(:)*pi/180; if size(senter,2)~=2 error('Wrong center specification') end if length(ang)>1 & size(senter,1)>1 if length(ang)~=size(senter,1) error('If more than one center, size must match number of azimuths') end end if length(ang)>1 & size(senter,1)==1 senters=repmat(senter,length(ang),1); else senters=senter; end if nargin==5 nxy=ceil(varargin{1}/2); else nxy=ceil(100/2); end % IF BOX if ~isempty(ry) for index=1:length(ang) angm=ang(index); senter=senters(index,:); if abs(tan(angm))