function [ latm, lonm ] = middlepoint( lats, lons )
    if length(lats) ~= length(lons)
        error('vectors are not of equal length')
    end
    latm = sum(lats)/length(lats);
    lonm = sum(lons)/length(lons);
end

