Package Exports
- @turf/bearing
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@turf/bearing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@turf/bearing
bearing
Takes two points and finds the geographic bearing between them.
Parameters
startFeature<Point> starting PointendFeature<Point> ending Pointfinal[boolean] calculates the final bearing if true (optional, defaultfalse)
Examples
var point1 = {
"type": "Feature",
"properties": {
"marker-color": '#f00'
},
"geometry": {
"type": "Point",
"coordinates": [-75.343, 39.984]
}
};
var point2 = {
"type": "Feature",
"properties": {
"marker-color": '#0f0'
},
"geometry": {
"type": "Point",
"coordinates": [-75.534, 39.123]
}
};
var bearing = turf.bearing(point1, point2);
//=bearingReturns number bearing in decimal degrees
calculateFinalBearing
Calculates Final Bearing
Parameters
Returns number bearing
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/bearingOr install the Turf module that includes it as a function:
$ npm install @turf/turf