@vesium/geometry 1.0.1 → 1.1.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/README.md CHANGED
@@ -21,8 +21,6 @@
21
21
  <a href="https://github.com/vesiumjs/vesium/blob/main/README.md" target="__blank">English</a>
22
22
  </p>
23
23
 
24
- > 🚧 This project is under active development, and the API may change frequently. Any version may introduce breaking changes.
25
-
26
24
  ## Documentation
27
25
 
28
26
  To view the documentation, visit <a href="https://vesium.js.org" target="__blank">vesium.js.org</a>
package/dist/index.cjs CHANGED
@@ -1,5 +1,4 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
2
  //#region src/helper.ts
4
3
  const FITTING_COUNT = 100;
5
4
  const HALF_PI = Math.PI / 2;
@@ -176,7 +175,7 @@ function getBisectorNormals(t, coord1, coord2, coord3) {
176
175
  const uY = normal[1] / dist;
177
176
  const d1 = mathDistance(coord1, coord2);
178
177
  const d2 = mathDistance(coord2, coord3);
179
- if (dist > ZERO_TOLERANCE) if (isClockWise(coord1, coord2, coord3)) {
178
+ if (dist > 1e-4) if (isClockWise(coord1, coord2, coord3)) {
180
179
  dt = t * d1;
181
180
  x = coord2[0] - dt * uY;
182
181
  y = coord2[1] + dt * uX;
@@ -239,7 +238,7 @@ function getLeftMostControlCoord(controlCoords, t) {
239
238
  ];
240
239
  const normalRight = getBisectorNormals(0, coord1, coord2, coord3)[0];
241
240
  const normal = getNormal(coord1, coord2, coord3);
242
- if (Math.hypot(normal[0], normal[1]) > ZERO_TOLERANCE) {
241
+ if (Math.hypot(normal[0], normal[1]) > 1e-4) {
243
242
  const midCoord = mid(coord1, coord2);
244
243
  const pX = coord1[0] - midCoord[0];
245
244
  const pY = coord1[1] - midCoord[1];
@@ -273,7 +272,7 @@ function getRightMostControlCoord(controlCoords, t) {
273
272
  const normal = getNormal(coord1, coord2, coord3);
274
273
  const dist = Math.hypot(normal[0], normal[1]);
275
274
  let [controlX, controlY] = [0, 0];
276
- if (dist > ZERO_TOLERANCE) {
275
+ if (dist > 1e-4) {
277
276
  const midCoord = mid(coord2, coord3);
278
277
  const pX = coord3[0] - midCoord[0];
279
278
  const pY = coord3[1] - midCoord[1];
@@ -317,8 +316,8 @@ function getCurveCoords(t, controlCoords) {
317
316
  coord1 = controlCoords[i];
318
317
  coord2 = controlCoords[i + 1];
319
318
  coords.push(coord1);
320
- for (let j = 0; j < FITTING_COUNT; j++) {
321
- const coord = getCubicValue(j / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
319
+ for (let j = 0; j < 100; j++) {
320
+ const coord = getCubicValue(j / 100, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
322
321
  coords.push(coord);
323
322
  }
324
323
  coords.push(coord2);
@@ -416,7 +415,6 @@ function getQuadricBSplineFactor(k, t) {
416
415
  else if (k === 2) res = t ** 2 / 2;
417
416
  return res;
418
417
  }
419
-
420
418
  //#endregion
421
419
  //#region src/arc.ts
422
420
  /**
@@ -446,7 +444,6 @@ function arc(coords) {
446
444
  return getArcCoords(center, radius, startAngle, endAngle);
447
445
  }
448
446
  }
449
-
450
447
  //#endregion
451
448
  //#region src/arrowAttackDirection.ts
452
449
  /**
@@ -608,7 +605,6 @@ function getTempCoord4(lineCoord1, lineCoord2, coord) {
608
605
  }
609
606
  return symCoord;
610
607
  }
611
-
612
608
  //#endregion
613
609
  //#region src/arrowAttackDirectionTailed.ts
614
610
  /**
@@ -648,7 +644,6 @@ function arrowAttackDirectionTailed(coords, options = {}) {
648
644
  return leftCoords.concat(headCoords, rightCoords.reverse(), [swallowTailCoord, leftCoords[0]]);
649
645
  } else return [];
650
646
  }
651
-
652
647
  //#endregion
653
648
  //#region src/arrowClamped.ts
654
649
  /**
@@ -808,7 +803,6 @@ function getTempCoord4$1(lineCoord1, lineCoord2, coord) {
808
803
  return getThirdCoord(midCoord, getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true), HALF_PI, distance2, false);
809
804
  }
810
805
  }
811
-
812
806
  //#endregion
813
807
  //#region src/arrowStraightSharp.ts
814
808
  /**
@@ -837,7 +831,6 @@ function arrowStraightSharp(coords, options = {}) {
837
831
  tailRight
838
832
  ];
839
833
  }
840
-
841
834
  //#endregion
842
835
  //#region src/arrowStraight.ts
843
836
  /**
@@ -852,7 +845,6 @@ function arrowStraight(coords) {
852
845
  neckAngle: Math.PI * .17741
853
846
  });
854
847
  }
855
-
856
848
  //#endregion
857
849
  //#region src/arrowStraightFine.ts
858
850
  /**
@@ -873,7 +865,6 @@ function arrowStraightFine(coords) {
873
865
  getThirdCoord(coord1, coord2, Math.PI / 6, len, true)
874
866
  ];
875
867
  }
876
-
877
868
  //#endregion
878
869
  //#region src/arrowUnitCombatOperation.ts
879
870
  /**
@@ -909,7 +900,6 @@ function arrowUnitCombatOperation(coords, options = {}) {
909
900
  } else return [];
910
901
  }
911
902
  }
912
-
913
903
  //#endregion
914
904
  //#region src/arrowUnitCombatOperationTailed.ts
915
905
  /**
@@ -950,7 +940,6 @@ function arrowUnitCombatOperationTailed(coords, options = {}) {
950
940
  }
951
941
  return [];
952
942
  }
953
-
954
943
  //#endregion
955
944
  //#region src/assemblingPlace.ts
956
945
  /**
@@ -977,15 +966,14 @@ function assemblingPlace(coords) {
977
966
  const coord1 = coords[i];
978
967
  const coord2 = coords[i + 1];
979
968
  pList.push(coord1);
980
- for (let t = 0; t <= FITTING_COUNT; t++) {
981
- const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
969
+ for (let t = 0; t <= 100; t++) {
970
+ const coord = getCubicValue(t / 100, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
982
971
  pList.push(coord);
983
972
  }
984
973
  pList.push(coord2);
985
974
  }
986
975
  return pList;
987
976
  }
988
-
989
977
  //#endregion
990
978
  //#region src/circle.ts
991
979
  /**
@@ -1009,7 +997,6 @@ function circle(coords) {
1009
997
  }
1010
998
  return _coords;
1011
999
  }
1012
-
1013
1000
  //#endregion
1014
1001
  //#region src/closedCurve.ts
1015
1002
  /**
@@ -1033,8 +1020,8 @@ function closedCurve(coords) {
1033
1020
  const coord1 = coords[i];
1034
1021
  const coord2 = coords[i + 1];
1035
1022
  pList.push(coord1);
1036
- for (let t = 0; t <= FITTING_COUNT; t++) {
1037
- const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
1023
+ for (let t = 0; t <= 100; t++) {
1024
+ const coord = getCubicValue(t / 100, coord1, normals[i * 2], normals[i * 2 + 1], coord2);
1038
1025
  pList.push(coord);
1039
1026
  }
1040
1027
  pList.push(coord2);
@@ -1042,7 +1029,6 @@ function closedCurve(coords) {
1042
1029
  return pList;
1043
1030
  }
1044
1031
  }
1045
-
1046
1032
  //#endregion
1047
1033
  //#region src/curve.ts
1048
1034
  /**
@@ -1053,7 +1039,6 @@ function curve(coords) {
1053
1039
  if (coords.length < 3) throw new Error("coords.length must >= 2");
1054
1040
  else return getCurveCoords(t, coords);
1055
1041
  }
1056
-
1057
1042
  //#endregion
1058
1043
  //#region src/ellipse.ts
1059
1044
  /**
@@ -1071,15 +1056,14 @@ function ellipse(coords) {
1071
1056
  0
1072
1057
  ];
1073
1058
  const _coords = [];
1074
- for (let i = 0; i <= FITTING_COUNT; i++) {
1075
- angle = Math.PI * 2 * i / FITTING_COUNT;
1059
+ for (let i = 0; i <= 100; i++) {
1060
+ angle = Math.PI * 2 * i / 100;
1076
1061
  x = center[0] + majorRadius * Math.cos(angle);
1077
1062
  y = center[1] + minorRadius * Math.sin(angle);
1078
1063
  coords.push([x, y]);
1079
1064
  }
1080
1065
  return _coords;
1081
1066
  }
1082
-
1083
1067
  //#endregion
1084
1068
  //#region src/lune.ts
1085
1069
  /**
@@ -1117,7 +1101,6 @@ function lune(coords) {
1117
1101
  coords.push(coords[0]);
1118
1102
  return coords;
1119
1103
  }
1120
-
1121
1104
  //#endregion
1122
1105
  //#region src/rectAngle.ts
1123
1106
  /**
@@ -1135,7 +1118,6 @@ function rectAngle(coords) {
1135
1118
  startCoord
1136
1119
  ];
1137
1120
  }
1138
-
1139
1121
  //#endregion
1140
1122
  //#region src/rectinclined1.ts
1141
1123
  /**
@@ -1222,7 +1204,6 @@ function calculatePerpendicularCoord(p1, p2, d) {
1222
1204
  }
1223
1205
  return [x, y];
1224
1206
  }
1225
-
1226
1207
  //#endregion
1227
1208
  //#region src/rectinclined2.ts
1228
1209
  /**
@@ -1275,7 +1256,6 @@ function calculateIntersectionCoord(p1, p2, p3) {
1275
1256
  };
1276
1257
  return [intersectionCoord.x, intersectionCoord.y];
1277
1258
  }
1278
-
1279
1259
  //#endregion
1280
1260
  //#region src/sector.ts
1281
1261
  /**
@@ -1295,7 +1275,6 @@ function sector(coords) {
1295
1275
  return pList;
1296
1276
  }
1297
1277
  }
1298
-
1299
1278
  //#endregion
1300
1279
  exports.FITTING_COUNT = FITTING_COUNT;
1301
1280
  exports.HALF_PI = HALF_PI;
@@ -1352,4 +1331,5 @@ exports.rectinclined1 = rectinclined1;
1352
1331
  exports.rectinclined2 = rectinclined2;
1353
1332
  exports.sector = sector;
1354
1333
  exports.wholeDistance = wholeDistance;
1334
+
1355
1335
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["getTempCoord4","getArrowCoords","getArrowHeadCoords","getArrowBodyCoords","calculateFourthCoord"],"sources":["../src/helper.ts","../src/arc.ts","../src/arrowAttackDirection.ts","../src/arrowAttackDirectionTailed.ts","../src/arrowClamped.ts","../src/arrowStraightSharp.ts","../src/arrowStraight.ts","../src/arrowStraightFine.ts","../src/arrowUnitCombatOperation.ts","../src/arrowUnitCombatOperationTailed.ts","../src/assemblingPlace.ts","../src/circle.ts","../src/closedCurve.ts","../src/curve.ts","../src/ellipse.ts","../src/lune.ts","../src/rectAngle.ts","../src/rectinclined1.ts","../src/rectinclined2.ts","../src/sector.ts"],"sourcesContent":["import type { CoordArray } from '@vesium/shared';\n\nexport const FITTING_COUNT = 100;\nexport const HALF_PI = Math.PI / 2;\nexport const ZERO_TOLERANCE = 0.0001;\nexport const TWO_PI = Math.PI * 2;\n\n/**\n * 计算两个坐标之间的距离\n * @param coord1\n * @param coord2\n */\nexport function mathDistance(coord1: CoordArray, coord2: CoordArray): number {\n return Math.hypot(coord1[0] - coord2[0], coord1[1] - coord2[1]);\n}\n\n/**\n * 计算点集合的总距离\n * @param points\n */\nexport function wholeDistance(points: CoordArray[]): number {\n let distance = 0;\n if (points && Array.isArray(points) && points.length > 0) {\n points.forEach((item, index) => {\n if (index < points.length - 1) {\n distance += mathDistance(item, points[index + 1]);\n }\n });\n }\n return distance;\n}\n/**\n * 获取基础长度\n * @param points\n */\nexport const getBaseLength = (points: CoordArray[]): number => wholeDistance(points) ** 0.99;\n\n/**\n * 求取两个坐标的中间坐标\n * @param coord1\n * @param coord2\n */\nexport function mid(coord1: CoordArray, coord2: CoordArray): CoordArray {\n return [\n (coord1[0] + coord2[0]) / 2,\n (coord1[1] + coord2[1]) / 2,\n ];\n}\n\n/**\n * 通过三个点确定一个圆的中心点\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getCircleCenterOfThreeCoords(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray {\n const coordA = [(coord1[0] + coord2[0]) / 2, (coord1[1] + coord2[1]) / 2] as CoordArray;\n const coordB = [coordA[0] - coord1[1] + coord2[1], coordA[1] + coord1[0] - coord2[0]] as CoordArray;\n const coordC = [(coord1[0] + coord3[0]) / 2, (coord1[1] + coord3[1]) / 2] as CoordArray;\n const coordD = [coordC[0] - coord1[1] + coord3[1], coordC[1] + coord1[0] - coord3[0]] as CoordArray;\n return getIntersectCoord(coordA, coordB, coordC, coordD);\n}\n\n/**\n * 获取交集的点\n * @param coordA\n * @param coordB\n * @param coordC\n * @param coordD\n */\nexport function getIntersectCoord(coordA: CoordArray, coordB: CoordArray, coordC: CoordArray, coordD: CoordArray): CoordArray {\n if (coordA[1] === coordB[1]) {\n const f = (coordD[0] - coordC[0]) / (coordD[1] - coordC[1]);\n const x = f * (coordA[1] - coordC[1]) + coordC[0];\n const y = coordA[1];\n return [x, y];\n }\n if (coordC[1] === coordD[1]) {\n const e = (coordB[0] - coordA[0]) / (coordB[1] - coordA[1]);\n const x = e * (coordC[1] - coordA[1]) + coordA[0];\n const y = coordC[1];\n return [x, y];\n }\n const e = (coordB[0] - coordA[0]) / (coordB[1] - coordA[1]);\n const f = (coordD[0] - coordC[0]) / (coordD[1] - coordC[1]);\n const y = (e * coordA[1] - coordA[0] - f * coordC[1] + coordC[0]) / (e - f);\n const x = e * y - e * coordA[1] + coordA[0];\n return [x, y];\n}\n\n/**\n * 获取方位角(地平经度)\n * @param startCoord\n * @param endCoord\n */\nexport function getAzimuth(startCoord: CoordArray, endCoord: CoordArray): number {\n let azimuth = 0;\n const angle = Math.asin(Math.abs(endCoord[1] - startCoord[1]) / mathDistance(startCoord, endCoord));\n if (endCoord[1] >= startCoord[1] && endCoord[0] >= startCoord[0]) {\n azimuth = angle + Math.PI;\n }\n else if (endCoord[1] >= startCoord[1] && endCoord[0] < startCoord[0]) {\n azimuth = Math.PI * 2 - angle;\n }\n else if (endCoord[1] < startCoord[1] && endCoord[0] < startCoord[0]) {\n azimuth = angle;\n }\n else if (endCoord[1] < startCoord[1] && endCoord[0] >= startCoord[0]) {\n azimuth = Math.PI - angle;\n }\n return azimuth;\n}\n\n/**\n * 通过三个点获取方位角\n * @param coordA\n * @param coordB\n * @param coordC\n */\nexport function getAngleOfThreeCoords(coordA: CoordArray, coordB: CoordArray, coordC: CoordArray): number {\n const angle = getAzimuth(coordB, coordA) - getAzimuth(coordB, coordC);\n return angle < 0 ? angle + Math.PI * 2 : angle;\n}\n\n/**\n * 判断是否是顺时针\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function isClockWise(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): boolean {\n return (coord3[1] - coord1[1]) * (coord2[0] - coord1[0]) > (coord2[1] - coord1[1]) * (coord3[0] - coord1[0]);\n}\n\n/**\n * 获取线上的点\n * @param t\n * @param startCoord\n * @param endCoord\n */\nexport function getCoordOnLine(t: number, startCoord: CoordArray, endCoord: CoordArray): CoordArray {\n const x = startCoord[0] + t * (endCoord[0] - startCoord[0]);\n const y = startCoord[1] + t * (endCoord[1] - startCoord[1]);\n return [x, y];\n}\n\n/**\n * 获取立方值\n */\nexport function getCubicValue(\n t: number,\n startCoord: CoordArray,\n coord1: CoordArray,\n coord2: CoordArray,\n endCoord: CoordArray,\n): CoordArray {\n t = Math.max(Math.min(t, 1), 0);\n const [tp, t2] = [1 - t, t * t];\n const t3 = t2 * t;\n const tp2 = tp * tp;\n const tp3 = tp2 * tp;\n const x = tp3 * startCoord[0] + 3 * tp2 * t * coord1[0] + 3 * tp * t2 * coord2[0] + t3 * endCoord[0];\n const y = tp3 * startCoord[1] + 3 * tp2 * t * coord1[1] + 3 * tp * t2 * coord2[1] + t3 * endCoord[1];\n return [x, y];\n}\n\n/**\n * 根据起止点和旋转方向求取第三个点\n * @param startCoord\n * @param endCoord\n * @param angle\n * @param distance\n * @param clockWise\n */\nexport function getThirdCoord(startCoord: CoordArray, endCoord: CoordArray, angle: number, distance: number, clockWise?: boolean): CoordArray {\n const azimuth = getAzimuth(startCoord, endCoord);\n const alpha = clockWise ? azimuth + angle : azimuth - angle;\n const dx = distance * Math.cos(alpha);\n const dy = distance * Math.sin(alpha);\n return [endCoord[0] + dx, endCoord[1] + dy];\n}\n\n/**\n * 插值弓形线段点\n * @param center\n * @param radius\n * @param startAngle\n * @param endAngle\n */\nexport function getArcCoords(center: CoordArray, radius: number, startAngle: number, endAngle: number): CoordArray[] {\n let [x, y, coords, angleDiff]: [number, number, CoordArray[], number] = [0, 0, [], endAngle - startAngle];\n angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;\n for (let i = 0; i <= 100; i++) {\n const angle = startAngle + (angleDiff * i) / 100;\n x = center[0] + radius * Math.cos(angle);\n y = center[1] + radius * Math.sin(angle);\n coords.push([x, y]);\n }\n return coords;\n}\n\n/**\n * getBisectorNormals\n * @param t\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getBisectorNormals(t: number, coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray[] {\n const normal = getNormal(coord1, coord2, coord3);\n let [bisectorNormalRight, bisectorNormalLeft, dt, x, y]: [CoordArray, CoordArray, number, number, number] = [\n [0, 0],\n [0, 0],\n 0,\n 0,\n 0,\n ];\n const dist = Math.hypot(normal[0], normal[1]);\n const uX = normal[0] / dist;\n const uY = normal[1] / dist;\n const d1 = mathDistance(coord1, coord2);\n const d2 = mathDistance(coord2, coord3);\n if (dist > ZERO_TOLERANCE) {\n if (isClockWise(coord1, coord2, coord3)) {\n dt = t * d1;\n x = coord2[0] - dt * uY;\n y = coord2[1] + dt * uX;\n bisectorNormalRight = [x, y];\n dt = t * d2;\n x = coord2[0] + dt * uY;\n y = coord2[1] - dt * uX;\n bisectorNormalLeft = [x, y];\n }\n else {\n dt = t * d1;\n x = coord2[0] + dt * uY;\n y = coord2[1] - dt * uX;\n bisectorNormalRight = [x, y];\n dt = t * d2;\n x = coord2[0] - dt * uY;\n y = coord2[1] + dt * uX;\n bisectorNormalLeft = [x, y];\n }\n }\n else {\n x = coord2[0] + t * (coord1[0] - coord2[0]);\n y = coord2[1] + t * (coord1[1] - coord2[1]);\n bisectorNormalRight = [x, y];\n x = coord2[0] + t * (coord3[0] - coord2[0]);\n y = coord2[1] + t * (coord3[1] - coord2[1]);\n bisectorNormalLeft = [x, y];\n }\n return [bisectorNormalRight, bisectorNormalLeft];\n}\n\n/**\n * 获取默认三点的内切圆\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getNormal(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray {\n let dX1 = coord1[0] - coord2[0];\n let dY1 = coord1[1] - coord2[1];\n const d1 = Math.hypot(dX1, dY1);\n dX1 /= d1;\n dY1 /= d1;\n let dX2 = coord3[0] - coord2[0];\n let dY2 = coord3[1] - coord2[1];\n const d2 = Math.hypot(dX2, dY2);\n dX2 /= d2;\n dY2 /= d2;\n const uX = dX1 + dX2;\n const uY = dY1 + dY2;\n return [uX, uY];\n}\n\n/**\n * 获取左边控制点\n * @param controlCoords\n * @param t\n */\nexport function getLeftMostControlCoord(controlCoords: CoordArray[], t: number): CoordArray {\n let [coord1, coord2, coord3, controlX, controlY]: [CoordArray, CoordArray, CoordArray, number, number] = [\n controlCoords[0],\n controlCoords[1],\n controlCoords[2],\n 0,\n 0,\n ];\n const coords = getBisectorNormals(0, coord1, coord2, coord3);\n const normalRight = coords[0];\n const normal = getNormal(coord1, coord2, coord3);\n const dist = Math.hypot(normal[0], normal[1]);\n if (dist > ZERO_TOLERANCE) {\n const midCoord = mid(coord1, coord2);\n const pX = coord1[0] - midCoord[0];\n const pY = coord1[1] - midCoord[1];\n const d1 = mathDistance(coord1, coord2);\n const n = 2 / d1;\n const nX = -n * pY;\n const nY = n * pX;\n const a11 = nX * nX - nY * nY;\n const a12 = 2 * nX * nY;\n const a22 = nY * nY - nX * nX;\n const dX = normalRight[0] - midCoord[0];\n const dY = normalRight[1] - midCoord[1];\n controlX = midCoord[0] + a11 * dX + a12 * dY;\n controlY = midCoord[1] + a12 * dX + a22 * dY;\n }\n else {\n controlX = coord1[0] + t * (coord2[0] - coord1[0]);\n controlY = coord1[1] + t * (coord2[1] - coord1[1]);\n }\n return [controlX, controlY];\n}\n\n/**\n * 获取右边控制点\n * @param controlCoords\n * @param t\n */\nexport function getRightMostControlCoord(controlCoords: CoordArray[], t: number): CoordArray {\n const coordlength = controlCoords.length;\n const coord1 = controlCoords[coordlength - 3];\n const coord2 = controlCoords[coordlength - 2];\n const coord3 = controlCoords[coordlength - 1];\n const coords = getBisectorNormals(0, coord1, coord2, coord3);\n const normalLeft = coords[1];\n const normal = getNormal(coord1, coord2, coord3);\n const dist = Math.hypot(normal[0], normal[1]);\n let [controlX, controlY] = [0, 0];\n if (dist > ZERO_TOLERANCE) {\n const midCoord = mid(coord2, coord3);\n const pX = coord3[0] - midCoord[0];\n const pY = coord3[1] - midCoord[1];\n const d1 = mathDistance(coord2, coord3);\n const n = 2 / d1;\n const nX = -n * pY;\n const nY = n * pX;\n const a11 = nX * nX - nY * nY;\n const a12 = 2 * nX * nY;\n const a22 = nY * nY - nX * nX;\n const dX = normalLeft[0] - midCoord[0];\n const dY = normalLeft[1] - midCoord[1];\n controlX = midCoord[0] + a11 * dX + a12 * dY;\n controlY = midCoord[1] + a12 * dX + a22 * dY;\n }\n else {\n controlX = coord3[0] + t * (coord2[0] - coord3[0]);\n controlY = coord3[1] + t * (coord2[1] - coord3[1]);\n }\n return [controlX, controlY];\n}\n\n/**\n * 插值曲线点\n * @param t\n * @param controlCoords\n */\nexport function getCurveCoords(t: number, controlCoords: CoordArray[]): CoordArray[] {\n let normals = [getLeftMostControlCoord(controlCoords, t)];\n const coords: CoordArray[] = [];\n let coord1: CoordArray, coord2: CoordArray, coord3: CoordArray;\n\n for (let i = 0; i < controlCoords.length - 2; i++) {\n [coord1, coord2, coord3] = [controlCoords[i], controlCoords[i + 1], controlCoords[i + 2]];\n const normalCoords = getBisectorNormals(t, coord1, coord2, coord3);\n normals = normals.concat(normalCoords);\n }\n const rightControl = getRightMostControlCoord(controlCoords, t);\n if (rightControl) {\n normals.push(rightControl);\n }\n for (let i = 0; i < controlCoords.length - 1; i++) {\n coord1 = controlCoords[i];\n coord2 = controlCoords[i + 1];\n coords.push(coord1);\n for (let j = 0; j < FITTING_COUNT; j++) {\n const coord = getCubicValue(j / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n coords.push(coord);\n }\n coords.push(coord2);\n }\n return coords;\n}\n\n/**\n * 贝塞尔曲线\n * @param points\n */\nexport function getBezierCoords(points: CoordArray[]): CoordArray[] {\n if (points.length <= 2) {\n return points;\n }\n const bezierCoords: CoordArray[] = [];\n const n = points.length - 1;\n for (let t = 0; t <= 1; t += 0.01) {\n let [x, y] = [0, 0];\n for (let index = 0; index <= n; index++) {\n const factor = getBinomialFactor(n, index);\n const a = t ** index;\n const b = (1 - t) ** (n - index);\n x += factor * a * b * points[index][0];\n y += factor * a * b * points[index][1];\n }\n bezierCoords.push([x, y]);\n }\n bezierCoords.push(points[n]);\n return bezierCoords;\n}\n\n/**\n * 获取阶乘数据\n * @param n\n */\nexport function getFactorial(n: number): number {\n let result = 1;\n switch (true) {\n case n <= 1:\n result = 1;\n break;\n case n === 2:\n result = 2;\n break;\n case n === 3:\n result = 6;\n break;\n case n === 24:\n result = 24;\n break;\n case n === 5:\n result = 120;\n break;\n default:\n for (let i = 1; i <= n; i++) {\n result *= i;\n }\n break;\n }\n return result;\n}\n\n/**\n * 获取二项分布\n * @param n\n * @param index\n */\nexport function getBinomialFactor(n: number, index: number): number {\n return getFactorial(n) / (getFactorial(index) * getFactorial(n - index));\n}\n\n/**\n * 插值线性点\n * @param points\n */\nexport function getQBSplineCoords(points: CoordArray[]): CoordArray[] {\n if (points.length <= 2) {\n return points;\n }\n const [n, bSplineCoords]: [number, CoordArray[]] = [2, []];\n const m = points.length - n - 1;\n bSplineCoords.push(points[0]);\n for (let i = 0; i <= m; i++) {\n for (let t = 0; t <= 1; t += 0.05) {\n let [x, y] = [0, 0];\n for (let k = 0; k <= n; k++) {\n const factor = getQuadricBSplineFactor(k, t);\n x += factor * points[i + k][0];\n y += factor * points[i + k][1];\n }\n bSplineCoords.push([x, y]);\n }\n }\n bSplineCoords.push(points.at(-1)!);\n return bSplineCoords;\n}\n\n/**\n * 得到二次线性因子\n * @param k\n * @param t\n */\nexport function getQuadricBSplineFactor(k: number, t: number): number {\n let res = 0;\n if (k === 0) {\n res = (t - 1) ** 2 / 2;\n }\n else if (k === 1) {\n res = (-2 * t ** 2 + 2 * t + 1) / 2;\n }\n else if (k === 2) {\n res = t ** 2 / 2;\n }\n return res;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArcCoords, getAzimuth, getCircleCenterOfThreeCoords, isClockWise, mathDistance } from './helper';\n\n/**\n * 标绘画弓形算法,继承线要素相关方法和属性\n */\nexport function arc(coords: CoordArray[]): CoordArray[] {\n const coordlength = coords.length;\n\n if (coordlength <= 2) {\n throw new Error('coords.length must >= 3');\n }\n else {\n let [coord1, coord2, coord3, startAngle, endAngle] = [coords[0], coords[1], coords[2], 0, 0];\n const center = getCircleCenterOfThreeCoords(coord1, coord2, coord3);\n const radius = mathDistance(coord1, center);\n const angle1 = getAzimuth(coord1, center);\n const angle2 = getAzimuth(coord2, center);\n if (isClockWise(coord1, coord2, coord3)) {\n startAngle = angle2;\n endAngle = angle1;\n }\n else {\n startAngle = angle1;\n endAngle = angle2;\n }\n return getArcCoords(center, radius, startAngle, endAngle);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getAngleOfThreeCoords,\n getBaseLength,\n getQBSplineCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n wholeDistance,\n} from './helper';\n\nexport interface AttackArrowOptions {\n headWidthFactor?: number;\n headHeightFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n tailWidthFactor?: number;\n headTailFactor?: number;\n swallowTailFactor?: number;\n swallowTailCoord?: CoordArray;\n}\n/**\n * 尖曲箭头\n */\nexport function arrowAttackDirection(coords: CoordArray[], options: AttackArrowOptions = {}): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n let [tailLeft, tailRight] = [coords[0], coords[1]];\n if (isClockWise(coords[0], coords[1], coords[2])) {\n tailLeft = coords[1];\n tailRight = coords[0];\n }\n const midTail = mid(tailLeft, tailRight);\n const boneCoords = [midTail].concat(coords.slice(2));\n const headCoords = getArrowHeadCoords(boneCoords, {\n tailLeft,\n tailRight,\n ...options,\n });\n if (headCoords && headCoords.length > 4) {\n const [neckLeft, neckRight] = [headCoords[0], headCoords[4]];\n const tailWidthFactor = mathDistance(tailLeft, tailRight) / getBaseLength(boneCoords);\n const bodyCoords = getArrowBodyCoords(boneCoords, neckLeft, neckRight, tailWidthFactor);\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse());\n }\n else {\n return [];\n }\n }\n}\n\nexport interface GetArrowCoordsOptions {\n tailLeft?: CoordArray;\n tailRight?: CoordArray;\n headHeightFactor?: number;\n headTailFactor?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n}\n\n/**\n * 插值箭形上的点\n * @param coord1\n * @param coord2\n * @param coord3\n * @param clockWise\n */\nexport function getArrowCoords(\n coord1: CoordArray,\n coord2: CoordArray,\n coord3: CoordArray,\n clockWise: boolean,\n options: GetArrowCoordsOptions = {},\n): CoordArray[] | undefined {\n const midCoord = mid(coord1, coord2);\n const len = mathDistance(midCoord, coord3);\n let midCoord1 = getThirdCoord(coord3, midCoord, 0, len * 0.3, true);\n let midCoord2 = getThirdCoord(coord3, midCoord, 0, len * 0.5, true);\n midCoord1 = getThirdCoord(midCoord, midCoord1, HALF_PI, len / 5, clockWise);\n midCoord2 = getThirdCoord(midCoord, midCoord2, HALF_PI, len / 4, clockWise);\n const points = [midCoord, midCoord1, midCoord2, coord3];\n const arrowCoords = getArrowHeadCoords(points, options);\n if (arrowCoords && Array.isArray(arrowCoords) && arrowCoords.length > 0) {\n const [neckLeftCoord, neckRightCoord] = [arrowCoords[0], arrowCoords[4]];\n const tailWidthFactor = mathDistance(coord1, coord2) / getBaseLength(points) / 2;\n const bodyCoords = getArrowBodyCoords(points, neckLeftCoord, neckRightCoord, tailWidthFactor);\n if (bodyCoords) {\n const n = bodyCoords.length;\n let lCoords = bodyCoords.slice(0, n / 2);\n let rCoords = bodyCoords.slice(n / 2, n);\n lCoords.push(neckLeftCoord);\n rCoords.push(neckRightCoord);\n lCoords = lCoords.reverse();\n lCoords.push(coord2);\n rCoords = rCoords.reverse();\n rCoords.push(coord1);\n return lCoords.reverse().concat(arrowCoords, rCoords);\n }\n }\n else {\n throw new Error('插值出错');\n }\n}\n\nexport interface GetArrowHeadCoordsOptions {\n tailLeft?: CoordArray;\n tailRight?: CoordArray;\n headHeightFactor?: number;\n headTailFactor?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n}\n\n/**\n * 插值头部点\n */\nexport function getArrowHeadCoords(points: CoordArray[], options: GetArrowHeadCoordsOptions): CoordArray[] {\n const {\n tailLeft,\n tailRight,\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n headTailFactor = 0.8,\n } = options;\n\n let len = getBaseLength(points);\n let headHeight = len * headHeightFactor;\n const headCoord = points.at(-1)!;\n len = mathDistance(headCoord, points.at(-2)!);\n let tailWidth = 0;\n if (tailLeft && tailRight) {\n tailWidth = mathDistance(tailLeft, tailRight);\n }\n if (headHeight > tailWidth * headTailFactor) {\n headHeight = tailWidth * headTailFactor;\n }\n const headWidth = headHeight * headWidthFactor;\n const neckWidth = headHeight * neckWidthFactor;\n headHeight = Math.min(headHeight, len);\n const neckHeight = headHeight * neckHeightFactor;\n const headEndCoord = getThirdCoord(points.at(-2)!, headCoord, 0, headHeight, true);\n const neckEndCoord = getThirdCoord(points.at(-2)!, headCoord, 0, neckHeight, true);\n const headLeft = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, false);\n const headRight = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, true);\n const neckLeft = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, false);\n const neckRight = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, true);\n return [neckLeft, headLeft, headCoord, headRight, neckRight];\n}\n\n/**\n * 插值面部分数据\n * @param points\n * @param neckLeft\n * @param neckRight\n * @param tailWidthFactor\n */\nexport function getArrowBodyCoords(points: CoordArray[], neckLeft: CoordArray, neckRight: CoordArray, tailWidthFactor: number): Array<CoordArray> {\n const allLen = wholeDistance(points);\n const len = getBaseLength(points);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = mathDistance(neckLeft, neckRight);\n const widthDif = (tailWidth - neckWidth) / 2;\n\n let tempLen = 0;\n const leftBodyCoords: CoordArray[] = [];\n const rightBodyCoords: CoordArray[] = [];\n for (let i = 1; i < points.length - 1; i++) {\n const angle = getAngleOfThreeCoords(points[i - 1], points[i], points[i + 1]) / 2;\n tempLen += mathDistance(points[i - 1], points[i]);\n const w = (tailWidth / 2 - (tempLen / allLen) * widthDif) / Math.sin(angle);\n const left = getThirdCoord(points[i - 1], points[i], Math.PI - angle, w, true);\n const right = getThirdCoord(points[i - 1], points[i], angle, w, false);\n leftBodyCoords.push(left);\n rightBodyCoords.push(right);\n }\n return leftBodyCoords.concat(rightBodyCoords);\n}\n\n/**\n * 获取对称点\n * @param lineCoord1\n * @param lineCoord2\n * @param coord\n */\nexport function getTempCoord4(lineCoord1: CoordArray, lineCoord2: CoordArray, coord: CoordArray): CoordArray {\n const midCoord = mid(lineCoord1, lineCoord2);\n const len = mathDistance(midCoord, coord);\n const angle = getAngleOfThreeCoords(lineCoord1, midCoord, coord);\n let symCoord;\n let distance1 = 0;\n let distance2 = 0;\n let midCoord2: CoordArray;\n if (angle < HALF_PI) {\n distance1 = len * Math.sin(angle);\n distance2 = len * Math.cos(angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, true);\n }\n else if (angle >= HALF_PI && angle < Math.PI) {\n distance1 = len * Math.sin(Math.PI - angle);\n distance2 = len * Math.cos(Math.PI - angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, false);\n }\n else if (angle >= Math.PI && angle < Math.PI * 1.5) {\n distance1 = len * Math.sin(angle - Math.PI);\n distance2 = len * Math.cos(angle - Math.PI);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, true);\n }\n else {\n distance1 = len * Math.sin(Math.PI * 2 - angle);\n distance2 = len * Math.cos(Math.PI * 2 - angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, false);\n }\n return symCoord;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, isClockWise, mathDistance, mid } from './helper';\n\nexport interface TailedAttackArrowOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n swallowTailFactor?: number;\n}\n\n/**\n * 燕尾尖曲箭头\n */\nexport function arrowAttackDirectionTailed(coords: CoordArray[], options: TailedAttackArrowOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n swallowTailFactor = 1,\n } = options;\n\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n\n let [tailLeft, tailRight] = [coords[0], coords[1]];\n if (isClockWise(coords[0], coords[1], coords[2])) {\n tailLeft = coords[1];\n tailRight = coords[0];\n }\n const midTail = mid(tailLeft, tailRight);\n const boneCoords = [midTail].concat(coords.slice(2));\n const headCoords = getArrowHeadCoords(boneCoords, {\n tailLeft,\n tailRight,\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const [neckLeft, neckRight] = [headCoords[0], headCoords[4]];\n const tailWidth = mathDistance(tailLeft, tailRight);\n const allLen = getBaseLength(boneCoords);\n const len = allLen * tailWidthFactor * swallowTailFactor;\n const swallowTailCoord = getThirdCoord(boneCoords[1], boneCoords[0], 0, len, true);\n const factor = tailWidth / allLen;\n const bodyCoords = getArrowBodyCoords(boneCoords, neckLeft, neckRight, factor);\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse(), [swallowTailCoord, leftCoords[0]]);\n }\n else {\n return [];\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getAngleOfThreeCoords,\n getBaseLength,\n getBezierCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n wholeDistance,\n} from './helper';\n\n/**\n * 钳击箭头 有效点位长度3,4,5\n */\nexport function arrowClamped(coords: CoordArray[]): CoordArray[] {\n const options = {\n headHeightFactor: 0.25,\n headWidthFactor: 0.3,\n neckHeightFactor: 0.85,\n neckWidthFactor: 0.15,\n };\n\n if (coords.length < 3) {\n throw new Error(`coords.length must >= 3`);\n }\n const [coord1, coord2, coord3] = coords;\n let tempCoord4: CoordArray, connCoord: CoordArray;\n if (coords.length === 3) {\n tempCoord4 = getTempCoord4(coord1, coord2, coord3);\n connCoord = mid(coord1, coord2);\n }\n else if (coords.length === 4) {\n tempCoord4 = coords[3];\n connCoord = mid(coord1, coord2);\n }\n else {\n tempCoord4 = coords[3];\n connCoord = coords[4];\n }\n let leftArrowCoords: CoordArray[];\n let rightArrowCoords: CoordArray[];\n if (isClockWise(coord1, coord2, coord3)) {\n leftArrowCoords = getArrowCoords(coord1, connCoord, tempCoord4, false, options);\n rightArrowCoords = getArrowCoords(connCoord, coord2, coord3, true, options);\n }\n else {\n leftArrowCoords = getArrowCoords(coord2, connCoord, coord3, false, options);\n rightArrowCoords = getArrowCoords(connCoord, coord1, tempCoord4, true, options);\n }\n const m = leftArrowCoords.length;\n const t = (m - 5) / 2;\n const llBodyCoords = leftArrowCoords.slice(0, t);\n const lArrowCoords = leftArrowCoords.slice(t, t + 5);\n let lrBodyCoords = leftArrowCoords.slice(t + 5, m);\n let rlBodyCoords = rightArrowCoords.slice(0, t);\n const rArrowCoords = rightArrowCoords.slice(t, t + 5);\n const rrBodyCoords = rightArrowCoords.slice(t + 5, m);\n rlBodyCoords = getBezierCoords(rlBodyCoords);\n const bodyCoords = getBezierCoords(rrBodyCoords.concat(llBodyCoords.slice(1)));\n lrBodyCoords = getBezierCoords(lrBodyCoords);\n return rlBodyCoords.concat(rArrowCoords, bodyCoords, lArrowCoords, lrBodyCoords);\n}\n\n/**\n * 插值箭形上的点\n * @param coord1 - Wgs84坐标\n * @param coord2 - Wgs84坐标\n * @param coord3 - Wgs84坐标\n * @param clockWise - 是否顺时针\n */\nfunction getArrowCoords(\n coord1: CoordArray,\n coord2: CoordArray,\n coord3: CoordArray,\n clockWise: boolean,\n options: GetArrowHeadCoordsOptions,\n): CoordArray[] {\n const midCoord = mid(coord1, coord2);\n const len = mathDistance(midCoord, coord3);\n let midCoord1 = getThirdCoord(coord3, midCoord, 0, len * 0.3, true);\n let midCoord2 = getThirdCoord(coord3, midCoord, 0, len * 0.5, true);\n midCoord1 = getThirdCoord(midCoord, midCoord1, HALF_PI, len / 5, clockWise);\n midCoord2 = getThirdCoord(midCoord, midCoord2, HALF_PI, len / 4, clockWise);\n const coords = [midCoord, midCoord1, midCoord2, coord3];\n const arrowCoords = getArrowHeadCoords(coords, options);\n if (arrowCoords && Array.isArray(arrowCoords) && arrowCoords.length > 0) {\n const [neckLeftCoord, neckRightCoord] = [arrowCoords[0], arrowCoords[4]];\n const tailWidthFactor = mathDistance(coord1, coord2) / getBaseLength(coords) / 2;\n const bodyCoords = getArrowBodyCoords(coords, neckLeftCoord, neckRightCoord, tailWidthFactor);\n const n = bodyCoords.length;\n let lCoords = bodyCoords.slice(0, n / 2);\n let rCoords = bodyCoords.slice(n / 2, n);\n lCoords.push(neckLeftCoord);\n rCoords.push(neckRightCoord);\n lCoords = lCoords.reverse();\n lCoords.push(coord2);\n rCoords = rCoords.reverse();\n rCoords.push(coord1);\n return lCoords.reverse().concat(arrowCoords, rCoords);\n }\n else {\n throw new Error('插值出错');\n }\n}\ninterface GetArrowHeadCoordsOptions {\n headHeightFactor: number;\n headWidthFactor: number;\n neckWidthFactor: number;\n neckHeightFactor: number;\n}\n\n/**\n * 插值头部点\n * @param coords\n */\nfunction getArrowHeadCoords(coords: CoordArray[], options: GetArrowHeadCoordsOptions): CoordArray[] {\n const { headHeightFactor, headWidthFactor, neckWidthFactor, neckHeightFactor } = options;\n\n const len = getBaseLength(coords);\n const headHeight = len * headHeightFactor;\n const headCoord = coords.at(-1)!;\n const headWidth = headHeight * headWidthFactor;\n const neckWidth = headHeight * neckWidthFactor;\n const neckHeight = headHeight * neckHeightFactor;\n const headEndCoord = getThirdCoord(coords.at(-2)!, headCoord, 0, headHeight, true);\n const neckEndCoord = getThirdCoord(coords.at(-2)!, headCoord, 0, neckHeight, true);\n const headLeft = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, false);\n const headRight = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, true);\n const neckLeft = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, false);\n const neckRight = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, true);\n return [neckLeft, headLeft, headCoord, headRight, neckRight];\n}\n\n/**\n * 插值面部分数据\n * @param coords\n * @param neckLeft\n * @param neckRight\n * @param tailWidthFactor\n */\nfunction getArrowBodyCoords(\n coords: CoordArray[],\n neckLeft: CoordArray,\n neckRight: CoordArray,\n tailWidthFactor: number,\n): CoordArray[] {\n const allLen = wholeDistance(coords);\n const len = getBaseLength(coords);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = mathDistance(neckLeft, neckRight);\n const widthDif = (tailWidth - neckWidth) / 2;\n let tempLen = 0;\n const leftBodyCoords: CoordArray[] = [];\n const rightBodyCoords: CoordArray[] = [];\n for (let i = 1; i < coords.length - 1; i++) {\n const angle = getAngleOfThreeCoords(coords[i - 1], coords[i], coords[i + 1]) / 2;\n tempLen += mathDistance(coords[i - 1], coords[i]);\n const w = (tailWidth / 2 - (tempLen / allLen) * widthDif) / Math.sin(angle);\n const left = getThirdCoord(coords[i - 1], coords[i], Math.PI - angle, w, true);\n const right = getThirdCoord(coords[i - 1], coords[i], angle, w, false);\n leftBodyCoords.push(left);\n rightBodyCoords.push(right);\n }\n return leftBodyCoords.concat(rightBodyCoords);\n}\n\n/**\n * 获取对称点\n * @param lineCoord1\n * @param lineCoord2\n * @param coord\n */\nfunction getTempCoord4(lineCoord1: CoordArray, lineCoord2: CoordArray, coord: CoordArray): CoordArray {\n const midCoord = mid(lineCoord1, lineCoord2);\n const len = mathDistance(midCoord, coord);\n const angle = getAngleOfThreeCoords(lineCoord1, midCoord, coord);\n if (angle < HALF_PI) {\n const distance1 = len * Math.sin(angle);\n const distance2 = len * Math.cos(angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, true);\n }\n else if (angle >= HALF_PI && angle < Math.PI) {\n const distance1 = len * Math.sin(Math.PI - angle);\n const distance2 = len * Math.cos(Math.PI - angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, false);\n }\n else if (angle >= Math.PI && angle < Math.PI * 1.5) {\n const distance1 = len * Math.sin(angle - Math.PI);\n const distance2 = len * Math.cos(angle - Math.PI);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, true);\n }\n else {\n const distance1 = len * Math.sin(Math.PI * 2 - angle);\n const distance2 = len * Math.cos(Math.PI * 2 - angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, false);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getBaseLength, getThirdCoord, HALF_PI } from './helper';\n\nexport interface FineArrowOptions {\n neckAngle?: number;\n headAngle?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n}\n\n/**\n * 尖箭头\n *\n */\nexport function arrowStraightSharp(coords: CoordArray[], options: FineArrowOptions = {}): CoordArray[] {\n const {\n tailWidthFactor = 0.1,\n neckWidthFactor = 0.2,\n headWidthFactor = 0.25,\n headAngle = Math.PI / 8.5,\n neckAngle = Math.PI / 13,\n } = options;\n\n const coordlength = coords.length;\n\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n const [coord1, coord2] = [coords[0], coords[1]];\n const len = getBaseLength(coords);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = len * neckWidthFactor;\n const headWidth = len * headWidthFactor;\n const tailLeft = getThirdCoord(coord2, coord1, HALF_PI, tailWidth, true);\n const tailRight = getThirdCoord(coord2, coord1, HALF_PI, tailWidth, false);\n const headLeft = getThirdCoord(coord1, coord2, headAngle, headWidth, false);\n const headRight = getThirdCoord(coord1, coord2, headAngle, headWidth, true);\n const neckLeft = getThirdCoord(coord1, coord2, neckAngle, neckWidth, false);\n const neckRight = getThirdCoord(coord1, coord2, neckAngle, neckWidth, true);\n const pList = [tailLeft, neckLeft, headLeft, coord2, headRight, neckRight, tailRight];\n return pList;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { arrowStraightSharp } from './arrowStraightSharp';\n\n/**\n * 直箭头\n */\nexport function arrowStraight(coords: CoordArray[]): CoordArray[] {\n const tailWidthFactor = 0.05;\n const neckWidthFactor = 0.1;\n const headWidthFactor = 0.15;\n\n const headAngle = Math.PI / 4;\n const neckAngle = Math.PI * 0.17741;\n return arrowStraightSharp(coords, {\n tailWidthFactor,\n neckWidthFactor,\n headWidthFactor,\n headAngle,\n neckAngle,\n });\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getThirdCoord, mathDistance } from './helper';\n\n/**\n * 细直箭头\n */\nexport function arrowStraightFine(coords: CoordArray[]): CoordArray[] {\n const maxArrowLength = 3000000;\n const arrowLengthScale = 5;\n\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n const [coord1, coord2] = [coords[0], coords[1]];\n const distance = mathDistance(coord1, coord2);\n let len = distance / arrowLengthScale;\n len = Math.min(len, maxArrowLength);\n const leftCoord = getThirdCoord(coord1, coord2, Math.PI / 6, len, false);\n const rightCoord = getThirdCoord(coord1, coord2, Math.PI / 6, len, true);\n return [coord1, coord2, leftCoord, coord2, rightCoord];\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, HALF_PI } from './helper';\n\nexport interface SquadCombatOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n}\n\n/**\n * 分队战斗行动(尖曲箭头)\n */\nexport function arrowUnitCombatOperation(coords: CoordArray[], options: SquadCombatOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n } = options;\n\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n else {\n const allLen = getBaseLength(coords);\n const tailWidth = allLen * tailWidthFactor;\n const tailLeft = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, false);\n const tailRight = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, true);\n const headCoords = getArrowHeadCoords(coords, {\n tailLeft,\n tailRight,\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const neckLeft = headCoords[0];\n const neckRight = headCoords[4];\n const bodyCoords = getArrowBodyCoords(coords, neckLeft, neckRight, tailWidthFactor);\n\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse());\n }\n else {\n return [];\n }\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, HALF_PI } from './helper';\n\nexport interface TailedSquadCombatOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n headTailFactor?: number;\n swallowTailFactor?: number;\n swallowTailCoord?: CoordArray;\n}\n\n/**\n * 燕尾尖箭头\n */\nexport function arrowUnitCombatOperationTailed(coords: CoordArray[], options: TailedSquadCombatOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n swallowTailFactor = 1,\n } = options;\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const allLen = getBaseLength(coords);\n const tailWidth = allLen * tailWidthFactor;\n const tailLeft = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, false);\n const tailRight = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, true);\n const len = tailWidth * swallowTailFactor;\n const swallowTailCoord = getThirdCoord(coords[1], coords[0], 0, len, true);\n const tailCoords = [tailLeft, swallowTailCoord, tailRight];\n\n const headCoords = getArrowHeadCoords(coords, {\n tailLeft: tailCoords[0],\n tailRight: tailCoords[2],\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const neckLeft = headCoords[0];\n const neckRight = headCoords[4];\n const bodyCoords = getArrowBodyCoords(coords, neckLeft, neckRight, tailWidthFactor);\n\n const coordlength = bodyCoords.length;\n let leftCoords = [tailCoords[0]].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailCoords[2]].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse(), [tailCoords[1], leftCoords[0]]);\n }\n return [];\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, getBisectorNormals, getCubicValue, mid } from './helper';\n\n/**\n * 集结地\n *\n */\nexport function assemblingPlace(coords: CoordArray[]): CoordArray[] {\n if (coords.length < 3) {\n throw new Error(`coords.length must >= 3`);\n }\n const t = 0.4;\n\n const midCoord = mid(coords[0], coords[2]);\n coords.push(midCoord, coords[0], coords[1]);\n let normals: CoordArray[] = [];\n const pList: CoordArray[] = [];\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n const coord3 = coords[i + 2];\n const normalCoords = getBisectorNormals(t, coord1, coord2, coord3);\n normals = normals.concat(normalCoords);\n }\n const count = normals.length;\n normals = [normals[count - 1]].concat(normals.slice(0, count - 1));\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n pList.push(coord1);\n for (let t = 0; t <= FITTING_COUNT; t++) {\n const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n pList.push(coord);\n }\n pList.push(coord2);\n }\n return pList;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { mathDistance } from './helper';\n\n/**\n * 标绘画圆算法,继承面要素相关方法和属性\n */\nexport function circle(coords: CoordArray[]): CoordArray[] {\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const center = coords[0];\n const radius = mathDistance(center as CoordArray, coords[1]);\n let [x, y, angle] = [0, 0, 0];\n const _coords: CoordArray[] = [];\n for (let i = 0; i <= 100; i++) {\n angle = (Math.PI * 2 * i) / 100;\n x = center[0] + radius * Math.cos(angle);\n y = center[1] + radius * Math.sin(angle);\n _coords.push([x, y]);\n }\n return _coords;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, getBisectorNormals, getCubicValue } from './helper';\n/**\n * 闭合曲面\n *\n */\nexport function closedCurve(coords: CoordArray[]): CoordArray[] {\n const t = 0.3;\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n coords.push(coords[0], coords[1]);\n let normals: CoordArray[] = [];\n const pList: CoordArray[] = [];\n for (let i = 0; i < coords.length - 2; i++) {\n const normalCoords = getBisectorNormals(t, coords[i], coords[i + 1], coords[i + 2]);\n normals = normals.concat(normalCoords);\n }\n const coordlength = normals.length;\n normals = [normals[coordlength - 1]].concat(normals.slice(0, coordlength - 1));\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n pList.push(coord1);\n for (let t = 0; t <= FITTING_COUNT; t++) {\n const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n pList.push(coord);\n }\n pList.push(coord2);\n }\n return pList;\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getCurveCoords } from './helper';\n/**\n * 标绘曲线算法\n */\nexport function curve(coords: CoordArray[]): CoordArray[] {\n const t = 0.3;\n const coordlength = coords.length;\n if (coordlength < 3) {\n throw new Error('coords.length must >= 2');\n }\n else {\n return getCurveCoords(t, coords);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, mid } from './helper';\n\n/**\n * 标绘画椭圆算法,继承面要素相关方法和属性\n */\nexport function ellipse(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n\n if (coordLength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const [coord1, coord2] = [coords[0], coords[1]];\n const center = mid(coord1, coord2);\n const majorRadius = Math.abs((coord1[0] - coord2[0]) / 2);\n const minorRadius = Math.abs((coord1[1] - coord2[1]) / 2);\n let [x, y, angle] = [0, 0, 0];\n const _coords: CoordArray[] = [];\n for (let i = 0; i <= FITTING_COUNT; i++) {\n angle = (Math.PI * 2 * i) / FITTING_COUNT;\n x = center[0] + majorRadius * Math.cos(angle);\n y = center[1] + minorRadius * Math.sin(angle);\n coords.push([x, y]);\n }\n return _coords;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getArcCoords,\n getAzimuth,\n getCircleCenterOfThreeCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n} from './helper';\n\n//\n\n/**\n * 弓形\n */\nexport function lune(coords: CoordArray[]): CoordArray[] {\n coords = [...coords];\n const coordLength = coords.length;\n\n if (coordLength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n if (coordLength === 2) {\n const midCoord = mid(coords[0], coords[1]);\n const d = mathDistance(coords[0], midCoord);\n const coord = getThirdCoord(coords[0], midCoord, HALF_PI, d);\n coords.push(coord);\n }\n\n let [coord1, coord2, coord3, startAngle, endAngle] = [coords[0], coords[1], coords[2], 0, 0];\n const center = getCircleCenterOfThreeCoords(coord1, coord2, coord3);\n const radius = mathDistance(coord1, center);\n const angle1 = getAzimuth(coord1, center);\n const angle2 = getAzimuth(coord2, center);\n if (isClockWise(coord1, coord2, coord3)) {\n startAngle = angle2;\n endAngle = angle1;\n }\n else {\n startAngle = angle1;\n endAngle = angle2;\n }\n coords = getArcCoords(center, radius, startAngle, endAngle);\n coords.push(coords[0]);\n return coords;\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 规则矩形\n *\n */\nexport function rectAngle(coords: CoordArray[]): CoordArray[] {\n if (coords.length < 2) {\n throw new Error('coords.length must >= 2');\n }\n const [startCoord, endCoord] = coords;\n return [startCoord, [startCoord[0], endCoord[1]], endCoord, [endCoord[0], startCoord[1]], startCoord];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 斜矩形1\n *\n */\nexport function rectinclined1(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n const [coord1, coord2, mouse] = [coords[0], coords[1], coords[2]];\n const d = calculatePerpendicularDistance(coord1, coord2, mouse);\n const direction = calculatePositionRelativeToLine(coord1, coord2, mouse);\n const coord3 = calculatePerpendicularCoord(coord1, coord2, direction * d);\n const coord4 = calculateFourthCoord(coord1, coord2, coord3);\n const pList: CoordArray[] = [];\n pList.push(coord1, coord2, coord3, coord4, coord1);\n return pList;\n }\n}\n\n/**\n * 已知p1,p2,p3三点,计算p3到p1p2的垂直距离\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculatePerpendicularDistance(p1: CoordArray, p2: CoordArray, p3: CoordArray) {\n // 计算向量V的分量\n const vx = p2[0] - p1[0];\n const vy = p2[1] - p1[1];\n // 计算P1P3的分量\n const px = p3[0] - p1[0];\n const py = p3[1] - p1[1];\n // 计算向量V的模长\n const vMagnitude = Math.hypot(vx, vy);\n // 计算点积\n const dotProduct = px * vx + py * vy;\n // 计算投影长度\n const projectionLength = dotProduct / vMagnitude;\n // 计算P1P3的模长\n const pMagnitude = Math.hypot(px, py);\n // 计算垂直距离\n const perpendicularDistance = Math.sqrt(pMagnitude * pMagnitude - projectionLength * projectionLength);\n return perpendicularDistance;\n}\n\n/**\n * 已知p1,p2,两点,判断p3点在p1p2的左右,返回-1右侧,0线上,1左侧\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculatePositionRelativeToLine(p1: CoordArray, p2: CoordArray, p3: CoordArray) {\n const v1 = {\n x: p2[0] - p1[0],\n y: p2[1] - p1[1],\n };\n const v2 = {\n x: p3[0] - p1[0],\n y: p3[1] - p1[1],\n };\n const crossProduct = v1.x * v2.y - v1.y * v2.x;\n const direction = crossProduct > 0 ? 1 : -1;\n if (p1[1] > p2[1]) {\n return direction;\n }\n return -direction;\n}\n\n/**\n * 已知p1,p2,p3点求矩形的p4点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateFourthCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const x = p1[0] + p3[0] - p2[0];\n const y = p1[1] + p3[1] - p2[1];\n return [x, y];\n}\n\n/**\n * 已知p1,p2两点和距离d,求距离p1p2垂直距离为d的点p3\n * @param {*} p1\n * @param {*} p2\n * @param {*} d\n */\nexport function calculatePerpendicularCoord(p1: CoordArray, p2: CoordArray, d: number): CoordArray {\n // 计算p1p2的斜率\n const m = (p2[1] - p1[1]) / (p2[0] - p1[0]);\n\n let x, y;\n // 计算垂线的斜率\n if (m !== 0) {\n const perpendicularSlope = -1 / m;\n // 根据垂线斜率和已知点p2的坐标,得到垂线方程中的常数项\n const c = p2[1] - perpendicularSlope * p2[0];\n // 解垂线方程,求解x和y的值\n x = d * Math.sqrt(1 / (1 + perpendicularSlope ** 2)) + p2[0];\n y = perpendicularSlope * x + c;\n }\n else {\n x = p2[0];\n y = p2[1] - d;\n }\n // 返回垂线另一端点的坐标\n return [x, y];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 斜矩形2\n *\n */\nexport function rectinclined2(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n const [coord1, coord2, mouse] = [coords[0], coords[1], coords[2]];\n const intersect = calculateIntersectionCoord(coord1, coord2, mouse);\n const coord4 = calculateFourthCoord(coord1, intersect, mouse);\n const pList: CoordArray[] = [];\n pList.push(coord1, intersect, mouse, coord4, coord1);\n return pList;\n }\n}\n\n/**\n * 已知p1,p2,p3点求矩形的p4点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateFourthCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const x = p1[0] + p3[0] - p2[0];\n const y = p1[1] + p3[1] - p2[1];\n return [x, y];\n}\n\n/**\n * 已知p1点和p2点,求p3点到p1p2垂线的交点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateIntersectionCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const v = {\n x: p2[0] - p1[0],\n y: p2[1] - p1[1],\n };\n const u = {\n x: p3[0] - p1[0],\n y: p3[1] - p1[1],\n };\n const projectionLength = (u.x * v.x + u.y * v.y) / (v.x * v.x + v.y * v.y);\n const intersectionCoord: { x: number; y: number } = {\n x: p1[0] + v.x * projectionLength,\n y: p1[1] + v.y * projectionLength,\n };\n return [intersectionCoord.x, intersectionCoord.y];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 扇形\n *\n */\nimport { getArcCoords, getAzimuth, mathDistance } from './helper';\n\nexport function sector(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 2');\n }\n else {\n const [center, coord2, coord3] = [coords[0], coords[1], coords[2]];\n const radius = mathDistance(coord2, center);\n const startAngle = getAzimuth(coord2, center);\n const endAngle = getAzimuth(coord3, center);\n const pList = getArcCoords(center, radius, startAngle, endAngle);\n pList.push(center, pList[0]);\n return pList;\n }\n}\n"],"mappings":";;;AAEA,MAAa,gBAAgB;AAC7B,MAAa,UAAU,KAAK,KAAK;AACjC,MAAa,iBAAiB;AAC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A,uBAAqB,IAAgB,IAAgB,IAA4B;AAG/F,QAAO,CAFG,GAAG,KAAK,GAAG,KAAK,GAAG,IACnB,GAAG,KAAK,GAAG,KAAK,GAAG,GAChB;;;;;;;;AASf,SAAgB,2BAA2B,IAAgB,IAAgB,IAA4B;CACrG,MAAM,IAAI;EACR,GAAG,GAAG,KAAK,GAAG;EACd,GAAG,GAAG,KAAK,GAAG;EACf;CACD,MAAM,IAAI;EACR,GAAG,GAAG,KAAK,GAAG;EACd,GAAG,GAAG,KAAK,GAAG;EACf;CACD,MAAM,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;CACxE,MAAM,oBAA8C;EAClD,GAAG,GAAG,KAAK,EAAE,IAAI;EACjB,GAAG,GAAG,KAAK,EAAE,IAAI;EAClB;AACD,QAAO,CAAC,kBAAkB,GAAG,kBAAkB,EAAE;;;;;;;;;AC7CnD,SAAgB,OAAO,QAAoC;AAEzD,KADoB,OAAO,SACT,EAChB,OAAM,IAAI,MAAM,0BAA0B;MAEvC;EACH,MAAM,CAAC,QAAQ,QAAQ,UAAU;GAAC,OAAO;GAAI,OAAO;GAAI,OAAO;GAAG;EAIlE,MAAM,QAAQ,aAAa,QAHZ,aAAa,QAAQ,OAAO,EACxB,WAAW,QAAQ,OAAO,EAC5B,WAAW,QAAQ,OAAO,CACqB;AAChE,QAAM,KAAK,QAAQ,MAAM,GAAG;AAC5B,SAAO"}
1
+ {"version":3,"file":"index.cjs","names":["getTempCoord4","getArrowCoords","getArrowHeadCoords","getArrowBodyCoords","calculateFourthCoord"],"sources":["../src/helper.ts","../src/arc.ts","../src/arrowAttackDirection.ts","../src/arrowAttackDirectionTailed.ts","../src/arrowClamped.ts","../src/arrowStraightSharp.ts","../src/arrowStraight.ts","../src/arrowStraightFine.ts","../src/arrowUnitCombatOperation.ts","../src/arrowUnitCombatOperationTailed.ts","../src/assemblingPlace.ts","../src/circle.ts","../src/closedCurve.ts","../src/curve.ts","../src/ellipse.ts","../src/lune.ts","../src/rectAngle.ts","../src/rectinclined1.ts","../src/rectinclined2.ts","../src/sector.ts"],"sourcesContent":["import type { CoordArray } from '@vesium/shared';\n\nexport const FITTING_COUNT = 100;\nexport const HALF_PI = Math.PI / 2;\nexport const ZERO_TOLERANCE = 0.0001;\nexport const TWO_PI = Math.PI * 2;\n\n/**\n * 计算两个坐标之间的距离\n * @param coord1\n * @param coord2\n */\nexport function mathDistance(coord1: CoordArray, coord2: CoordArray): number {\n return Math.hypot(coord1[0] - coord2[0], coord1[1] - coord2[1]);\n}\n\n/**\n * 计算点集合的总距离\n * @param points\n */\nexport function wholeDistance(points: CoordArray[]): number {\n let distance = 0;\n if (points && Array.isArray(points) && points.length > 0) {\n points.forEach((item, index) => {\n if (index < points.length - 1) {\n distance += mathDistance(item, points[index + 1]);\n }\n });\n }\n return distance;\n}\n/**\n * 获取基础长度\n * @param points\n */\nexport const getBaseLength = (points: CoordArray[]): number => wholeDistance(points) ** 0.99;\n\n/**\n * 求取两个坐标的中间坐标\n * @param coord1\n * @param coord2\n */\nexport function mid(coord1: CoordArray, coord2: CoordArray): CoordArray {\n return [\n (coord1[0] + coord2[0]) / 2,\n (coord1[1] + coord2[1]) / 2,\n ];\n}\n\n/**\n * 通过三个点确定一个圆的中心点\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getCircleCenterOfThreeCoords(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray {\n const coordA = [(coord1[0] + coord2[0]) / 2, (coord1[1] + coord2[1]) / 2] as CoordArray;\n const coordB = [coordA[0] - coord1[1] + coord2[1], coordA[1] + coord1[0] - coord2[0]] as CoordArray;\n const coordC = [(coord1[0] + coord3[0]) / 2, (coord1[1] + coord3[1]) / 2] as CoordArray;\n const coordD = [coordC[0] - coord1[1] + coord3[1], coordC[1] + coord1[0] - coord3[0]] as CoordArray;\n return getIntersectCoord(coordA, coordB, coordC, coordD);\n}\n\n/**\n * 获取交集的点\n * @param coordA\n * @param coordB\n * @param coordC\n * @param coordD\n */\nexport function getIntersectCoord(coordA: CoordArray, coordB: CoordArray, coordC: CoordArray, coordD: CoordArray): CoordArray {\n if (coordA[1] === coordB[1]) {\n const f = (coordD[0] - coordC[0]) / (coordD[1] - coordC[1]);\n const x = f * (coordA[1] - coordC[1]) + coordC[0];\n const y = coordA[1];\n return [x, y];\n }\n if (coordC[1] === coordD[1]) {\n const e = (coordB[0] - coordA[0]) / (coordB[1] - coordA[1]);\n const x = e * (coordC[1] - coordA[1]) + coordA[0];\n const y = coordC[1];\n return [x, y];\n }\n const e = (coordB[0] - coordA[0]) / (coordB[1] - coordA[1]);\n const f = (coordD[0] - coordC[0]) / (coordD[1] - coordC[1]);\n const y = (e * coordA[1] - coordA[0] - f * coordC[1] + coordC[0]) / (e - f);\n const x = e * y - e * coordA[1] + coordA[0];\n return [x, y];\n}\n\n/**\n * 获取方位角(地平经度)\n * @param startCoord\n * @param endCoord\n */\nexport function getAzimuth(startCoord: CoordArray, endCoord: CoordArray): number {\n let azimuth = 0;\n const angle = Math.asin(Math.abs(endCoord[1] - startCoord[1]) / mathDistance(startCoord, endCoord));\n if (endCoord[1] >= startCoord[1] && endCoord[0] >= startCoord[0]) {\n azimuth = angle + Math.PI;\n }\n else if (endCoord[1] >= startCoord[1] && endCoord[0] < startCoord[0]) {\n azimuth = Math.PI * 2 - angle;\n }\n else if (endCoord[1] < startCoord[1] && endCoord[0] < startCoord[0]) {\n azimuth = angle;\n }\n else if (endCoord[1] < startCoord[1] && endCoord[0] >= startCoord[0]) {\n azimuth = Math.PI - angle;\n }\n return azimuth;\n}\n\n/**\n * 通过三个点获取方位角\n * @param coordA\n * @param coordB\n * @param coordC\n */\nexport function getAngleOfThreeCoords(coordA: CoordArray, coordB: CoordArray, coordC: CoordArray): number {\n const angle = getAzimuth(coordB, coordA) - getAzimuth(coordB, coordC);\n return angle < 0 ? angle + Math.PI * 2 : angle;\n}\n\n/**\n * 判断是否是顺时针\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function isClockWise(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): boolean {\n return (coord3[1] - coord1[1]) * (coord2[0] - coord1[0]) > (coord2[1] - coord1[1]) * (coord3[0] - coord1[0]);\n}\n\n/**\n * 获取线上的点\n * @param t\n * @param startCoord\n * @param endCoord\n */\nexport function getCoordOnLine(t: number, startCoord: CoordArray, endCoord: CoordArray): CoordArray {\n const x = startCoord[0] + t * (endCoord[0] - startCoord[0]);\n const y = startCoord[1] + t * (endCoord[1] - startCoord[1]);\n return [x, y];\n}\n\n/**\n * 获取立方值\n */\nexport function getCubicValue(\n t: number,\n startCoord: CoordArray,\n coord1: CoordArray,\n coord2: CoordArray,\n endCoord: CoordArray,\n): CoordArray {\n t = Math.max(Math.min(t, 1), 0);\n const [tp, t2] = [1 - t, t * t];\n const t3 = t2 * t;\n const tp2 = tp * tp;\n const tp3 = tp2 * tp;\n const x = tp3 * startCoord[0] + 3 * tp2 * t * coord1[0] + 3 * tp * t2 * coord2[0] + t3 * endCoord[0];\n const y = tp3 * startCoord[1] + 3 * tp2 * t * coord1[1] + 3 * tp * t2 * coord2[1] + t3 * endCoord[1];\n return [x, y];\n}\n\n/**\n * 根据起止点和旋转方向求取第三个点\n * @param startCoord\n * @param endCoord\n * @param angle\n * @param distance\n * @param clockWise\n */\nexport function getThirdCoord(startCoord: CoordArray, endCoord: CoordArray, angle: number, distance: number, clockWise?: boolean): CoordArray {\n const azimuth = getAzimuth(startCoord, endCoord);\n const alpha = clockWise ? azimuth + angle : azimuth - angle;\n const dx = distance * Math.cos(alpha);\n const dy = distance * Math.sin(alpha);\n return [endCoord[0] + dx, endCoord[1] + dy];\n}\n\n/**\n * 插值弓形线段点\n * @param center\n * @param radius\n * @param startAngle\n * @param endAngle\n */\nexport function getArcCoords(center: CoordArray, radius: number, startAngle: number, endAngle: number): CoordArray[] {\n let [x, y, coords, angleDiff]: [number, number, CoordArray[], number] = [0, 0, [], endAngle - startAngle];\n angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;\n for (let i = 0; i <= 100; i++) {\n const angle = startAngle + (angleDiff * i) / 100;\n x = center[0] + radius * Math.cos(angle);\n y = center[1] + radius * Math.sin(angle);\n coords.push([x, y]);\n }\n return coords;\n}\n\n/**\n * getBisectorNormals\n * @param t\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getBisectorNormals(t: number, coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray[] {\n const normal = getNormal(coord1, coord2, coord3);\n let [bisectorNormalRight, bisectorNormalLeft, dt, x, y]: [CoordArray, CoordArray, number, number, number] = [\n [0, 0],\n [0, 0],\n 0,\n 0,\n 0,\n ];\n const dist = Math.hypot(normal[0], normal[1]);\n const uX = normal[0] / dist;\n const uY = normal[1] / dist;\n const d1 = mathDistance(coord1, coord2);\n const d2 = mathDistance(coord2, coord3);\n if (dist > ZERO_TOLERANCE) {\n if (isClockWise(coord1, coord2, coord3)) {\n dt = t * d1;\n x = coord2[0] - dt * uY;\n y = coord2[1] + dt * uX;\n bisectorNormalRight = [x, y];\n dt = t * d2;\n x = coord2[0] + dt * uY;\n y = coord2[1] - dt * uX;\n bisectorNormalLeft = [x, y];\n }\n else {\n dt = t * d1;\n x = coord2[0] + dt * uY;\n y = coord2[1] - dt * uX;\n bisectorNormalRight = [x, y];\n dt = t * d2;\n x = coord2[0] - dt * uY;\n y = coord2[1] + dt * uX;\n bisectorNormalLeft = [x, y];\n }\n }\n else {\n x = coord2[0] + t * (coord1[0] - coord2[0]);\n y = coord2[1] + t * (coord1[1] - coord2[1]);\n bisectorNormalRight = [x, y];\n x = coord2[0] + t * (coord3[0] - coord2[0]);\n y = coord2[1] + t * (coord3[1] - coord2[1]);\n bisectorNormalLeft = [x, y];\n }\n return [bisectorNormalRight, bisectorNormalLeft];\n}\n\n/**\n * 获取默认三点的内切圆\n * @param coord1\n * @param coord2\n * @param coord3\n */\nexport function getNormal(coord1: CoordArray, coord2: CoordArray, coord3: CoordArray): CoordArray {\n let dX1 = coord1[0] - coord2[0];\n let dY1 = coord1[1] - coord2[1];\n const d1 = Math.hypot(dX1, dY1);\n dX1 /= d1;\n dY1 /= d1;\n let dX2 = coord3[0] - coord2[0];\n let dY2 = coord3[1] - coord2[1];\n const d2 = Math.hypot(dX2, dY2);\n dX2 /= d2;\n dY2 /= d2;\n const uX = dX1 + dX2;\n const uY = dY1 + dY2;\n return [uX, uY];\n}\n\n/**\n * 获取左边控制点\n * @param controlCoords\n * @param t\n */\nexport function getLeftMostControlCoord(controlCoords: CoordArray[], t: number): CoordArray {\n let [coord1, coord2, coord3, controlX, controlY]: [CoordArray, CoordArray, CoordArray, number, number] = [\n controlCoords[0],\n controlCoords[1],\n controlCoords[2],\n 0,\n 0,\n ];\n const coords = getBisectorNormals(0, coord1, coord2, coord3);\n const normalRight = coords[0];\n const normal = getNormal(coord1, coord2, coord3);\n const dist = Math.hypot(normal[0], normal[1]);\n if (dist > ZERO_TOLERANCE) {\n const midCoord = mid(coord1, coord2);\n const pX = coord1[0] - midCoord[0];\n const pY = coord1[1] - midCoord[1];\n const d1 = mathDistance(coord1, coord2);\n const n = 2 / d1;\n const nX = -n * pY;\n const nY = n * pX;\n const a11 = nX * nX - nY * nY;\n const a12 = 2 * nX * nY;\n const a22 = nY * nY - nX * nX;\n const dX = normalRight[0] - midCoord[0];\n const dY = normalRight[1] - midCoord[1];\n controlX = midCoord[0] + a11 * dX + a12 * dY;\n controlY = midCoord[1] + a12 * dX + a22 * dY;\n }\n else {\n controlX = coord1[0] + t * (coord2[0] - coord1[0]);\n controlY = coord1[1] + t * (coord2[1] - coord1[1]);\n }\n return [controlX, controlY];\n}\n\n/**\n * 获取右边控制点\n * @param controlCoords\n * @param t\n */\nexport function getRightMostControlCoord(controlCoords: CoordArray[], t: number): CoordArray {\n const coordlength = controlCoords.length;\n const coord1 = controlCoords[coordlength - 3];\n const coord2 = controlCoords[coordlength - 2];\n const coord3 = controlCoords[coordlength - 1];\n const coords = getBisectorNormals(0, coord1, coord2, coord3);\n const normalLeft = coords[1];\n const normal = getNormal(coord1, coord2, coord3);\n const dist = Math.hypot(normal[0], normal[1]);\n let [controlX, controlY] = [0, 0];\n if (dist > ZERO_TOLERANCE) {\n const midCoord = mid(coord2, coord3);\n const pX = coord3[0] - midCoord[0];\n const pY = coord3[1] - midCoord[1];\n const d1 = mathDistance(coord2, coord3);\n const n = 2 / d1;\n const nX = -n * pY;\n const nY = n * pX;\n const a11 = nX * nX - nY * nY;\n const a12 = 2 * nX * nY;\n const a22 = nY * nY - nX * nX;\n const dX = normalLeft[0] - midCoord[0];\n const dY = normalLeft[1] - midCoord[1];\n controlX = midCoord[0] + a11 * dX + a12 * dY;\n controlY = midCoord[1] + a12 * dX + a22 * dY;\n }\n else {\n controlX = coord3[0] + t * (coord2[0] - coord3[0]);\n controlY = coord3[1] + t * (coord2[1] - coord3[1]);\n }\n return [controlX, controlY];\n}\n\n/**\n * 插值曲线点\n * @param t\n * @param controlCoords\n */\nexport function getCurveCoords(t: number, controlCoords: CoordArray[]): CoordArray[] {\n let normals = [getLeftMostControlCoord(controlCoords, t)];\n const coords: CoordArray[] = [];\n let coord1: CoordArray, coord2: CoordArray, coord3: CoordArray;\n\n for (let i = 0; i < controlCoords.length - 2; i++) {\n [coord1, coord2, coord3] = [controlCoords[i], controlCoords[i + 1], controlCoords[i + 2]];\n const normalCoords = getBisectorNormals(t, coord1, coord2, coord3);\n normals = normals.concat(normalCoords);\n }\n const rightControl = getRightMostControlCoord(controlCoords, t);\n if (rightControl) {\n normals.push(rightControl);\n }\n for (let i = 0; i < controlCoords.length - 1; i++) {\n coord1 = controlCoords[i];\n coord2 = controlCoords[i + 1];\n coords.push(coord1);\n for (let j = 0; j < FITTING_COUNT; j++) {\n const coord = getCubicValue(j / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n coords.push(coord);\n }\n coords.push(coord2);\n }\n return coords;\n}\n\n/**\n * 贝塞尔曲线\n * @param points\n */\nexport function getBezierCoords(points: CoordArray[]): CoordArray[] {\n if (points.length <= 2) {\n return points;\n }\n const bezierCoords: CoordArray[] = [];\n const n = points.length - 1;\n for (let t = 0; t <= 1; t += 0.01) {\n let [x, y] = [0, 0];\n for (let index = 0; index <= n; index++) {\n const factor = getBinomialFactor(n, index);\n const a = t ** index;\n const b = (1 - t) ** (n - index);\n x += factor * a * b * points[index][0];\n y += factor * a * b * points[index][1];\n }\n bezierCoords.push([x, y]);\n }\n bezierCoords.push(points[n]);\n return bezierCoords;\n}\n\n/**\n * 获取阶乘数据\n * @param n\n */\nexport function getFactorial(n: number): number {\n let result = 1;\n switch (true) {\n case n <= 1:\n result = 1;\n break;\n case n === 2:\n result = 2;\n break;\n case n === 3:\n result = 6;\n break;\n case n === 24:\n result = 24;\n break;\n case n === 5:\n result = 120;\n break;\n default:\n for (let i = 1; i <= n; i++) {\n result *= i;\n }\n break;\n }\n return result;\n}\n\n/**\n * 获取二项分布\n * @param n\n * @param index\n */\nexport function getBinomialFactor(n: number, index: number): number {\n return getFactorial(n) / (getFactorial(index) * getFactorial(n - index));\n}\n\n/**\n * 插值线性点\n * @param points\n */\nexport function getQBSplineCoords(points: CoordArray[]): CoordArray[] {\n if (points.length <= 2) {\n return points;\n }\n const [n, bSplineCoords]: [number, CoordArray[]] = [2, []];\n const m = points.length - n - 1;\n bSplineCoords.push(points[0]);\n for (let i = 0; i <= m; i++) {\n for (let t = 0; t <= 1; t += 0.05) {\n let [x, y] = [0, 0];\n for (let k = 0; k <= n; k++) {\n const factor = getQuadricBSplineFactor(k, t);\n x += factor * points[i + k][0];\n y += factor * points[i + k][1];\n }\n bSplineCoords.push([x, y]);\n }\n }\n bSplineCoords.push(points.at(-1)!);\n return bSplineCoords;\n}\n\n/**\n * 得到二次线性因子\n * @param k\n * @param t\n */\nexport function getQuadricBSplineFactor(k: number, t: number): number {\n let res = 0;\n if (k === 0) {\n res = (t - 1) ** 2 / 2;\n }\n else if (k === 1) {\n res = (-2 * t ** 2 + 2 * t + 1) / 2;\n }\n else if (k === 2) {\n res = t ** 2 / 2;\n }\n return res;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArcCoords, getAzimuth, getCircleCenterOfThreeCoords, isClockWise, mathDistance } from './helper';\n\n/**\n * 标绘画弓形算法,继承线要素相关方法和属性\n */\nexport function arc(coords: CoordArray[]): CoordArray[] {\n const coordlength = coords.length;\n\n if (coordlength <= 2) {\n throw new Error('coords.length must >= 3');\n }\n else {\n let [coord1, coord2, coord3, startAngle, endAngle] = [coords[0], coords[1], coords[2], 0, 0];\n const center = getCircleCenterOfThreeCoords(coord1, coord2, coord3);\n const radius = mathDistance(coord1, center);\n const angle1 = getAzimuth(coord1, center);\n const angle2 = getAzimuth(coord2, center);\n if (isClockWise(coord1, coord2, coord3)) {\n startAngle = angle2;\n endAngle = angle1;\n }\n else {\n startAngle = angle1;\n endAngle = angle2;\n }\n return getArcCoords(center, radius, startAngle, endAngle);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getAngleOfThreeCoords,\n getBaseLength,\n getQBSplineCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n wholeDistance,\n} from './helper';\n\nexport interface AttackArrowOptions {\n headWidthFactor?: number;\n headHeightFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n tailWidthFactor?: number;\n headTailFactor?: number;\n swallowTailFactor?: number;\n swallowTailCoord?: CoordArray;\n}\n/**\n * 尖曲箭头\n */\nexport function arrowAttackDirection(coords: CoordArray[], options: AttackArrowOptions = {}): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n let [tailLeft, tailRight] = [coords[0], coords[1]];\n if (isClockWise(coords[0], coords[1], coords[2])) {\n tailLeft = coords[1];\n tailRight = coords[0];\n }\n const midTail = mid(tailLeft, tailRight);\n const boneCoords = [midTail].concat(coords.slice(2));\n const headCoords = getArrowHeadCoords(boneCoords, {\n tailLeft,\n tailRight,\n ...options,\n });\n if (headCoords && headCoords.length > 4) {\n const [neckLeft, neckRight] = [headCoords[0], headCoords[4]];\n const tailWidthFactor = mathDistance(tailLeft, tailRight) / getBaseLength(boneCoords);\n const bodyCoords = getArrowBodyCoords(boneCoords, neckLeft, neckRight, tailWidthFactor);\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse());\n }\n else {\n return [];\n }\n }\n}\n\nexport interface GetArrowCoordsOptions {\n tailLeft?: CoordArray;\n tailRight?: CoordArray;\n headHeightFactor?: number;\n headTailFactor?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n}\n\n/**\n * 插值箭形上的点\n * @param coord1\n * @param coord2\n * @param coord3\n * @param clockWise\n */\nexport function getArrowCoords(\n coord1: CoordArray,\n coord2: CoordArray,\n coord3: CoordArray,\n clockWise: boolean,\n options: GetArrowCoordsOptions = {},\n): CoordArray[] | undefined {\n const midCoord = mid(coord1, coord2);\n const len = mathDistance(midCoord, coord3);\n let midCoord1 = getThirdCoord(coord3, midCoord, 0, len * 0.3, true);\n let midCoord2 = getThirdCoord(coord3, midCoord, 0, len * 0.5, true);\n midCoord1 = getThirdCoord(midCoord, midCoord1, HALF_PI, len / 5, clockWise);\n midCoord2 = getThirdCoord(midCoord, midCoord2, HALF_PI, len / 4, clockWise);\n const points = [midCoord, midCoord1, midCoord2, coord3];\n const arrowCoords = getArrowHeadCoords(points, options);\n if (arrowCoords && Array.isArray(arrowCoords) && arrowCoords.length > 0) {\n const [neckLeftCoord, neckRightCoord] = [arrowCoords[0], arrowCoords[4]];\n const tailWidthFactor = mathDistance(coord1, coord2) / getBaseLength(points) / 2;\n const bodyCoords = getArrowBodyCoords(points, neckLeftCoord, neckRightCoord, tailWidthFactor);\n if (bodyCoords) {\n const n = bodyCoords.length;\n let lCoords = bodyCoords.slice(0, n / 2);\n let rCoords = bodyCoords.slice(n / 2, n);\n lCoords.push(neckLeftCoord);\n rCoords.push(neckRightCoord);\n lCoords = lCoords.reverse();\n lCoords.push(coord2);\n rCoords = rCoords.reverse();\n rCoords.push(coord1);\n return lCoords.reverse().concat(arrowCoords, rCoords);\n }\n }\n else {\n throw new Error('插值出错');\n }\n}\n\nexport interface GetArrowHeadCoordsOptions {\n tailLeft?: CoordArray;\n tailRight?: CoordArray;\n headHeightFactor?: number;\n headTailFactor?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n neckHeightFactor?: number;\n}\n\n/**\n * 插值头部点\n */\nexport function getArrowHeadCoords(points: CoordArray[], options: GetArrowHeadCoordsOptions): CoordArray[] {\n const {\n tailLeft,\n tailRight,\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n headTailFactor = 0.8,\n } = options;\n\n let len = getBaseLength(points);\n let headHeight = len * headHeightFactor;\n const headCoord = points.at(-1)!;\n len = mathDistance(headCoord, points.at(-2)!);\n let tailWidth = 0;\n if (tailLeft && tailRight) {\n tailWidth = mathDistance(tailLeft, tailRight);\n }\n if (headHeight > tailWidth * headTailFactor) {\n headHeight = tailWidth * headTailFactor;\n }\n const headWidth = headHeight * headWidthFactor;\n const neckWidth = headHeight * neckWidthFactor;\n headHeight = Math.min(headHeight, len);\n const neckHeight = headHeight * neckHeightFactor;\n const headEndCoord = getThirdCoord(points.at(-2)!, headCoord, 0, headHeight, true);\n const neckEndCoord = getThirdCoord(points.at(-2)!, headCoord, 0, neckHeight, true);\n const headLeft = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, false);\n const headRight = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, true);\n const neckLeft = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, false);\n const neckRight = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, true);\n return [neckLeft, headLeft, headCoord, headRight, neckRight];\n}\n\n/**\n * 插值面部分数据\n * @param points\n * @param neckLeft\n * @param neckRight\n * @param tailWidthFactor\n */\nexport function getArrowBodyCoords(points: CoordArray[], neckLeft: CoordArray, neckRight: CoordArray, tailWidthFactor: number): Array<CoordArray> {\n const allLen = wholeDistance(points);\n const len = getBaseLength(points);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = mathDistance(neckLeft, neckRight);\n const widthDif = (tailWidth - neckWidth) / 2;\n\n let tempLen = 0;\n const leftBodyCoords: CoordArray[] = [];\n const rightBodyCoords: CoordArray[] = [];\n for (let i = 1; i < points.length - 1; i++) {\n const angle = getAngleOfThreeCoords(points[i - 1], points[i], points[i + 1]) / 2;\n tempLen += mathDistance(points[i - 1], points[i]);\n const w = (tailWidth / 2 - (tempLen / allLen) * widthDif) / Math.sin(angle);\n const left = getThirdCoord(points[i - 1], points[i], Math.PI - angle, w, true);\n const right = getThirdCoord(points[i - 1], points[i], angle, w, false);\n leftBodyCoords.push(left);\n rightBodyCoords.push(right);\n }\n return leftBodyCoords.concat(rightBodyCoords);\n}\n\n/**\n * 获取对称点\n * @param lineCoord1\n * @param lineCoord2\n * @param coord\n */\nexport function getTempCoord4(lineCoord1: CoordArray, lineCoord2: CoordArray, coord: CoordArray): CoordArray {\n const midCoord = mid(lineCoord1, lineCoord2);\n const len = mathDistance(midCoord, coord);\n const angle = getAngleOfThreeCoords(lineCoord1, midCoord, coord);\n let symCoord;\n let distance1 = 0;\n let distance2 = 0;\n let midCoord2: CoordArray;\n if (angle < HALF_PI) {\n distance1 = len * Math.sin(angle);\n distance2 = len * Math.cos(angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, true);\n }\n else if (angle >= HALF_PI && angle < Math.PI) {\n distance1 = len * Math.sin(Math.PI - angle);\n distance2 = len * Math.cos(Math.PI - angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, false);\n }\n else if (angle >= Math.PI && angle < Math.PI * 1.5) {\n distance1 = len * Math.sin(angle - Math.PI);\n distance2 = len * Math.cos(angle - Math.PI);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, true);\n }\n else {\n distance1 = len * Math.sin(Math.PI * 2 - angle);\n distance2 = len * Math.cos(Math.PI * 2 - angle);\n midCoord2 = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n symCoord = getThirdCoord(midCoord, midCoord2, HALF_PI, distance2, false);\n }\n return symCoord;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, isClockWise, mathDistance, mid } from './helper';\n\nexport interface TailedAttackArrowOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n swallowTailFactor?: number;\n}\n\n/**\n * 燕尾尖曲箭头\n */\nexport function arrowAttackDirectionTailed(coords: CoordArray[], options: TailedAttackArrowOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n swallowTailFactor = 1,\n } = options;\n\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n\n let [tailLeft, tailRight] = [coords[0], coords[1]];\n if (isClockWise(coords[0], coords[1], coords[2])) {\n tailLeft = coords[1];\n tailRight = coords[0];\n }\n const midTail = mid(tailLeft, tailRight);\n const boneCoords = [midTail].concat(coords.slice(2));\n const headCoords = getArrowHeadCoords(boneCoords, {\n tailLeft,\n tailRight,\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const [neckLeft, neckRight] = [headCoords[0], headCoords[4]];\n const tailWidth = mathDistance(tailLeft, tailRight);\n const allLen = getBaseLength(boneCoords);\n const len = allLen * tailWidthFactor * swallowTailFactor;\n const swallowTailCoord = getThirdCoord(boneCoords[1], boneCoords[0], 0, len, true);\n const factor = tailWidth / allLen;\n const bodyCoords = getArrowBodyCoords(boneCoords, neckLeft, neckRight, factor);\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse(), [swallowTailCoord, leftCoords[0]]);\n }\n else {\n return [];\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getAngleOfThreeCoords,\n getBaseLength,\n getBezierCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n wholeDistance,\n} from './helper';\n\n/**\n * 钳击箭头 有效点位长度3,4,5\n */\nexport function arrowClamped(coords: CoordArray[]): CoordArray[] {\n const options = {\n headHeightFactor: 0.25,\n headWidthFactor: 0.3,\n neckHeightFactor: 0.85,\n neckWidthFactor: 0.15,\n };\n\n if (coords.length < 3) {\n throw new Error(`coords.length must >= 3`);\n }\n const [coord1, coord2, coord3] = coords;\n let tempCoord4: CoordArray, connCoord: CoordArray;\n if (coords.length === 3) {\n tempCoord4 = getTempCoord4(coord1, coord2, coord3);\n connCoord = mid(coord1, coord2);\n }\n else if (coords.length === 4) {\n tempCoord4 = coords[3];\n connCoord = mid(coord1, coord2);\n }\n else {\n tempCoord4 = coords[3];\n connCoord = coords[4];\n }\n let leftArrowCoords: CoordArray[];\n let rightArrowCoords: CoordArray[];\n if (isClockWise(coord1, coord2, coord3)) {\n leftArrowCoords = getArrowCoords(coord1, connCoord, tempCoord4, false, options);\n rightArrowCoords = getArrowCoords(connCoord, coord2, coord3, true, options);\n }\n else {\n leftArrowCoords = getArrowCoords(coord2, connCoord, coord3, false, options);\n rightArrowCoords = getArrowCoords(connCoord, coord1, tempCoord4, true, options);\n }\n const m = leftArrowCoords.length;\n const t = (m - 5) / 2;\n const llBodyCoords = leftArrowCoords.slice(0, t);\n const lArrowCoords = leftArrowCoords.slice(t, t + 5);\n let lrBodyCoords = leftArrowCoords.slice(t + 5, m);\n let rlBodyCoords = rightArrowCoords.slice(0, t);\n const rArrowCoords = rightArrowCoords.slice(t, t + 5);\n const rrBodyCoords = rightArrowCoords.slice(t + 5, m);\n rlBodyCoords = getBezierCoords(rlBodyCoords);\n const bodyCoords = getBezierCoords(rrBodyCoords.concat(llBodyCoords.slice(1)));\n lrBodyCoords = getBezierCoords(lrBodyCoords);\n return rlBodyCoords.concat(rArrowCoords, bodyCoords, lArrowCoords, lrBodyCoords);\n}\n\n/**\n * 插值箭形上的点\n * @param coord1 - Wgs84坐标\n * @param coord2 - Wgs84坐标\n * @param coord3 - Wgs84坐标\n * @param clockWise - 是否顺时针\n */\nfunction getArrowCoords(\n coord1: CoordArray,\n coord2: CoordArray,\n coord3: CoordArray,\n clockWise: boolean,\n options: GetArrowHeadCoordsOptions,\n): CoordArray[] {\n const midCoord = mid(coord1, coord2);\n const len = mathDistance(midCoord, coord3);\n let midCoord1 = getThirdCoord(coord3, midCoord, 0, len * 0.3, true);\n let midCoord2 = getThirdCoord(coord3, midCoord, 0, len * 0.5, true);\n midCoord1 = getThirdCoord(midCoord, midCoord1, HALF_PI, len / 5, clockWise);\n midCoord2 = getThirdCoord(midCoord, midCoord2, HALF_PI, len / 4, clockWise);\n const coords = [midCoord, midCoord1, midCoord2, coord3];\n const arrowCoords = getArrowHeadCoords(coords, options);\n if (arrowCoords && Array.isArray(arrowCoords) && arrowCoords.length > 0) {\n const [neckLeftCoord, neckRightCoord] = [arrowCoords[0], arrowCoords[4]];\n const tailWidthFactor = mathDistance(coord1, coord2) / getBaseLength(coords) / 2;\n const bodyCoords = getArrowBodyCoords(coords, neckLeftCoord, neckRightCoord, tailWidthFactor);\n const n = bodyCoords.length;\n let lCoords = bodyCoords.slice(0, n / 2);\n let rCoords = bodyCoords.slice(n / 2, n);\n lCoords.push(neckLeftCoord);\n rCoords.push(neckRightCoord);\n lCoords = lCoords.reverse();\n lCoords.push(coord2);\n rCoords = rCoords.reverse();\n rCoords.push(coord1);\n return lCoords.reverse().concat(arrowCoords, rCoords);\n }\n else {\n throw new Error('插值出错');\n }\n}\ninterface GetArrowHeadCoordsOptions {\n headHeightFactor: number;\n headWidthFactor: number;\n neckWidthFactor: number;\n neckHeightFactor: number;\n}\n\n/**\n * 插值头部点\n * @param coords\n */\nfunction getArrowHeadCoords(coords: CoordArray[], options: GetArrowHeadCoordsOptions): CoordArray[] {\n const { headHeightFactor, headWidthFactor, neckWidthFactor, neckHeightFactor } = options;\n\n const len = getBaseLength(coords);\n const headHeight = len * headHeightFactor;\n const headCoord = coords.at(-1)!;\n const headWidth = headHeight * headWidthFactor;\n const neckWidth = headHeight * neckWidthFactor;\n const neckHeight = headHeight * neckHeightFactor;\n const headEndCoord = getThirdCoord(coords.at(-2)!, headCoord, 0, headHeight, true);\n const neckEndCoord = getThirdCoord(coords.at(-2)!, headCoord, 0, neckHeight, true);\n const headLeft = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, false);\n const headRight = getThirdCoord(headCoord, headEndCoord, HALF_PI, headWidth, true);\n const neckLeft = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, false);\n const neckRight = getThirdCoord(headCoord, neckEndCoord, HALF_PI, neckWidth, true);\n return [neckLeft, headLeft, headCoord, headRight, neckRight];\n}\n\n/**\n * 插值面部分数据\n * @param coords\n * @param neckLeft\n * @param neckRight\n * @param tailWidthFactor\n */\nfunction getArrowBodyCoords(\n coords: CoordArray[],\n neckLeft: CoordArray,\n neckRight: CoordArray,\n tailWidthFactor: number,\n): CoordArray[] {\n const allLen = wholeDistance(coords);\n const len = getBaseLength(coords);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = mathDistance(neckLeft, neckRight);\n const widthDif = (tailWidth - neckWidth) / 2;\n let tempLen = 0;\n const leftBodyCoords: CoordArray[] = [];\n const rightBodyCoords: CoordArray[] = [];\n for (let i = 1; i < coords.length - 1; i++) {\n const angle = getAngleOfThreeCoords(coords[i - 1], coords[i], coords[i + 1]) / 2;\n tempLen += mathDistance(coords[i - 1], coords[i]);\n const w = (tailWidth / 2 - (tempLen / allLen) * widthDif) / Math.sin(angle);\n const left = getThirdCoord(coords[i - 1], coords[i], Math.PI - angle, w, true);\n const right = getThirdCoord(coords[i - 1], coords[i], angle, w, false);\n leftBodyCoords.push(left);\n rightBodyCoords.push(right);\n }\n return leftBodyCoords.concat(rightBodyCoords);\n}\n\n/**\n * 获取对称点\n * @param lineCoord1\n * @param lineCoord2\n * @param coord\n */\nfunction getTempCoord4(lineCoord1: CoordArray, lineCoord2: CoordArray, coord: CoordArray): CoordArray {\n const midCoord = mid(lineCoord1, lineCoord2);\n const len = mathDistance(midCoord, coord);\n const angle = getAngleOfThreeCoords(lineCoord1, midCoord, coord);\n if (angle < HALF_PI) {\n const distance1 = len * Math.sin(angle);\n const distance2 = len * Math.cos(angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, true);\n }\n else if (angle >= HALF_PI && angle < Math.PI) {\n const distance1 = len * Math.sin(Math.PI - angle);\n const distance2 = len * Math.cos(Math.PI - angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, false);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, false);\n }\n else if (angle >= Math.PI && angle < Math.PI * 1.5) {\n const distance1 = len * Math.sin(angle - Math.PI);\n const distance2 = len * Math.cos(angle - Math.PI);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, true);\n }\n else {\n const distance1 = len * Math.sin(Math.PI * 2 - angle);\n const distance2 = len * Math.cos(Math.PI * 2 - angle);\n const mid = getThirdCoord(lineCoord1, midCoord, HALF_PI, distance1, true);\n return getThirdCoord(midCoord, mid, HALF_PI, distance2, false);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getBaseLength, getThirdCoord, HALF_PI } from './helper';\n\nexport interface FineArrowOptions {\n neckAngle?: number;\n headAngle?: number;\n headWidthFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n}\n\n/**\n * 尖箭头\n *\n */\nexport function arrowStraightSharp(coords: CoordArray[], options: FineArrowOptions = {}): CoordArray[] {\n const {\n tailWidthFactor = 0.1,\n neckWidthFactor = 0.2,\n headWidthFactor = 0.25,\n headAngle = Math.PI / 8.5,\n neckAngle = Math.PI / 13,\n } = options;\n\n const coordlength = coords.length;\n\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n const [coord1, coord2] = [coords[0], coords[1]];\n const len = getBaseLength(coords);\n const tailWidth = len * tailWidthFactor;\n const neckWidth = len * neckWidthFactor;\n const headWidth = len * headWidthFactor;\n const tailLeft = getThirdCoord(coord2, coord1, HALF_PI, tailWidth, true);\n const tailRight = getThirdCoord(coord2, coord1, HALF_PI, tailWidth, false);\n const headLeft = getThirdCoord(coord1, coord2, headAngle, headWidth, false);\n const headRight = getThirdCoord(coord1, coord2, headAngle, headWidth, true);\n const neckLeft = getThirdCoord(coord1, coord2, neckAngle, neckWidth, false);\n const neckRight = getThirdCoord(coord1, coord2, neckAngle, neckWidth, true);\n const pList = [tailLeft, neckLeft, headLeft, coord2, headRight, neckRight, tailRight];\n return pList;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { arrowStraightSharp } from './arrowStraightSharp';\n\n/**\n * 直箭头\n */\nexport function arrowStraight(coords: CoordArray[]): CoordArray[] {\n const tailWidthFactor = 0.05;\n const neckWidthFactor = 0.1;\n const headWidthFactor = 0.15;\n\n const headAngle = Math.PI / 4;\n const neckAngle = Math.PI * 0.17741;\n return arrowStraightSharp(coords, {\n tailWidthFactor,\n neckWidthFactor,\n headWidthFactor,\n headAngle,\n neckAngle,\n });\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getThirdCoord, mathDistance } from './helper';\n\n/**\n * 细直箭头\n */\nexport function arrowStraightFine(coords: CoordArray[]): CoordArray[] {\n const maxArrowLength = 3000000;\n const arrowLengthScale = 5;\n\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n const [coord1, coord2] = [coords[0], coords[1]];\n const distance = mathDistance(coord1, coord2);\n let len = distance / arrowLengthScale;\n len = Math.min(len, maxArrowLength);\n const leftCoord = getThirdCoord(coord1, coord2, Math.PI / 6, len, false);\n const rightCoord = getThirdCoord(coord1, coord2, Math.PI / 6, len, true);\n return [coord1, coord2, leftCoord, coord2, rightCoord];\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, HALF_PI } from './helper';\n\nexport interface SquadCombatOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n}\n\n/**\n * 分队战斗行动(尖曲箭头)\n */\nexport function arrowUnitCombatOperation(coords: CoordArray[], options: SquadCombatOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n } = options;\n\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n else {\n const allLen = getBaseLength(coords);\n const tailWidth = allLen * tailWidthFactor;\n const tailLeft = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, false);\n const tailRight = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, true);\n const headCoords = getArrowHeadCoords(coords, {\n tailLeft,\n tailRight,\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const neckLeft = headCoords[0];\n const neckRight = headCoords[4];\n const bodyCoords = getArrowBodyCoords(coords, neckLeft, neckRight, tailWidthFactor);\n\n const coordlength = bodyCoords.length;\n let leftCoords = [tailLeft].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailRight].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse());\n }\n else {\n return [];\n }\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getArrowBodyCoords, getArrowHeadCoords } from './arrowAttackDirection';\nimport { getBaseLength, getQBSplineCoords, getThirdCoord, HALF_PI } from './helper';\n\nexport interface TailedSquadCombatOptions {\n headHeightFactor?: number;\n headWidthFactor?: number;\n neckHeightFactor?: number;\n neckWidthFactor?: number;\n tailWidthFactor?: number;\n headTailFactor?: number;\n swallowTailFactor?: number;\n swallowTailCoord?: CoordArray;\n}\n\n/**\n * 燕尾尖箭头\n */\nexport function arrowUnitCombatOperationTailed(coords: CoordArray[], options: TailedSquadCombatOptions = {}): CoordArray[] {\n const {\n headHeightFactor = 0.18,\n headWidthFactor = 0.3,\n neckHeightFactor = 0.85,\n neckWidthFactor = 0.15,\n tailWidthFactor = 0.1,\n swallowTailFactor = 1,\n } = options;\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const allLen = getBaseLength(coords);\n const tailWidth = allLen * tailWidthFactor;\n const tailLeft = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, false);\n const tailRight = getThirdCoord(coords[1], coords[0], HALF_PI, tailWidth, true);\n const len = tailWidth * swallowTailFactor;\n const swallowTailCoord = getThirdCoord(coords[1], coords[0], 0, len, true);\n const tailCoords = [tailLeft, swallowTailCoord, tailRight];\n\n const headCoords = getArrowHeadCoords(coords, {\n tailLeft: tailCoords[0],\n tailRight: tailCoords[2],\n headHeightFactor,\n headWidthFactor,\n neckWidthFactor,\n neckHeightFactor,\n });\n if (headCoords && headCoords.length > 4) {\n const neckLeft = headCoords[0];\n const neckRight = headCoords[4];\n const bodyCoords = getArrowBodyCoords(coords, neckLeft, neckRight, tailWidthFactor);\n\n const coordlength = bodyCoords.length;\n let leftCoords = [tailCoords[0]].concat(bodyCoords.slice(0, coordlength / 2));\n leftCoords.push(neckLeft);\n let rightCoords = [tailCoords[2]].concat(bodyCoords.slice(coordlength / 2, coordlength));\n rightCoords.push(neckRight);\n leftCoords = getQBSplineCoords(leftCoords);\n rightCoords = getQBSplineCoords(rightCoords);\n return leftCoords.concat(headCoords, rightCoords.reverse(), [tailCoords[1], leftCoords[0]]);\n }\n return [];\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, getBisectorNormals, getCubicValue, mid } from './helper';\n\n/**\n * 集结地\n *\n */\nexport function assemblingPlace(coords: CoordArray[]): CoordArray[] {\n if (coords.length < 3) {\n throw new Error(`coords.length must >= 3`);\n }\n const t = 0.4;\n\n const midCoord = mid(coords[0], coords[2]);\n coords.push(midCoord, coords[0], coords[1]);\n let normals: CoordArray[] = [];\n const pList: CoordArray[] = [];\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n const coord3 = coords[i + 2];\n const normalCoords = getBisectorNormals(t, coord1, coord2, coord3);\n normals = normals.concat(normalCoords);\n }\n const count = normals.length;\n normals = [normals[count - 1]].concat(normals.slice(0, count - 1));\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n pList.push(coord1);\n for (let t = 0; t <= FITTING_COUNT; t++) {\n const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n pList.push(coord);\n }\n pList.push(coord2);\n }\n return pList;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { mathDistance } from './helper';\n\n/**\n * 标绘画圆算法,继承面要素相关方法和属性\n */\nexport function circle(coords: CoordArray[]): CoordArray[] {\n const coordlength = coords.length;\n if (coordlength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const center = coords[0];\n const radius = mathDistance(center as CoordArray, coords[1]);\n let [x, y, angle] = [0, 0, 0];\n const _coords: CoordArray[] = [];\n for (let i = 0; i <= 100; i++) {\n angle = (Math.PI * 2 * i) / 100;\n x = center[0] + radius * Math.cos(angle);\n y = center[1] + radius * Math.sin(angle);\n _coords.push([x, y]);\n }\n return _coords;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, getBisectorNormals, getCubicValue } from './helper';\n/**\n * 闭合曲面\n *\n */\nexport function closedCurve(coords: CoordArray[]): CoordArray[] {\n const t = 0.3;\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n coords.push(coords[0], coords[1]);\n let normals: CoordArray[] = [];\n const pList: CoordArray[] = [];\n for (let i = 0; i < coords.length - 2; i++) {\n const normalCoords = getBisectorNormals(t, coords[i], coords[i + 1], coords[i + 2]);\n normals = normals.concat(normalCoords);\n }\n const coordlength = normals.length;\n normals = [normals[coordlength - 1]].concat(normals.slice(0, coordlength - 1));\n for (let i = 0; i < coords.length - 2; i++) {\n const coord1 = coords[i];\n const coord2 = coords[i + 1];\n pList.push(coord1);\n for (let t = 0; t <= FITTING_COUNT; t++) {\n const coord = getCubicValue(t / FITTING_COUNT, coord1, normals[i * 2], normals[i * 2 + 1], coord2);\n pList.push(coord);\n }\n pList.push(coord2);\n }\n return pList;\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { getCurveCoords } from './helper';\n/**\n * 标绘曲线算法\n */\nexport function curve(coords: CoordArray[]): CoordArray[] {\n const t = 0.3;\n const coordlength = coords.length;\n if (coordlength < 3) {\n throw new Error('coords.length must >= 2');\n }\n else {\n return getCurveCoords(t, coords);\n }\n}\n","import type { CoordArray } from '@vesium/shared';\nimport { FITTING_COUNT, mid } from './helper';\n\n/**\n * 标绘画椭圆算法,继承面要素相关方法和属性\n */\nexport function ellipse(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n\n if (coordLength < 2) {\n throw new Error('coords.length must >= 2');\n }\n const [coord1, coord2] = [coords[0], coords[1]];\n const center = mid(coord1, coord2);\n const majorRadius = Math.abs((coord1[0] - coord2[0]) / 2);\n const minorRadius = Math.abs((coord1[1] - coord2[1]) / 2);\n let [x, y, angle] = [0, 0, 0];\n const _coords: CoordArray[] = [];\n for (let i = 0; i <= FITTING_COUNT; i++) {\n angle = (Math.PI * 2 * i) / FITTING_COUNT;\n x = center[0] + majorRadius * Math.cos(angle);\n y = center[1] + minorRadius * Math.sin(angle);\n coords.push([x, y]);\n }\n return _coords;\n}\n","import type { CoordArray } from '@vesium/shared';\nimport {\n getArcCoords,\n getAzimuth,\n getCircleCenterOfThreeCoords,\n getThirdCoord,\n HALF_PI,\n isClockWise,\n mathDistance,\n mid,\n} from './helper';\n\n//\n\n/**\n * 弓形\n */\nexport function lune(coords: CoordArray[]): CoordArray[] {\n coords = [...coords];\n const coordLength = coords.length;\n\n if (coordLength < 2) {\n throw new Error('coords.length must >= 2');\n }\n\n if (coordLength === 2) {\n const midCoord = mid(coords[0], coords[1]);\n const d = mathDistance(coords[0], midCoord);\n const coord = getThirdCoord(coords[0], midCoord, HALF_PI, d);\n coords.push(coord);\n }\n\n let [coord1, coord2, coord3, startAngle, endAngle] = [coords[0], coords[1], coords[2], 0, 0];\n const center = getCircleCenterOfThreeCoords(coord1, coord2, coord3);\n const radius = mathDistance(coord1, center);\n const angle1 = getAzimuth(coord1, center);\n const angle2 = getAzimuth(coord2, center);\n if (isClockWise(coord1, coord2, coord3)) {\n startAngle = angle2;\n endAngle = angle1;\n }\n else {\n startAngle = angle1;\n endAngle = angle2;\n }\n coords = getArcCoords(center, radius, startAngle, endAngle);\n coords.push(coords[0]);\n return coords;\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 规则矩形\n *\n */\nexport function rectAngle(coords: CoordArray[]): CoordArray[] {\n if (coords.length < 2) {\n throw new Error('coords.length must >= 2');\n }\n const [startCoord, endCoord] = coords;\n return [startCoord, [startCoord[0], endCoord[1]], endCoord, [endCoord[0], startCoord[1]], startCoord];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 斜矩形1\n *\n */\nexport function rectinclined1(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n const [coord1, coord2, mouse] = [coords[0], coords[1], coords[2]];\n const d = calculatePerpendicularDistance(coord1, coord2, mouse);\n const direction = calculatePositionRelativeToLine(coord1, coord2, mouse);\n const coord3 = calculatePerpendicularCoord(coord1, coord2, direction * d);\n const coord4 = calculateFourthCoord(coord1, coord2, coord3);\n const pList: CoordArray[] = [];\n pList.push(coord1, coord2, coord3, coord4, coord1);\n return pList;\n }\n}\n\n/**\n * 已知p1,p2,p3三点,计算p3到p1p2的垂直距离\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculatePerpendicularDistance(p1: CoordArray, p2: CoordArray, p3: CoordArray) {\n // 计算向量V的分量\n const vx = p2[0] - p1[0];\n const vy = p2[1] - p1[1];\n // 计算P1P3的分量\n const px = p3[0] - p1[0];\n const py = p3[1] - p1[1];\n // 计算向量V的模长\n const vMagnitude = Math.hypot(vx, vy);\n // 计算点积\n const dotProduct = px * vx + py * vy;\n // 计算投影长度\n const projectionLength = dotProduct / vMagnitude;\n // 计算P1P3的模长\n const pMagnitude = Math.hypot(px, py);\n // 计算垂直距离\n const perpendicularDistance = Math.sqrt(pMagnitude * pMagnitude - projectionLength * projectionLength);\n return perpendicularDistance;\n}\n\n/**\n * 已知p1,p2,两点,判断p3点在p1p2的左右,返回-1右侧,0线上,1左侧\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculatePositionRelativeToLine(p1: CoordArray, p2: CoordArray, p3: CoordArray) {\n const v1 = {\n x: p2[0] - p1[0],\n y: p2[1] - p1[1],\n };\n const v2 = {\n x: p3[0] - p1[0],\n y: p3[1] - p1[1],\n };\n const crossProduct = v1.x * v2.y - v1.y * v2.x;\n const direction = crossProduct > 0 ? 1 : -1;\n if (p1[1] > p2[1]) {\n return direction;\n }\n return -direction;\n}\n\n/**\n * 已知p1,p2,p3点求矩形的p4点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateFourthCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const x = p1[0] + p3[0] - p2[0];\n const y = p1[1] + p3[1] - p2[1];\n return [x, y];\n}\n\n/**\n * 已知p1,p2两点和距离d,求距离p1p2垂直距离为d的点p3\n * @param {*} p1\n * @param {*} p2\n * @param {*} d\n */\nexport function calculatePerpendicularCoord(p1: CoordArray, p2: CoordArray, d: number): CoordArray {\n // 计算p1p2的斜率\n const m = (p2[1] - p1[1]) / (p2[0] - p1[0]);\n\n let x, y;\n // 计算垂线的斜率\n if (m !== 0) {\n const perpendicularSlope = -1 / m;\n // 根据垂线斜率和已知点p2的坐标,得到垂线方程中的常数项\n const c = p2[1] - perpendicularSlope * p2[0];\n // 解垂线方程,求解x和y的值\n x = d * Math.sqrt(1 / (1 + perpendicularSlope ** 2)) + p2[0];\n y = perpendicularSlope * x + c;\n }\n else {\n x = p2[0];\n y = p2[1] - d;\n }\n // 返回垂线另一端点的坐标\n return [x, y];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 斜矩形2\n *\n */\nexport function rectinclined2(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 3');\n }\n else {\n const [coord1, coord2, mouse] = [coords[0], coords[1], coords[2]];\n const intersect = calculateIntersectionCoord(coord1, coord2, mouse);\n const coord4 = calculateFourthCoord(coord1, intersect, mouse);\n const pList: CoordArray[] = [];\n pList.push(coord1, intersect, mouse, coord4, coord1);\n return pList;\n }\n}\n\n/**\n * 已知p1,p2,p3点求矩形的p4点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateFourthCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const x = p1[0] + p3[0] - p2[0];\n const y = p1[1] + p3[1] - p2[1];\n return [x, y];\n}\n\n/**\n * 已知p1点和p2点,求p3点到p1p2垂线的交点\n * @param {*} p1\n * @param {*} p2\n * @param {*} p3\n */\nexport function calculateIntersectionCoord(p1: CoordArray, p2: CoordArray, p3: CoordArray): CoordArray {\n const v = {\n x: p2[0] - p1[0],\n y: p2[1] - p1[1],\n };\n const u = {\n x: p3[0] - p1[0],\n y: p3[1] - p1[1],\n };\n const projectionLength = (u.x * v.x + u.y * v.y) / (v.x * v.x + v.y * v.y);\n const intersectionCoord: { x: number; y: number } = {\n x: p1[0] + v.x * projectionLength,\n y: p1[1] + v.y * projectionLength,\n };\n return [intersectionCoord.x, intersectionCoord.y];\n}\n","import type { CoordArray } from '@vesium/shared';\n\n/**\n * 扇形\n *\n */\nimport { getArcCoords, getAzimuth, mathDistance } from './helper';\n\nexport function sector(coords: CoordArray[]): CoordArray[] {\n const coordLength = coords.length;\n if (coordLength < 3) {\n throw new Error('coords.length must >= 2');\n }\n else {\n const [center, coord2, coord3] = [coords[0], coords[1], coords[2]];\n const radius = mathDistance(coord2, center);\n const startAngle = getAzimuth(coord2, center);\n const endAngle = getAzimuth(coord3, center);\n const pList = getArcCoords(center, radius, startAngle, endAngle);\n pList.push(center, pList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