Skip to content

Commit c629c37

Browse files
committed
vdist: define keepsize
Fixes #7
1 parent 602a0e9 commit c629c37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

+matmap3d/vdist.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
% * lat1 = GEODETIC latitude of first point (degrees)
1616
% * lon1 = longitude of first point (degrees)
1717
% * lat2, lon2 = second point (degrees)
18+
%
19+
% from https://www.mathworks.com/matlabcentral/fileexchange/8607-vectorized-geodetic-distance-and-azimuth-on-the-wgs84-earth-ellipsoid
20+
1821
function varargout = vdist(lat1,lon1,lat2,lon2)
1922
%
2023
%%% Original algorithm source:
@@ -66,6 +69,7 @@
6669
lon2 {mustBeReal,mustBeEqualSize(lat1,lon2)}
6770
end
6871

72+
keepsize = size(lat1);
6973
% Supply WGS84 earth ellipsoid axis lengths in meters:
7074
a = 6378137; % definitionally
7175
b = 6356752.31424518; % computed from WGS84 earth flattening coefficient

0 commit comments

Comments
 (0)