Geographic tracks from starting point, azimuth, and range
[lat,lon] = track1(lat0,lon0,az)
[lat,lon] = track1(lat0,lon0,az,arclen)
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid)
[lat,lon] = track1(lat0,lon0,az,angleunits)
[lat,lon] = track1(lat0,lon0,az,arclen,angleunits)
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid,angleunits)
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid,angleunits,npts)
[lat,lon] = track1(trackstr,...)
mat = track1(...)
[lat,lon] = track1(lat0,lon0,az) computes
complete great circle tracks on a sphere starting at the point lat0,lon0 and
proceeding along the input azimuth, az. The inputs
can be scalar or column vectors.
[lat,lon] = track1(lat0,lon0,az,arclen) uses
the input arclen to specify the arc length of the
great circle track. arclen is specified in units
of degrees of arc. If arclen is a column vector,
then the track is computed from the starting point, with positive
distance measured easterly. If arclen is a two
column matrix, then the track is computed starting at the range in
the first column and ending at the range in the second column. If arclen
= [], then the complete track is computed.
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid) computes the track
along a geodesic arc on the ellipsoid defined by the input ellipsoid,
which can be a referenceSphere, referenceEllipsoid, or oblateSpheroid object, or a vector of the form [semimajor_axis
eccentricity]. arclen must be expressed in length units
that match the units of the semimajor axis — unless ellipsoid
is [] or the semimajor axis length is zero. In these special cases,
arclen is assumed to be in degrees of arc and the tracks are
computed on a sphere, as in the preceding syntax.
[lat,lon] = track1(lat0,lon0,az,angleunits),
[lat,lon] = track1(lat0,lon0,az,arclen,angleunits),
and
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid,angleunits)
where angleunits defines the units of the input and output angles as
'degrees' or 'radians'.
[lat,lon] = track1(lat0,lon0,az,arclen,ellipsoid,angleunits,npts) uses
the scalar input npts to specify the number of points per track. The
default value of npts is 100.
[lat,lon] = track1(trackstr,...) where trackstr is a
string scalar or a character vector that defines either a great circle
('gc') or rhumb line track ('rh'). If
trackstr is 'gc', then either great circle
(given a sphere) or geodesic (given an ellipsoid) tracks are computed. If
trackstr is 'rh', then the rhumb line tracks
are computed.
mat = track1(...) returns a single output
argument mat such that mat = [lat lon].
This is useful if only a single track is computed.
Multiple tracks can be defined from a single starting point
by providing scalar lat0 and lon0 and
column vectors for az and arclen.
% Set up the axes.
axesm('mercator','MapLatLimit',[-60 60],'MapLonLimit',[-60 60])
gridm on; plabel on; mlabel on;
% Plot the great circle track in green.
[lattrkgc,lontrkgc] = track1(0,0,45,[-55 55]);
plotm(lattrkgc,lontrkgc,'g')
% Plot the rhumb line track in red.
[lattrkrh,lontrkrh] = track1('rh',0,0,45,[-55 55]);
plotm(lattrkrh,lontrkrh,'r')