@turf/rhumb-distance
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -36,3 +36,3 @@ "use strict"; | ||
var distanceInMeters = calculateRhumbDistance(origin, destination); | ||
var distance = helpers_1.convertLength(distanceInMeters, 'meters', options.units); | ||
var distance = helpers_1.convertLength(distanceInMeters, "meters", options.units); | ||
return distance; | ||
@@ -70,4 +70,5 @@ } | ||
// if dLon over 180° take shorter rhumb line across the anti-meridian: | ||
if (DeltaLambda > Math.PI) | ||
if (DeltaLambda > Math.PI) { | ||
DeltaLambda -= 2 * Math.PI; | ||
} | ||
// on Mercator projection, longitude distances shrink by latitude; q is the 'stretch factor' | ||
@@ -74,0 +75,0 @@ // q becomes ill-conditioned along E-W line (0/0); use empirical tolerance to avoid it |
{ | ||
"name": "@turf/rhumb-distance", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "turf rhumb-distance module", | ||
"main": "index", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.ts" | ||
"index.d.ts" | ||
], | ||
@@ -47,3 +48,5 @@ "scripts": { | ||
"tape": "*", | ||
"write-json-file": "*" | ||
"write-json-file": "*", | ||
"tslint": "*", | ||
"@types/tape": "*" | ||
}, | ||
@@ -50,0 +53,0 @@ "dependencies": { |
@@ -7,3 +7,3 @@ # @turf/rhumb-distance | ||
Calculates the distance along a rhumb line between two [points](https://tools.ietf.org/html/rfc7946#section-3.1.2) in degrees, radians, | ||
Calculates the distance along a rhumb line between two [points][1] in degrees, radians, | ||
miles, or kilometers. | ||
@@ -13,6 +13,6 @@ | ||
- `from` **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** origin point | ||
- `to` **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** destination point | ||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional parameters | ||
- `options.units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) | ||
- `from` **[Coord][2]** origin point | ||
- `to` **[Coord][2]** destination point | ||
- `options` **[Object][3]?** Optional parameters | ||
- `options.units` **[string][4]** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) | ||
@@ -34,4 +34,14 @@ **Examples** | ||
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance between the two points | ||
Returns **[number][5]** distance between the two points | ||
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 | ||
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.1 | ||
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object | ||
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String | ||
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number | ||
<!-- This file is automatically generated. Please don't edit it directly: | ||
@@ -38,0 +48,0 @@ if you find an error, edit the source file (likely index.js), and re-run |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68
0
8669
8
108