%% distfleq.m calculates the distance along
%% a point is along the given field line from
%% the magnetic equator
%%

function dfl=distfleq(th,lsh)

% th = magnetic latitude of point of interest
% lsh = L-shell of field line
% dfl = distance from magnetic equator to point of interest

re=6371;
th=abs(th);
y=sqrt(3)*sin(th);
dfl=re*lsh./(2*sqrt(3)).*(log(y+sqrt(1+y.^2))+y.*sqrt(1+y.^2));
