bearing

bearing(fs, lat, lon)
bearing(fs, coords)

Computes the bearing for each grid point in fs with reference to the given location.

Parameters
  • fs (Fieldset) – input fieldset

  • lat (number) – latitude of the reference point

  • lon (number) – longitude of the reference point

  • coords (list) – coordinates of the reference point as [lat, lon]

Return type

Fieldset

The bearing is the angle between the Northward meridian going through the reference point and the great circle connecting the reference point and the given gridpoint. It is measured in degrees clockwise from North. If a gridpoint is located on the same latitude as the reference point the bearing is regarded constant: it is either 90° (East) or 270° (West). If the gridpoint is co-located with the reference point the bearing is set to a missing value. The reference location should be specified in degrees.