Mapping Toolbox    
legs

Determine courses and distances between navigational track waypoints

Syntax

Description

This is a navigation function. All angles are in degrees, and all distances are in nautical miles. Track legs are the courses and distances traveled between navigational waypoints.

[course,dist] = legs(lat,lon) returns the azimuths (course) and distances (dist) between navigational waypoints, which are specified by the column vectors lat and lon.

[course,dist] = legs(lat,lon,method) specifies the logic for the leg characteristics. If the string method is 'rh' (the default), course and dist are calculated in a rhumb line sense. If method is 'gc', great circle calculations
are used.

[course,dist] = legs(pts) allows the user to input the waypoints in a single, two-column matrix pts.

mat = legs(lat,...) packs up the outputs into a single, two-column matrix, mat.

Examples

Imagine an airplane taking off from Logan International Airport in Boston (42.3ºN,71ºW) and travelling to LAX in Los Angeles (34ºN,118ºW). The pilot wishes to file a flight plan that takes the plane over O'Hare Airport in Chicago (42ºN,88ºW) for a navigational update, while maintaining a constant heading on each of the two legs of the trip.

What are those headings and how long are the legs?

Upon takeoff, the plane should proceed on a heading of about 269º for 756 nautical miles, then alter course to 251º for another 1495 miles.

How much farther is it travelling by not following a great circle path between waypoints? Using rhumb lines, it is travelling:

For a great circle route:

The great circle path is less than one-half of one percent shorter.

See Also
dreckon
Dead reckon points for a track
gcwaypts
Find waypoints along a great circle
navfix
Mercator-based navigational fixing
track
Connect waypoints


  km2deg, km2nm, km2rad, km2sm lightm