@turf/angle 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +16 -16
package/dist/cjs/index.cjs
CHANGED
|
@@ -33,9 +33,9 @@ function angle(startPoint, midPoint, endPoint, options = {}) {
|
|
|
33
33
|
}
|
|
34
34
|
return angleAOB;
|
|
35
35
|
}
|
|
36
|
-
var
|
|
36
|
+
var index_default = angle;
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
exports.angle = angle; exports.default =
|
|
40
|
+
exports.angle = angle; exports.default = index_default;
|
|
41
41
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-angle/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACAA,wCAAwB;AACxB,wCAAkD;AAClD,mDAA6B;AAkB7B,SAAS,KAAA,CACP,UAAA,EACA,QAAA,EACA,QAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACG;AAER,EAAA,GAAA,CAAI,CAAC,+BAAA,OAAgB,CAAA,EAAG;AACtB,IAAA,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA;AAAA,EACtC;AAGA,EAAA,GAAA,CAAI,CAAC,UAAA,EAAY;AACf,IAAA,MAAM,IAAI,KAAA,CAAM,wBAAwB,CAAA;AAAA,EAC1C;AACA,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU;AACb,IAAA,MAAM,IAAI,KAAA,CAAM,sBAAsB,CAAA;AAAA,EACxC;AACA,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU;AACb,IAAA,MAAM,IAAI,KAAA,CAAM,sBAAsB,CAAA;AAAA,EACxC;AA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;AACb,IAAA,MAAM,IAAI,KAAA,CAAM,sBAAsB,CAAA;AAAA,EACxC;AACA,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU;AACb,IAAA,MAAM,IAAI,KAAA,CAAM,sBAAsB,CAAA;AAAA,EACxC;AAGA,EAAA,MAAM,EAAA,EAAI,UAAA;AACV,EAAA,MAAM,EAAA,EAAI,QAAA;AACV,EAAA,MAAM,EAAA,EAAI,QAAA;AAGV,EAAA,MAAM,UAAA,EAAY,uCAAA;AAAA,IAChB,OAAA,CAAQ,SAAA,IAAa,KAAA,EAAO,8BAAA,CAAQ,EAAG,CAAC,EAAA,EAAI,wCAAA,CAAa,EAAG,CAAC;AAAA,EAC/D,CAAA;AACA,EAAA,IAAI,UAAA,EAAY,uCAAA;AAAA,IACd,OAAA,CAAQ,SAAA,IAAa,KAAA,EAAO,8BAAA,CAAQ,EAAG,CAAC,EAAA,EAAI,wCAAA,CAAa,EAAG,CAAC;AAAA,EAC/D,CAAA;AAEA,EAAA,GAAA,CAAI,UAAA,EAAY,SAAA,EAAW;AACzB,IAAA,UAAA,EAAY,UAAA,EAAY,GAAA;AAAA,EAC1B;AACA,EAAA,MAAM,SAAA,EAAW,UAAA,EAAY,SAAA;AAG7B,EAAA,GAAA,CAAI,OAAA,CAAQ,aAAA,IAAiB,IAAA,EAAM;AACjC,IAAA,OAAO,IAAA,EAAM,QAAA;AAAA,EACf;AACA,EAAA,OAAO,QAAA;AACT;AAGA,IAAO,cAAA,EAAQ,KAAA;ADnCf;AACE;AACA;AACF,uDAAC","file":"/home/runner/work/turf/turf/packages/turf-angle/dist/cjs/index.cjs","sourcesContent":[null,"import { bearing } from \"@turf/bearing\";\nimport { bearingToAzimuth, Coord, isObject } from \"@turf/helpers\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\n\n/**\n * Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)\n * angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.\n *\n * @function\n * @param {Coord} startPoint Start Point Coordinates\n * @param {Coord} midPoint Mid Point Coordinates\n * @param {Coord} endPoint End Point Coordinates\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)\n * @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection\n * @returns {number} Angle between the provided points, or its explementary.\n * @example\n * turf.angle([5, 5], [5, 6], [3, 4]);\n * //=45\n */\nfunction angle(\n startPoint: Coord,\n midPoint: Coord,\n endPoint: Coord,\n options: {\n explementary?: boolean;\n mercator?: boolean;\n } = {}\n): number {\n // Optional Parameters\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n\n // Validation\n if (!startPoint) {\n throw new Error(\"startPoint is required\");\n }\n if (!midPoint) {\n throw new Error(\"midPoint is required\");\n }\n if (!endPoint) {\n throw new Error(\"endPoint is required\");\n }\n\n // Rename to shorter variables\n const A = startPoint;\n const O = midPoint;\n const B = endPoint;\n\n // Main\n const azimuthOA = bearingToAzimuth(\n options.mercator !== true ? bearing(O, A) : rhumbBearing(O, A)\n );\n let azimuthOB = bearingToAzimuth(\n options.mercator !== true ? bearing(O, B) : rhumbBearing(O, B)\n );\n // If OB \"trails\" OA advance OB one revolution so we get the clockwise angle.\n if (azimuthOB < azimuthOA) {\n azimuthOB = azimuthOB + 360;\n }\n const angleAOB = azimuthOB - azimuthOA;\n\n // Explementary angle\n if (options.explementary === true) {\n return 360 - angleAOB;\n }\n return angleAOB;\n}\n\nexport { angle };\nexport default angle;\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -33,9 +33,9 @@ function angle(startPoint, midPoint, endPoint, options = {}) {
|
|
|
33
33
|
}
|
|
34
34
|
return angleAOB;
|
|
35
35
|
}
|
|
36
|
-
var
|
|
36
|
+
var index_default = angle;
|
|
37
37
|
export {
|
|
38
38
|
angle,
|
|
39
|
-
|
|
39
|
+
index_default as default
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { bearing } from \"@turf/bearing\";\nimport { bearingToAzimuth, Coord, isObject } from \"@turf/helpers\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\n\n/**\n * Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)\n * angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.\n *\n * @function\n * @param {Coord} startPoint Start Point Coordinates\n * @param {Coord} midPoint Mid Point Coordinates\n * @param {Coord} endPoint End Point Coordinates\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)\n * @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection\n * @returns {number} Angle between the provided points, or its explementary.\n * @example\n * turf.angle([5, 5], [5, 6], [3, 4]);\n * //=45\n */\nfunction angle(\n startPoint: Coord,\n midPoint: Coord,\n endPoint: Coord,\n options: {\n explementary?: boolean;\n mercator?: boolean;\n } = {}\n): number {\n // Optional Parameters\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n\n // Validation\n if (!startPoint) {\n throw new Error(\"startPoint is required\");\n }\n if (!midPoint) {\n throw new Error(\"midPoint is required\");\n }\n if (!endPoint) {\n throw new Error(\"endPoint is required\");\n }\n\n // Rename to shorter variables\n const A = startPoint;\n const O = midPoint;\n const B = endPoint;\n\n // Main\n const azimuthOA = bearingToAzimuth(\n options.mercator !== true ? bearing(O, A) : rhumbBearing(O, A)\n );\n let azimuthOB = bearingToAzimuth(\n options.mercator !== true ? bearing(O, B) : rhumbBearing(O, B)\n );\n // If OB \"trails\" OA advance OB one revolution so we get the clockwise angle.\n if (azimuthOB < azimuthOA) {\n azimuthOB = azimuthOB + 360;\n }\n const angleAOB = azimuthOB - azimuthOA;\n\n // Explementary angle\n if (options.explementary === true) {\n return 360 - angleAOB;\n }\n return angleAOB;\n}\n\nexport { angle };\nexport default angle;\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,kBAAyB,gBAAgB;AAClD,SAAS,oBAAoB;AAkB7B,SAAS,MACP,YACA,UACA,UACA,UAGI,CAAC,GACG;AAER,MAAI,CAAC,SAAS,OAAO,GAAG;AACtB,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACtC;AAGA,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAGA,QAAM,IAAI;AACV,QAAM,IAAI;AACV,QAAM,IAAI;AAGV,QAAM,YAAY;AAAA,IAChB,QAAQ,aAAa,OAAO,QAAQ,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC;AAAA,EAC/D;AACA,MAAI,YAAY;AAAA,IACd,QAAQ,aAAa,OAAO,QAAQ,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC;AAAA,EAC/D;AAEA,MAAI,YAAY,WAAW;AACzB,gBAAY,YAAY;AAAA,EAC1B;AACA,QAAM,WAAW,YAAY;AAG7B,MAAI,QAAQ,iBAAiB,MAAM;AACjC,WAAO,MAAM;AAAA,EACf;AACA,SAAO;AACT;AAGA,IAAO,
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { bearing } from \"@turf/bearing\";\nimport { bearingToAzimuth, Coord, isObject } from \"@turf/helpers\";\nimport { rhumbBearing } from \"@turf/rhumb-bearing\";\n\n/**\n * Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)\n * angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.\n *\n * @function\n * @param {Coord} startPoint Start Point Coordinates\n * @param {Coord} midPoint Mid Point Coordinates\n * @param {Coord} endPoint End Point Coordinates\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)\n * @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection\n * @returns {number} Angle between the provided points, or its explementary.\n * @example\n * turf.angle([5, 5], [5, 6], [3, 4]);\n * //=45\n */\nfunction angle(\n startPoint: Coord,\n midPoint: Coord,\n endPoint: Coord,\n options: {\n explementary?: boolean;\n mercator?: boolean;\n } = {}\n): number {\n // Optional Parameters\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n\n // Validation\n if (!startPoint) {\n throw new Error(\"startPoint is required\");\n }\n if (!midPoint) {\n throw new Error(\"midPoint is required\");\n }\n if (!endPoint) {\n throw new Error(\"endPoint is required\");\n }\n\n // Rename to shorter variables\n const A = startPoint;\n const O = midPoint;\n const B = endPoint;\n\n // Main\n const azimuthOA = bearingToAzimuth(\n options.mercator !== true ? bearing(O, A) : rhumbBearing(O, A)\n );\n let azimuthOB = bearingToAzimuth(\n options.mercator !== true ? bearing(O, B) : rhumbBearing(O, B)\n );\n // If OB \"trails\" OA advance OB one revolution so we get the clockwise angle.\n if (azimuthOB < azimuthOA) {\n azimuthOB = azimuthOB + 360;\n }\n const angleAOB = azimuthOB - azimuthOA;\n\n // Explementary angle\n if (options.explementary === true) {\n return 360 - angleAOB;\n }\n return angleAOB;\n}\n\nexport { angle };\nexport default angle;\n"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,kBAAyB,gBAAgB;AAClD,SAAS,oBAAoB;AAkB7B,SAAS,MACP,YACA,UACA,UACA,UAGI,CAAC,GACG;AAER,MAAI,CAAC,SAAS,OAAO,GAAG;AACtB,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACtC;AAGA,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAGA,QAAM,IAAI;AACV,QAAM,IAAI;AACV,QAAM,IAAI;AAGV,QAAM,YAAY;AAAA,IAChB,QAAQ,aAAa,OAAO,QAAQ,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC;AAAA,EAC/D;AACA,MAAI,YAAY;AAAA,IACd,QAAQ,aAAa,OAAO,QAAQ,GAAG,CAAC,IAAI,aAAa,GAAG,CAAC;AAAA,EAC/D;AAEA,MAAI,YAAY,WAAW;AACzB,gBAAY,YAAY;AAAA,EAC1B;AACA,QAAM,WAAW,YAAY;AAG7B,MAAI,QAAQ,iBAAiB,MAAM;AACjC,WAAO,MAAM;AAAA,EACf;AACA,SAAO;AACT;AAGA,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/angle",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Finds the angle formed by two adjacent segments.",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Denis <@DenisCarriere>"
|
|
@@ -52,28 +52,28 @@
|
|
|
52
52
|
"test:tape": "tsx test.ts"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@turf/distance": "
|
|
56
|
-
"@turf/sector": "
|
|
57
|
-
"@turf/truncate": "
|
|
55
|
+
"@turf/distance": "7.3.0",
|
|
56
|
+
"@turf/sector": "7.3.0",
|
|
57
|
+
"@turf/truncate": "7.3.0",
|
|
58
58
|
"@types/benchmark": "^2.1.5",
|
|
59
|
-
"@types/tape": "^
|
|
59
|
+
"@types/tape": "^5.8.1",
|
|
60
60
|
"benchmark": "^2.1.4",
|
|
61
|
-
"glob": "^
|
|
61
|
+
"glob": "^11.0.2",
|
|
62
62
|
"load-json-file": "^7.0.1",
|
|
63
63
|
"npm-run-all": "^4.1.5",
|
|
64
64
|
"tape": "^5.9.0",
|
|
65
|
-
"tsup": "^8.
|
|
66
|
-
"tsx": "^4.19.
|
|
67
|
-
"typescript": "^5.
|
|
68
|
-
"write-json-file": "^
|
|
65
|
+
"tsup": "^8.4.0",
|
|
66
|
+
"tsx": "^4.19.4",
|
|
67
|
+
"typescript": "^5.8.3",
|
|
68
|
+
"write-json-file": "^6.0.0"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@turf/bearing": "
|
|
72
|
-
"@turf/helpers": "
|
|
73
|
-
"@turf/invariant": "
|
|
74
|
-
"@turf/rhumb-bearing": "
|
|
71
|
+
"@turf/bearing": "7.3.0",
|
|
72
|
+
"@turf/helpers": "7.3.0",
|
|
73
|
+
"@turf/invariant": "7.3.0",
|
|
74
|
+
"@turf/rhumb-bearing": "7.3.0",
|
|
75
75
|
"@types/geojson": "^7946.0.10",
|
|
76
76
|
"tslib": "^2.8.1"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
|
|
79
79
|
}
|