Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Azimuth between points on sphere or ellipsoid

`az = azimuth(lat1,lon1,lat2,lon2)`

az = azimuth(lat1,lon1,lat2,lon2,ellipsoid)

az = azimuth(lat1,lon1,lat2,lon2,* units*)

az = azimuth(lat1,lon1,lat2,lon2,ellipsoid,

`units`

az = azimuth(

`track`

`az = azimuth(lat1,lon1,lat2,lon2)`

calculates
the great circle azimuth from point 1 to point 2, for pairs of points
on the surface of a sphere. The input latitudes and longitudes can
be scalars or arrays of matching size. If you use a combination of
scalar and array inputs, the scalar inputs will be automatically expanded
to match the size of the arrays. The function measures azimuths clockwise
from north and expresses them in degrees or radians.

`az = azimuth(lat1,lon1,lat2,lon2,ellipsoid)`

computes
the azimuth assuming that the points lie on the ellipsoid defined by the input
`ellipsoid`

. `ellipsoid`

is a `referenceSphere`

, `referenceEllipsoid`

, or `oblateSpheroid`

object, or a vector of the form ```
[semimajor_axis
eccentricity]
```

. The default ellipsoid is a unit sphere.

`az = azimuth(lat1,lon1,lat2,lon2,`

uses
the input * units*)

`units`

`az`

and the latitude-longitude coordinates. Use `'degrees'`

(the
default value), in the range from 0 to 360, or `'radians'`

,
in the range from 0 to 2*pi.`az = azimuth(lat1,lon1,lat2,lon2,ellipsoid,`

specifies
both the * units*)

`ellipsoid`

vector and the units of `az`

.`az = azimuth(`

uses
the input * track*,...)

`track`

`'gc'`

for
the `track`

`'rh'`

for
the `track`

Find the azimuth between two points on the same parallel, for
example, (10ºN, 10ºE) and (10ºN, 40ºE). The azimuth
between two points depends on the * track* value
selected.

% Try the 'gc' track value. az = azimuth('gc',10,10,10,40) % Compare to the result obtained from the 'rh' track value. az = azimuth('rh',10,10,10,40)

Find the azimuth between two points on the same meridian, say (10ºN, 10ºE) and (40ºN, 10ºE):

% Try the 'gc' track . az = azimuth(10,10,40,10) % Compare to the 'rh' track . az = azimuth('rh',10,10,40,10)

Rhumb lines and great circles coincide along meridians and the Equator. The azimuths are the same because the paths coincide.

If you are calculating both the distance and the azimuth, you
can call just the `distance`

function. The function
returns the azimuth as the second output argument. It is unnecessary
to call `azimuth`

separately.

Was this topic helpful?