gcwaypts
Equally spaced waypoints along great circle
Syntax
[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2)
[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2,nlegs)
pts = gcwaypts(lat1,lon1,lat2,lon2...)
Description
[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2)
returns
the coordinates of equally spaced points along a great circle path
connecting two endpoints, (lat1,lon1
) and (lat2,lon2
).
[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2,nlegs)
specifies
the number of equal-length track legs to calculate. nlegs+1
output
points are returned, since a final endpoint is required. The default
number of legs is 10.
pts = gcwaypts(lat1,lon1,lat2,lon2...)
packs
the outputs, which are otherwise two-column vectors, into a two-column
matrix of the form [latitude longitude]
.
This format for successive waypoints along a navigational track is
called navigational track format in this guide.
See the navigational track format
reference page
in this section for more information.
Background
This is a navigational function. It assumes that all latitudes and longitudes are in degrees.
In navigational practice, great circle paths are often approximated
by rhumb line segments. This is done to come reasonably close to the
shortest distance between points without requiring course changes
too frequently. The gcwaypts
function provides
an easy means of finding waypoints along a great circle path that
can serve as endpoints for rhumb line segments (track legs).
Examples
Version History
Introduced before R2006a