destination
Description
Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. This uses the Haversine formula to account for global curvature.
Parameters
Name | Type | Description |
---|---|---|
origin | Coord | starting point |
distance | number | distance from the origin point |
bearing | number | ranging from -180 to 180 |
options? | Object | Optional parameters (default {}) |
options.units? | string | miles, kilometers, degrees, or radians (default 'kilometers') |
options.properties? | Object | Translate properties to Point (default {}) |
Returns
Examples
var point = turf.point([-75.343, 39.984]);
var distance = 50;
var bearing = 90;
var options = { units: "miles" };
var destination = turf.destination(point, distance, bearing, options);
Installation
$ npm install @turf/destination
import { destination } from "@turf/destination";
const result = destination(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.destination(...);