
%Transforms meo(long-lat) coordinates into meo(xyz) coordinates
%
%Initial version: Niklas Edberg, Swedish Institute of Space Physics, Uppsala, Oct 2005

function [meo] = longlat2meo(height, longitude, latitude)

for i=1:length(height)
    meo(1,i) = height(i).*cos(latitude(i).*pi./180).*cos(longitude(i).*pi./180);        %   x-coordinate
    meo(2,i) = height(i).*cos(latitude(i).*pi./180).*sin(longitude(i).*pi./180);        %   y-coordinate
    meo(3,i) = height(i).*sin(latitude(i).*pi./180);                                    %   z-coordinate
end