File Exchange

image thumbnail


version 1.0 (1.99 KB) by

Calculates distance between two geographical positions in lat/long format



View License

Calculates distance in km between two points given in decimal degrees latitude and longitude. Calculation can be great circle distance (smallest distance along the surface of a sphere) or Cartesian distance (planar approximation for smaller distances).
Input can be as scalars or arrays, as long as dimensions are identical for all four coordinates.

The function is based on the pos2dist function submitted by Langqui Sun, modified to allow arrays as input.

Comments and Ratings (2)

Works well for me, allows vectors of coordinate points

Chad Greene

Chad Greene (view profile)

Works great!

MATLAB Release
MATLAB 7.10 (R2010a)

Inspired by: pos2dist

Inspired: pathdist

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video