Hi John. I found the bug: the function fails because of the atan function when calculating sigma. I changed it to atan2, and it fixed the problem. I will submit an update as soon as possible.
Hi Orlando, i am trying to use this function, i have the mapping toolbox, but couldnt seem to find the function geodistance(lat1,lon1,lat2,lon2, actualradius ). If you have a copy of it, would it be possible to post or send it. Thanks
Three suggestions:
1. You may want to consider vectorizing in order to speed it is needed to be called many times sequentially.
2. Perhaps changing the syntax to match MATLAB's distance function i.e. geodistance(lat1,lon1,lat2,lon2)
3. It would be nice if azimuth could be outputted as well. Perhaps checking nargout > 2, and then running MATLAB's azimuth routine, or one that you might have.