function [lat,lon,h]=make_geo(xd,yd,zd,lat0,lon0,azi)
% make_geo creates the data position in latitude, longitude, and height
% using WGS84 ellipsoid. Different ellisoid can be selected in the ell2xyz
% and xyz2ell m files from definitions in refell.m
% input xd: easting coordinate in m
%       yd: northing coordinate in m
%       zd: up coordinate in m
%       lat0,lon0,h0 are the lat, lon and height of lidar placement
% ** NOTE: northing coordinate is passed first then easting

[na,nr]=size(xd);
lat=zeros(size(xd));
lon=lat;
h=lat;
for j=1:na
    LatLon=xy2latlon(xd(j,:),yd(j,:),lat0,lon0,azi);
    lat(j,:)=LatLon(1,:);
    lon(j,:)=LatLon(2,:);
    h(j,:)=zd(j,:);
end
return