# reckon

Point at specified azimuth and range on sphere or ellipsoid

## Syntax

``[lat2,lon2] = reckon(lat1,lon1,arclen,az)``
``[lat2,lon2] = reckon(lat1,lon1,arclen,az,ellipsoid)``
``[lat2,lon2] = reckon(___,units)``
``[lat2,lon2] = reckon(method,___)``

## Description

example

````[lat2,lon2] = reckon(lat1,lon1,arclen,az)` finds the coordinates of the point at the spherical distance `arclen` and azimuth `az` from the point with coordinates `lat1` and `lon1`. This syntax references the coordinates to a sphere, assumes that all input arguments are in degrees, and assumes a great circle azimuth.```

example

````[lat2,lon2] = reckon(lat1,lon1,arclen,az,ellipsoid)` specifies the reference ellipsoid for the coordinates. This syntax assumes that `arclen` is a linear distance in the units of the semimajor axis of the reference ellipsoid.```
````[lat2,lon2] = reckon(___,units)` specifies the angle units, in addition to any combination of input arguments from the previous syntaxes.```
````[lat2,lon2] = reckon(method,___)`, where `method` is `"rh"`, indicates that `az` is a rhumb line azimuth. The default for `method` is `"gc"`, which indicates that `az` is a great circle azimuth (for a sphere) or a geodesic azimuth (for an ellipsoid).```

## Examples

collapse all

Find the coordinates of the point `600` nautical miles northwest of London. Convert `600` nautical miles to a spherical distance in degrees by using the `nm2deg` function. A northwest direction has an azimuth of `315` degrees.

```arclen = nm2deg(600); az = 315; [lat,lon] = reckon(51.5,0,arclen,az)```
```lat = 57.8999 ```
```lon = -13.3507 ```

Create a World Geodetic System of 1984 (WGS84) reference ellipsoid with a length unit of nautical miles.

`wgs84 = wgs84Ellipsoid("nm");`

Find the coordinates of the point `600` nautical miles northwest of London. Reference the coordinates to the ellipsoid. When you specify a reference ellipsoid as input to the `reckon` function, specify the arc length as a linear distance. A northwest direction has an azimuth of 315 degrees.

```arclen = 600; az = 315; [lat,lon] = reckon(51.5,0,arclen,az,wgs84)```
```lat = 57.8953 ```
```lon = -13.3015 ```

## Input Arguments

collapse all

Latitude of the input point, specified as a scalar or array.

You can specify `lat1`, `lon1`, `arclen`, and `az` using a combination of scalars and arrays, as long as the arrays are of the same size. The function expands the scalar inputs to match the size of the array inputs.

Data Types: `single` | `double`

Longitude of the input point, specified as a scalar or array.

You can specify `lat1`, `lon1`, `arclen`, and `az` using a combination of scalars and arrays, as long as the arrays are of the same size. The function expands the scalar inputs to match the size of the array inputs.

Data Types: `single` | `double`

Azimuth from the input point to the output point, measured clockwise from north, specified as a scalar or array.

You can specify `lat1`, `lon1`, `arclen`, and `az` using a combination of scalars and arrays, as long as the arrays are of the same size. The function expands the scalar inputs to match the size of the array inputs.

Data Types: `single` | `double`

Length of the arc connecting the input point and output point, specified as a scalar or array.

• When you do not specify a reference ellipsoid as input, specify `arclen` as a spherical distance in degrees. You can specify a spherical distance in radians by using the `units` argument.

• When you specify a reference ellipsoid as input, specify `arclen` as a linear distance in the units of the semimajor axis of the ellipsoid.

You can specify `lat1`, `lon1`, `arclen`, and `az` using a combination of scalars and arrays, as long as the arrays are of the same size. The function expands the scalar inputs to match the size of the array inputs.

Data Types: `single` | `double`

Angle unit, specified as one of these options:

• `"degrees"` — Degrees

• `"radians"` — Radians

If you do not specify a reference ellipsoid, this argument determines the angle units for the coordinates, arc length, and azimuth. If you specify a reference ellipsoid, this argument only determines the angle units for the coordinates and the azimuth.

Data Types: `char` | `string`

Reference ellipsoid, specified as a `referenceSphere` object, a `referenceEllipsoid` object, an `oblateSpheroid` object, or a two-element vector of the form `[semimajor_axis eccentricity]`, where `semimajor_axis` is the length of the semimajor axis and `eccentricity` is the eccentricity. The values `semimajor_axis` and `eccentricity` must be of data type `double`.

The default value of `[1 0]` represents the unit sphere.

Type of curve connecting the input point and output point, specified as one of these options:

• `"gc"``az` is a great circle azimuth (for spheres) or a geodesic azimuth (for ellipsoids).

• `"rh"``az` is a rhumb line azimuth.

For more information about rhumb lines and great circles, see Comparison of Rhumb Lines and Great Circles.

Data Types: `char` | `string`

## Output Arguments

collapse all

Latitude of the output point, returned as a scalar or an array that matches the size of the largest latitude or longitude input.

Longitude of the output point, returned as a scalar or an array that matches the size of the largest latitude or longitude input.

## Version History

Introduced before R2006a