@turf/line-arc 7.1.0 → 7.2.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.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +12 -12
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-line-arc/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,sCAAuB;AACvB,gDAA4B;AAC5B,wCAAyC;AA0BzC,SAAS,OAAA,CACP,MAAA,EACA,MAAA,EACA,QAAA,EACA,QAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACgB;AAErB,EAAA,MAAM,MAAA,EAAQ,OAAA,CAAQ,MAAA,GAAS,EAAA;AAE/B,EAAA,MAAM,OAAA,EAAS,iBAAA,CAAkB,QAAQ,CAAA;AACzC,EAAA,MAAM,OAAA,EAAS,iBAAA,CAAkB,QAAQ,CAAA;AACzC,EAAA,MAAM,WAAA,EACJ,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,EAAA,GAAK,MAAA,CAAO,KAAA,IAAS,UAAA,EACtC,MAAA,CAAO,WAAA,EACP,CAAC,CAAA;AAGP,EAAA,GAAA,CAAI,OAAA,IAAW,MAAA,EAAQ;AACrB,IAAA,OAAO,iCAAA;AAAA,MACL,4BAAA,MAAO,EAAQ,MAAA,EAAQ,OAAO,CAAA,CAAE,QAAA,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,MACtD;AAAA,IACF,CAAA;AAAA,EACF;AACA,EAAA,MAAM,eAAA,EAAiB,MAAA;AACvB,EAAA,MAAM,aAAA,EAAe,OAAA,EAAS,OAAA,EAAS,OAAA,EAAS,OAAA,EAAS,GAAA;AAEzD,EAAA,IAAI,MAAA,EAAQ,cAAA;AACZ,EAAA,MAAM,YAAA,EAAc,CAAC,CAAA;AACrB,EAAA,IAAI,EAAA,EAAI,CAAA;AAER,EAAA,MAAM,QAAA,EAAA,CAAW,aAAA,EAAe,cAAA,EAAA,EAAkB,KAAA;AAGlD,EAAA,MAAA,CAAO,MAAA,GAAS,YAAA,EAAc;AAC5B,IAAA,WAAA,CAAY,IAAA;AAAA,MACV,sCAAA,MAAY,EAAQ,MAAA,EAAQ,KAAA,EAAO,OAAO,CAAA,CAAE,QAAA,CAAS;AAAA,IACvD,CAAA;AACA,IAAA,CAAA,EAAA;AACA,IAAA,MAAA,EAAQ,eAAA,EAAiB,EAAA,EAAI,OAAA;AAAA,EAC/B;AACA,EAAA,OAAO,iCAAA,WAAW,EAAa,UAAU,CAAA;AAC3C;AAUA,SAAS,iBAAA,CAAkB,KAAA,EAAe;AACxC,EAAA,IAAI,KAAA,EAAO,MAAA,EAAQ,GAAA;AACnB,EAAA,GAAA,CAAI,KAAA,EAAO,CAAA,EAAG;AACZ,IAAA,KAAA,GAAQ,GAAA;AAAA,EACV;AACA,EAAA,OAAO,IAAA;AACT;AAGA,IAAO,sBAAA,EAAQ,OAAA;ADvDf;AACE;AACA;AACF,mEAAC","file":"/home/runner/work/turf/turf/packages/turf-line-arc/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, LineString } from \"geojson\";\nimport { circle } from \"@turf/circle\";\nimport { destination } from \"@turf/destination\";\nimport { Coord, lineString, Units } from \"@turf/helpers\";\n\n/**\n * Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;\n * 0 bearing is North of center point, positive clockwise.\n *\n * @function\n * @param {Coord} center center point\n * @param {number} radius radius of the circle\n * @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc\n * @param {number} bearing2 angle, in decimal degrees, of the second radius of the arc\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps (straight segments) that will constitute the arc\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @returns {Feature<LineString>} line arc\n * @example\n * var center = turf.point([-75, 40]);\n * var radius = 5;\n * var bearing1 = 25;\n * var bearing2 = 47;\n *\n * var arc = turf.lineArc(center, radius, bearing1, bearing2);\n *\n * //addToMap\n * var addToMap = [center, arc]\n */\nfunction lineArc(\n center: Coord,\n radius: number,\n bearing1: number,\n bearing2: number,\n options: {\n steps?: number;\n units?: Units;\n } = {}\n): Feature<LineString> {\n // default params\n const steps = options.steps || 64;\n\n const angle1 = convertAngleTo360(bearing1);\n const angle2 = convertAngleTo360(bearing2);\n const properties =\n !Array.isArray(center) && center.type === \"Feature\"\n ? center.properties\n : {};\n\n // handle angle parameters\n if (angle1 === angle2) {\n return lineString(\n circle(center, radius, options).geometry.coordinates[0],\n properties\n );\n }\n const arcStartDegree = angle1;\n const arcEndDegree = angle1 < angle2 ? angle2 : angle2 + 360;\n\n let alpha = arcStartDegree;\n const coordinates = [];\n let i = 0;\n // How many degrees we'll swing around between each step.\n const arcStep = (arcEndDegree - arcStartDegree) / steps;\n // Add coords to the list, increasing the angle from our start bearing\n // (alpha) by arcStep degrees until we reach the end bearing.\n while (alpha <= arcEndDegree) {\n coordinates.push(\n destination(center, radius, alpha, options).geometry.coordinates\n );\n i++;\n alpha = arcStartDegree + i * arcStep;\n }\n return lineString(coordinates, properties);\n}\n\n/**\n * Takes any angle in degrees\n * and returns a valid angle between 0-360 degrees\n *\n * @private\n * @param {number} alpha angle between -180-180 degrees\n * @returns {number} angle between 0-360 degrees\n */\nfunction convertAngleTo360(alpha: number) {\n let beta = alpha % 360;\n if (beta < 0) {\n beta += 360;\n }\n return beta;\n}\n\nexport { lineArc };\nexport default lineArc;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { Coord, Units } from '@turf/helpers';
|
|
|
5
5
|
* Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;
|
|
6
6
|
* 0 bearing is North of center point, positive clockwise.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @function
|
|
9
9
|
* @param {Coord} center center point
|
|
10
10
|
* @param {number} radius radius of the circle
|
|
11
11
|
* @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Coord, Units } from '@turf/helpers';
|
|
|
5
5
|
* Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;
|
|
6
6
|
* 0 bearing is North of center point, positive clockwise.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @function
|
|
9
9
|
* @param {Coord} center center point
|
|
10
10
|
* @param {number} radius radius of the circle
|
|
11
11
|
* @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, LineString } from \"geojson\";\nimport { circle } from \"@turf/circle\";\nimport { destination } from \"@turf/destination\";\nimport { Coord, lineString, Units } from \"@turf/helpers\";\n\n/**\n * Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;\n * 0 bearing is North of center point, positive clockwise.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, LineString } from \"geojson\";\nimport { circle } from \"@turf/circle\";\nimport { destination } from \"@turf/destination\";\nimport { Coord, lineString, Units } from \"@turf/helpers\";\n\n/**\n * Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;\n * 0 bearing is North of center point, positive clockwise.\n *\n * @function\n * @param {Coord} center center point\n * @param {number} radius radius of the circle\n * @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc\n * @param {number} bearing2 angle, in decimal degrees, of the second radius of the arc\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps (straight segments) that will constitute the arc\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @returns {Feature<LineString>} line arc\n * @example\n * var center = turf.point([-75, 40]);\n * var radius = 5;\n * var bearing1 = 25;\n * var bearing2 = 47;\n *\n * var arc = turf.lineArc(center, radius, bearing1, bearing2);\n *\n * //addToMap\n * var addToMap = [center, arc]\n */\nfunction lineArc(\n center: Coord,\n radius: number,\n bearing1: number,\n bearing2: number,\n options: {\n steps?: number;\n units?: Units;\n } = {}\n): Feature<LineString> {\n // default params\n const steps = options.steps || 64;\n\n const angle1 = convertAngleTo360(bearing1);\n const angle2 = convertAngleTo360(bearing2);\n const properties =\n !Array.isArray(center) && center.type === \"Feature\"\n ? center.properties\n : {};\n\n // handle angle parameters\n if (angle1 === angle2) {\n return lineString(\n circle(center, radius, options).geometry.coordinates[0],\n properties\n );\n }\n const arcStartDegree = angle1;\n const arcEndDegree = angle1 < angle2 ? angle2 : angle2 + 360;\n\n let alpha = arcStartDegree;\n const coordinates = [];\n let i = 0;\n // How many degrees we'll swing around between each step.\n const arcStep = (arcEndDegree - arcStartDegree) / steps;\n // Add coords to the list, increasing the angle from our start bearing\n // (alpha) by arcStep degrees until we reach the end bearing.\n while (alpha <= arcEndDegree) {\n coordinates.push(\n destination(center, radius, alpha, options).geometry.coordinates\n );\n i++;\n alpha = arcStartDegree + i * arcStep;\n }\n return lineString(coordinates, properties);\n}\n\n/**\n * Takes any angle in degrees\n * and returns a valid angle between 0-360 degrees\n *\n * @private\n * @param {number} alpha angle between -180-180 degrees\n * @returns {number} angle between 0-360 degrees\n */\nfunction convertAngleTo360(alpha: number) {\n let beta = alpha % 360;\n if (beta < 0) {\n beta += 360;\n }\n return beta;\n}\n\nexport { lineArc };\nexport default lineArc;\n"],"mappings":";AACA,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B,SAAgB,kBAAyB;AA0BzC,SAAS,QACP,QACA,QACA,UACA,UACA,UAGI,CAAC,GACgB;AAErB,QAAM,QAAQ,QAAQ,SAAS;AAE/B,QAAM,SAAS,kBAAkB,QAAQ;AACzC,QAAM,SAAS,kBAAkB,QAAQ;AACzC,QAAM,aACJ,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS,YACtC,OAAO,aACP,CAAC;AAGP,MAAI,WAAW,QAAQ;AACrB,WAAO;AAAA,MACL,OAAO,QAAQ,QAAQ,OAAO,EAAE,SAAS,YAAY,CAAC;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AACA,QAAM,iBAAiB;AACvB,QAAM,eAAe,SAAS,SAAS,SAAS,SAAS;AAEzD,MAAI,QAAQ;AACZ,QAAM,cAAc,CAAC;AACrB,MAAI,IAAI;AAER,QAAM,WAAW,eAAe,kBAAkB;AAGlD,SAAO,SAAS,cAAc;AAC5B,gBAAY;AAAA,MACV,YAAY,QAAQ,QAAQ,OAAO,OAAO,EAAE,SAAS;AAAA,IACvD;AACA;AACA,YAAQ,iBAAiB,IAAI;AAAA,EAC/B;AACA,SAAO,WAAW,aAAa,UAAU;AAC3C;AAUA,SAAS,kBAAkB,OAAe;AACxC,MAAI,OAAO,QAAQ;AACnB,MAAI,OAAO,GAAG;AACZ,YAAQ;AAAA,EACV;AACA,SAAO;AACT;AAGA,IAAO,wBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/line-arc",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf line-arc module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,24 +50,24 @@
|
|
|
50
50
|
"test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@turf/truncate": "^7.
|
|
53
|
+
"@turf/truncate": "^7.2.0",
|
|
54
54
|
"@types/benchmark": "^2.1.5",
|
|
55
|
-
"@types/tape": "^4.
|
|
55
|
+
"@types/tape": "^4.13.4",
|
|
56
56
|
"benchmark": "^2.1.4",
|
|
57
57
|
"load-json-file": "^7.0.1",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"tape": "^5.
|
|
60
|
-
"tsup": "^8.
|
|
61
|
-
"tsx": "^4.
|
|
62
|
-
"typescript": "^5.
|
|
59
|
+
"tape": "^5.9.0",
|
|
60
|
+
"tsup": "^8.3.5",
|
|
61
|
+
"tsx": "^4.19.2",
|
|
62
|
+
"typescript": "^5.5.4",
|
|
63
63
|
"write-json-file": "^5.0.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@turf/circle": "^7.
|
|
67
|
-
"@turf/destination": "^7.
|
|
68
|
-
"@turf/helpers": "^7.
|
|
66
|
+
"@turf/circle": "^7.2.0",
|
|
67
|
+
"@turf/destination": "^7.2.0",
|
|
68
|
+
"@turf/helpers": "^7.2.0",
|
|
69
69
|
"@types/geojson": "^7946.0.10",
|
|
70
|
-
"tslib": "^2.
|
|
70
|
+
"tslib": "^2.8.1"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
73
73
|
}
|