Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/bearing

Package Overview
Dependencies
Maintainers
4
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/bearing - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

21

index.js

@@ -6,3 +6,4 @@ var getCoord = require('@turf/invariant').getCoord;

/**
* Takes two {@link Point|points} and finds the geographic bearing between them.
* Takes two {@link Point|points} and finds the geographic bearing between them,
* i.e. the angle measured in degrees from the north line (0 degrees)
*

@@ -13,10 +14,7 @@ * @name bearing

* @param {boolean} [final=false] calculates the final bearing if true
* @returns {number} bearing in decimal degrees
* @addToMap point1, point2
* @returns {number} bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)
* @example
* var point1 = {
* "type": "Feature",
* "properties": {
* "marker-color": '#f00'
* },
* "properties": {},
* "geometry": {

@@ -29,5 +27,3 @@ * "type": "Point",

* "type": "Feature",
* "properties": {
* "marker-color": '#0f0'
* },
* "properties": {},
* "geometry": {

@@ -40,5 +36,10 @@ * "type": "Point",

* var bearing = turf.bearing(point1, point2);
*
* //addToMap
* var addToMap = [point1, point2]
* point1.properties['marker-color'] = '#f00'
* point2.properties['marker-color'] = '#0f0'
* point1.properties.bearing = bearing
* //=bearing
*/
function bearing(start, end, final) {

@@ -45,0 +46,0 @@ if (final === true) return calculateFinalBearing(start, end);

{
"name": "@turf/bearing",
"version": "4.1.0",
"version": "4.2.0",
"description": "turf bearing module",

@@ -30,4 +30,4 @@ "main": "index.js",

"devDependencies": {
"@turf/destination": "^4.1.0",
"@turf/helpers": "^4.1.0",
"@turf/destination": "^4.2.0",
"@turf/helpers": "^4.2.0",
"benchmark": "^1.0.0",

@@ -38,4 +38,4 @@ "tape": "^3.5.0",

"dependencies": {
"@turf/invariant": "^4.1.0"
"@turf/invariant": "^4.2.0"
}
}

@@ -5,3 +5,4 @@ # @turf/bearing

Takes two [points](http://geojson.org/geojson-spec.html#point) and finds the geographic bearing between them.
Takes two [points](http://geojson.org/geojson-spec.html#point) and finds the geographic bearing between them,
i.e. the angle measured in degrees from the north line (0 degrees)

@@ -19,5 +20,3 @@ **Parameters**

"type": "Feature",
"properties": {
"marker-color": '#f00'
},
"properties": {},
"geometry": {

@@ -30,5 +29,3 @@ "type": "Point",

"type": "Feature",
"properties": {
"marker-color": '#0f0'
},
"properties": {},
"geometry": {

@@ -41,7 +38,11 @@ "type": "Point",

var bearing = turf.bearing(point1, point2);
//addToMap
var addToMap = [point1, point2]
point1.properties['marker-color'] = '#f00'
point2.properties['marker-color'] = '#0f0'
point1.properties.bearing = bearing
//=bearing
```
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** bearing in decimal degrees
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)

@@ -48,0 +49,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc