Learn R Programming

swfscMisc (version 1.1)

destination: Destination on Sphere or Ellipsoid

Description

Calculates latitude and longitude of the destination along a sphere or ellipsoid.

Usage

destination(lat, lon, brng, distance, units = c("nm", "km", "mi"), ellipsoid = datum(), radius = convert.distance(6371, "km", "nm"), type = c("ellipsoid", "sphere", "vincenty"))

Arguments

lat, lon
numeric. The latitude and longitude of the coordinate in decimal degrees.
brng
numeric. The bearing, ranging from 0 to 360 degrees.
distance
numeric. The distance travelled, in units specified by units.
units
units of distance. Can be "km" (kilometers), "nm" (nautical miles), or "mi" (statute miles), or any partial match thereof (case sensitive).
ellipsoid
ellipsoid model parameters as returned from a call to datum.
radius
numeric. Define the radius for type = "sphere". In units of units.
type
Character defining type of surface. Can be "sphere", "ellipsoid", "vincenty", or partial match thereof (case-sensitive).

Value

latitude and longitude of destination.

References

Ellipsoid code adapted from JavaScript by Larry Bogan http://adsabs.harvard.edu/full/2000JRASC..94...48B. Vincenty code adapted from JavaScript by Chris Veness http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html Vincenty, T. 1975. Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations. Survey Review 22(176):88-93 http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf.

Examples

Run this code
destination(32.87, -117.25, 262, 4174, units = "km", type = "sphere")
destination(32.87, -117.25, 262, 4174, units = "km", type = "ellipsoid")
destination(32.87, -117.25, 262, 4174, units = "km", type = "vincenty")

Run the code above in your browser using DataLab