function [ax,minax,maxax]=navaspect(lat,long)
%determines the aspect ratio for navigational plots
%assumes that lat and long are in decimal format, lat is Y, long is X
%careful if latitude covered is greater than 2 degrees

clat=cos(mean(lat)*pi/180); %find the mean latitude cosine 
longdist=((max(long)-min(long))*60)*clat;%find the distance covered by long (60nm per degree) and correct for lat
latdist=((max(lat)-min(lat))*60);%find the distance covered by lat (60nm per degree)

if latdist > longdist %the longitudinal axis covers less distance
    ax='XLim';
    cor=latdist-longdist;%find the distance needed to add
    cor=((cor/60)/clat);%convert the correction distance to decimal minutes
    cor=cor/2;%divide it equally
    minax=min(long)-cor;maxax=max(long)+cor;%extend the axis
elseif longdist > latdist %the latidudinal axis covers less distance
    ax='YLim';
    cor=longdist-latdist;%find the distance needed to add
    cor=cor/60;%convert the correction distance to decimal minutes
    cor=cor/2;%divide it equally
    minax=min(lat)-cor;maxax=max(lat)+cor;%extend the axis
else %they are already equal
    return;
end;
    
   