%% vfline.m calculates the difference between a vertical field line 
%% and dipole field line.
%%
%% Phillip A. Webb
%% November 15, 2004
%%

clear all
close all

latmd=input('Latitude of interest (deg)? ');
alt=input('Altitude of interest (km)? '); 

%Calculate the location of the top of the field line assuming a dipole field
latm=deg2rad(latmd);						%convert from deg to rad
re=6371;										%Earth radius (km)
lsh=lshpar(-1,latm,re);					%L-shell 
latmt=lshpar(lsh,-1,(re+alt));		%latitude at top of field line

dalt=(latmt-latm)/abs(latm)

