%% orbpd.m calculates the orbital period for a
%% circular orbit at the given altitude (km).
%% This is done using Keplers Thrid Law. The
%% result is given in fractional hours.
%%

function orbp=orbpd(alt)

re=6371;                                 %Earth's radi (km)
orbp1=((alt+re)*1e3).^3;                 %orbital radius cubed
orbp2=6.67e-11*5.97e24;                  %Gravitional constant multipled by mass of the Earth
orbp=2*pi*sqrt(orbp1/orbp2)/3600;        %Period in fractional hours

