No BSD License  

Highlights from
pos2dist

5.0

5.0 | 5 ratings Rate this file 102 Downloads (last 30 days) File Size: 1.86 KB File ID: #5256

pos2dist

by Langqiu Sun

 

15 Jun 2004 (Updated 17 Jun 2004)

Calculate distance between two points on earth's surface given by latitude-longitude pair.

| Watch this File

File Information
Description

Calculate distance between two points on earth's surface given by their latitude-longitude pair. Choose method 1 or 2. Method 1 uses plane approximation, only for points within several tens of kilometers; Method 2 calculates sphereic geodesic distance for points farther apart, but ignores flattening of the earth. Output is in km.

Acknowledgements
This submission has inspired the following:
posdist
MATLAB release MATLAB 6.5 (R13)
Other requirements Tested only on PCs.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
17 Jun 2004 David Terr

This looks like it could be a great program but as is, it doesn't do anything! In fact, I had to add a couple lines to the end to keep it from returning an error message. Please test your code before submitting it!

Dave

18 Jun 2004 Langqiu Sun

Appologize for the former one. That's imcomplete. A new version has been uploaded. This should be OK.

18 Jun 2004 David Terr

That's much better! Keep up the good work.

10 Aug 2010 Rafael Palacios  
22 Oct 2010 Rossella Blatt

Thanks. I was about to write the same function, but then I found it here: you made save some time! :)

28 Mar 2011 Ioannis Daliakopoulos

line 36 should be

  method = 1;

instead of

  method == 1;

otherwise, very useful!

28 Jul 2011 Joachim

Good work

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
distance Langqiu Sun 22 Oct 2008 07:23:59
points Langqiu Sun 22 Oct 2008 07:23:59
surface Langqiu Sun 22 Oct 2008 07:23:59
latitude Langqiu Sun 22 Oct 2008 07:23:59
longitude Langqiu Sun 22 Oct 2008 07:23:59

Contact us at files@mathworks.com