Code covered by the BSD License  

Highlights from
posdist

5.0

5.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 1.99 KB File ID: #35562

posdist

by

 

Calculates distance between two geographical positions in lat/long format

| Watch this File

File Information
Description

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.

Acknowledgements

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 (1)
19 Mar 2013 Chad Greene

Works great!

Contact us