@turf/kinks
Advanced tools
Comparing version 6.2.0-alpha.2 to 6.2.0-alpha.3
@@ -101,3 +101,5 @@ import { point } from "@turf/helpers"; | ||
}; | ||
denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY)); | ||
denominator = | ||
(line2EndY - line2StartY) * (line1EndX - line1StartX) - | ||
(line2EndX - line2StartX) * (line1EndY - line1StartY); | ||
if (denominator === 0) { | ||
@@ -113,9 +115,9 @@ if (result.x !== null && result.y !== null) { | ||
b = line1StartX - line2StartX; | ||
numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b); | ||
numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b); | ||
numerator1 = (line2EndX - line2StartX) * a - (line2EndY - line2StartY) * b; | ||
numerator2 = (line1EndX - line1StartX) * a - (line1EndY - line1StartY) * b; | ||
a = numerator1 / denominator; | ||
b = numerator2 / denominator; | ||
// if we cast these lines infinitely in both directions, they intersect here: | ||
result.x = line1StartX + (a * (line1EndX - line1StartX)); | ||
result.y = line1StartY + (a * (line1EndY - line1StartY)); | ||
result.x = line1StartX + a * (line1EndX - line1StartX); | ||
result.y = line1StartY + a * (line1EndY - line1StartY); | ||
// if line1 is a segment and line2 is infinite, they intersect if: | ||
@@ -122,0 +124,0 @@ if (a >= 0 && a <= 1) { |
@@ -104,3 +104,5 @@ "use strict"; | ||
}; | ||
denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY)); | ||
denominator = | ||
(line2EndY - line2StartY) * (line1EndX - line1StartX) - | ||
(line2EndX - line2StartX) * (line1EndY - line1StartY); | ||
if (denominator === 0) { | ||
@@ -116,9 +118,9 @@ if (result.x !== null && result.y !== null) { | ||
b = line1StartX - line2StartX; | ||
numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b); | ||
numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b); | ||
numerator1 = (line2EndX - line2StartX) * a - (line2EndY - line2StartY) * b; | ||
numerator2 = (line1EndX - line1StartX) * a - (line1EndY - line1StartY) * b; | ||
a = numerator1 / denominator; | ||
b = numerator2 / denominator; | ||
// if we cast these lines infinitely in both directions, they intersect here: | ||
result.x = line1StartX + (a * (line1EndX - line1StartX)); | ||
result.y = line1StartY + (a * (line1EndY - line1StartY)); | ||
result.x = line1StartX + a * (line1EndX - line1StartX); | ||
result.y = line1StartY + a * (line1EndY - line1StartY); | ||
// if line1 is a segment and line2 is infinite, they intersect if: | ||
@@ -125,0 +127,0 @@ if (a >= 0 && a <= 1) { |
{ | ||
"name": "@turf/kinks", | ||
"version": "6.2.0-alpha.2", | ||
"version": "6.2.0-alpha.3", | ||
"description": "turf kinks module", | ||
@@ -25,2 +25,6 @@ "author": "Turf Authors", | ||
"module": "dist/es/index.js", | ||
"exports": { | ||
"import": "./dist/es/index.js", | ||
"require": "./dist/js/index.js" | ||
}, | ||
"types": "dist/js/index.d.ts", | ||
@@ -32,14 +36,13 @@ "sideEffects": false, | ||
"scripts": { | ||
"bench": "npm-run-all prepare bench:run", | ||
"bench:run": "node bench.js", | ||
"bench": "ts-node bench.js", | ||
"build": "npm-run-all build:*", | ||
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json", | ||
"build:js": "tsc", | ||
"docs": "node ../../scripts/generate-readmes", | ||
"prepare": "npm-run-all prepare:*", | ||
"prepare:es": "tsc --outDir dist/es --module esnext --declaration false", | ||
"prepare:js": "tsc", | ||
"test": "npm-run-all prepare test:*", | ||
"test:tape": "node -r esm test.js", | ||
"test:types": "tsc --noEmit types.ts" | ||
"test": "npm-run-all test:*", | ||
"test:tape": "ts-node -r esm test.js", | ||
"test:types": "tsc --esModuleInterop --noEmit types.ts" | ||
}, | ||
"devDependencies": { | ||
"@turf/meta": "^6.2.0-alpha.2", | ||
"@turf/meta": "^6.2.0-alpha.3", | ||
"benchmark": "*", | ||
@@ -49,2 +52,3 @@ "load-json-file": "*", | ||
"tape": "*", | ||
"ts-node": "*", | ||
"typescript": "*", | ||
@@ -54,5 +58,5 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/helpers": "^6.2.0-alpha.2" | ||
"@turf/helpers": "^6.2.0-alpha.3" | ||
}, | ||
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09" | ||
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409" | ||
} |
15759
7
299
8
Updated@turf/helpers@^6.2.0-alpha.3