View License

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

» Watch video

Highlights from

5.0 | 2 ratings Rate this file 6 Downloads (last 30 days) File Size: 1.99 KB File ID: #35562 Version: 1.0




Calculates distance between two geographical positions in lat/long format

| Watch this File

File Information

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.


Pos2dist inspired this file.

This file inspired Pathdist.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
15 Jul 2016 Rossa O'Keeffe-O'Donovan

Works well for me, allows vectors of coordinate points

19 Mar 2013 Chad Greene

Chad Greene (view profile)

Works great!

Contact us