function [theta,r]=thetar(u,v);
%function [theta,r]=thetar(u,v);
%       converts to polar coords, with theta first
if nargin==1
    [n,m]=size(u);
    if (n==2)&(m~=2)
         v=u(2,:);
         u=u(1,:);
    else
         v=u(:,2);
         u=u(:,1);      
    end
end
im=sqrt(-1);
u=u+im*v;
r=abs(u);
theta=imag(log(u))*180/pi;
