pathdist

バージョン 1.4 (31.6 KB) 作成者: Chad Greene
Simply calculate distance traveled along a lat/lon path
ダウンロード: 1.8K
更新 2015/1/13

ライセンスの表示

pathdist returns an array of the cumulative distance traveled along a path.
Syntax
pathDistance = pathdist(lat,lon)
pathDistance = pathdist(...,LengthUnit)
pathDistance = pathdist(...,track)
pathDistance = pathdist(...,'refpoint',[reflat reflon])

Description
pathDistance = pathdist(lat,lon) returns the cumulative distance traveled along the path given by (lat,|lon|). Distance is in meters by default, referenced to the WGS84 ellipsoid. The pathDistance array will be the same size as lat and lon.

pathDistance = pathdist(...,LengthUnit) specifies any valid length unit. The following are a few LengthUnit options. See documentation for validateLengthUnit for a complete list of options.

meter 'm', 'meter(s)', 'metre(s)' (default)
kilometer 'km', 'kilometer(s)', 'kilometre(s)'
nautical mile 'nm', 'naut mi', 'nautical mile(s)'
foot 'ft', 'international ft','foot', 'international foot', 'feet', 'international feet'
inch 'in', 'inch', 'inches'
yard 'yd', 'yds', 'yard(s)'
mile 'mi', 'mile(s)','international mile(s)'

pathDistance = pathdist(...,track) uses the input string track to specify either a great circle/geodesic or a rhumb line arc. If track equals 'gc' (the default value), then great circle distances are computed on a sphere and geodesic distances are computed on the WGS84 ellipsoid. If track equals 'rh', then rhumb line distances are computed on the WGS84 ellipsoid.

pathDistance = pathdist(...,'refpoint',[reflat reflon]) references the path distance to the point along the path nearest to [reflat reflon]. For this calculation, pathdist finds the point in lat and lon which is nearest to [reflat reflon] and assumes this point along lat,|lon| is the zero point. This is only an approximation, and may give erroneous results in cases of very sharply-curving, crossing, or otherwise spaghetti-like paths; where [reflat reflon] lies far from any point along the path, or where points along the path are spaced far apart.

引用

Chad Greene (2026). pathdist (https://jp.mathworks.com/matlabcentral/fileexchange/47042-pathdist), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux

pathdistdemo/html/

バージョン 公開済み リリース ノート
1.4

In this morning's release I accidentally set default units to kilometers. Default units are now meters.

1.3.0.0

Now includes support for miles, feet, nautical miles, and many more length units.

1.2.0.0

bug fix.

1.1.0.0

Now accepts NaN inputs.

1.0.0.0