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

@turf/helpers

Package Overview
Dependencies
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/helpers - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

11

index.d.ts

@@ -77,3 +77,3 @@ /// <reference types="geojson" />

/**
* http://turfjs.org/docs/
* http://turfjs.org/docs/#radianstodistance
*/

@@ -83,3 +83,3 @@ export function radiansToDistance(radians: number, units?: Units): number

/**
* http://turfjs.org/docs/
* http://turfjs.org/docs/#distancetoradians
*/

@@ -89,4 +89,9 @@ export function distanceToRadians(distance: number, units?: Units): number

/**
* http://turfjs.org/docs/
* http://turfjs.org/docs/#distancetodegrees
*/
export function distanceToDegrees(distance: number, units?: Units): number
/**
* http://turfjs.org/docs/#bearingtoangle
*/
export function bearingToAngle(alpha: number): number

@@ -322,2 +322,20 @@ /**

/**
* Converts any bearing angle from the north line direction (positive clockwise)
* and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
*
* @name bearingToAngle
* @param {number} alpha angle
* @returns {number} angle between 0 and 360 degrees
*/
function bearingToAngle(alpha) {
var beta = alpha % 360;
if (beta < 0) {
beta += 360;
}
return beta;
}
module.exports = {

@@ -335,3 +353,4 @@ feature: feature,

distanceToRadians: distanceToRadians,
distanceToDegrees: distanceToDegrees
distanceToDegrees: distanceToDegrees,
bearingToAngle: bearingToAngle
};
{
"name": "@turf/helpers",
"version": "4.1.0",
"version": "4.2.0",
"description": "turf helpers module",

@@ -32,2 +32,3 @@ "main": "index.js",

"devDependencies": {
"@turf/distance": "^4.2.0",
"benchmark": "^2.1.3",

@@ -34,0 +35,0 @@ "tape": "^3.5.0"

@@ -265,2 +265,13 @@ # @turf/helpers

# bearingToAngle
Converts any bearing angle from the north line direction (positive clockwise)
and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
**Parameters**
- `alpha` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle between 0 and 360 degrees
<!-- This file is automatically generated. Please don't edit it directly:

@@ -267,0 +278,0 @@ if you find an error, edit the source file (likely index.js), and re-run

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