Mapping Toolbox | ![]() ![]() |
Compute coordinates of a small circle path from center and perimeter point
Syntax
pts = scircle2(lat1,lon1,lat2,lon2) [latc,lonc] = scircle2(lat1,lon1,lat2,lon2) [latc,lonc] = scircle2(lat1,lon1,lat2,lon2,units
) [latc,lonc] = scircle2(lat1,lon1,lat2,lon2,geoid) [latc,lonc] = scircle2(lat1,lon1,lat2,lon2,geoid,units
) [latc,lonc] = scircle2(lat1,lon1,lat2,lon2,geoid,units
,npts) [latc,lonc] = scircle2(track
,lat1,,lon1,lat2,lon2...)
Background
A small circle is the locus of all points an equal surface distance from a given center. For true small circles, this distance is always calculated in a great circle sense; however, the scircle2
command allows a locus to be calculated using distances in a rhumb line sense as well. An example of a small circle is all points exactly 100 miles from the Washington Monument.
Description
[latc,lonc] = scircle2(lat1,lon1,lat2,lon2) returns the coordinates of points along small circles centered at the points provided in lat1
and lon1
, which pass through the points provided in lat2
and lon2
. The coordinates of multiple small circles are stored in separate columns of latc
and lonc
.
[latc,lonc] = scircle2(lat1,lon1,lat2,lon2,units
) specifies the units for the inputs and outputs, where units
is any valid angle units string. The default value is 'degrees'
.
[latc,lonc] = scircle2(lat1,lon1,lat2,lon2,geoid) specifies the elliptical definition of the Earth to be used with the two-element geoid
vector. The default geoid model is the sphere, which is sufficient for most applications.
[latc,lonc] = scircle2(lat1,lon1,lat2,lon2,geoid,units
,npts) specifies the number of output points, npts
, returned per small circle. The default value of npts
is 100.
[latc,lonc] = scircle2(track
,lat1,lon1,lat2,lon2...) specifies the logic with which ranges are calculated. If the string track is 'gc'
(the default), great circle distance is used. It track is 'rh'
, rhumb line distance is used.
pts = scircle2(lat1,lon1,lat2,lon2) returns the points in a two-column output pts
.
Examples
Plot the locus of all points the same distance from New Delhi as Kathmandu:
axesm('mercator','MapLatlimit',[0 40],'MapLonLimit',[60 110]);
load coast
plotm(lat,long,'k'); % For reference lat1 = 29; lon1 = 77.5; % New Delhi lat2 = 27.6; lon2 = 85.5; % Kathmanduplotm([lat1 lat2],[lon1 lon2],'b*') % Plot the cities
[latc,lonc] = scircle2(lat1,lon1,lat2,lon2); plotm(latc,lonc,'b')
See Also
scircle1 |
Small circle from center and radius |
track |
Connect waypoints with track segments |
track1 track2 |
Great circles and rhumb lines |
![]() | scircle1 | scircleg | ![]() |