pacem 0.60.2-young → 0.60.2-zeno

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.
Files changed (57) hide show
  1. package/dist/css/pacem-dark-content.min.css +1 -1
  2. package/dist/css/pacem-dark-shell.min.css +1 -1
  3. package/dist/css/pacem-dark.min.css +1 -1
  4. package/dist/css/pacem-light-content.min.css +1 -1
  5. package/dist/css/pacem-light-shell.min.css +1 -1
  6. package/dist/css/pacem-light.min.css +1 -1
  7. package/dist/css/pacem-phousys-content.min.css +1 -1
  8. package/dist/css/pacem-phousys-shell.min.css +1 -1
  9. package/dist/css/pacem-phousys.min.css +1 -1
  10. package/dist/js/azure-maps.d.ts +1 -1
  11. package/dist/js/pacem-2d.d.ts +1 -1
  12. package/dist/js/pacem-2d.js +1 -1
  13. package/dist/js/pacem-2d.min.js +1 -1
  14. package/dist/js/pacem-3d.d.ts +1 -1
  15. package/dist/js/pacem-3d.js +1 -1
  16. package/dist/js/pacem-3d.min.js +1 -1
  17. package/dist/js/pacem-charts.d.ts +1 -1
  18. package/dist/js/pacem-charts.js +1 -1
  19. package/dist/js/pacem-charts.min.js +1 -1
  20. package/dist/js/pacem-cms.d.ts +1 -1
  21. package/dist/js/pacem-cms.js +1 -1
  22. package/dist/js/pacem-cms.min.js +1 -1
  23. package/dist/js/pacem-core.d.ts +1 -1
  24. package/dist/js/pacem-core.js +1 -1
  25. package/dist/js/pacem-core.min.js +1 -1
  26. package/dist/js/pacem-foundation.d.ts +1 -1
  27. package/dist/js/pacem-foundation.js +1 -1
  28. package/dist/js/pacem-foundation.min.js +1 -1
  29. package/dist/js/pacem-fx.d.ts +1 -1
  30. package/dist/js/pacem-fx.js +1 -1
  31. package/dist/js/pacem-fx.min.js +1 -1
  32. package/dist/js/pacem-logging.d.ts +1 -1
  33. package/dist/js/pacem-logging.js +1 -1
  34. package/dist/js/pacem-logging.min.js +1 -1
  35. package/dist/js/pacem-maps.d.ts +1 -1
  36. package/dist/js/pacem-maps.js +1 -1
  37. package/dist/js/pacem-maps.min.js +1 -1
  38. package/dist/js/pacem-media.d.ts +1 -1
  39. package/dist/js/pacem-media.js +1 -1
  40. package/dist/js/pacem-media.min.js +1 -1
  41. package/dist/js/pacem-networking.d.ts +1 -1
  42. package/dist/js/pacem-networking.js +1 -1
  43. package/dist/js/pacem-networking.min.js +1 -1
  44. package/dist/js/pacem-numerical.d.ts +2 -1
  45. package/dist/js/pacem-numerical.js +4 -3
  46. package/dist/js/pacem-numerical.min.js +2 -2
  47. package/dist/js/pacem-plus.d.ts +1 -1
  48. package/dist/js/pacem-plus.js +1 -1
  49. package/dist/js/pacem-plus.min.js +1 -1
  50. package/dist/js/pacem-scaffolding.d.ts +1 -1
  51. package/dist/js/pacem-scaffolding.js +1 -1
  52. package/dist/js/pacem-scaffolding.min.js +1 -1
  53. package/dist/js/pacem-ui.d.ts +1 -1
  54. package/dist/js/pacem-ui.js +1 -1
  55. package/dist/js/pacem-ui.min.js +1 -1
  56. package/dist/js/swagger-types.d.ts +1 -1
  57. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -43,6 +43,7 @@ declare namespace Pacem.Geometry {
43
43
  static combinePolygons(polygon1: Polygon, polygon2: Polygon, operator: PolygonCompound): {
44
44
  polygons: Polygon[];
45
45
  mesh?: Mesh;
46
+ triangles?: Polygon[];
46
47
  } | null;
47
48
  private static _mergePolygons;
48
49
  static mesh(...points: Point[]): any;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -351,7 +351,8 @@ var Pacem;
351
351
  const { vertices, triangleIndices } = mesh;
352
352
  const triangles = [];
353
353
  for (let j = 0; j < triangleIndices.length; j += 3) {
354
- const A = vertices[triangleIndices[j]], B = vertices[triangleIndices[j + 1]], C = vertices[triangleIndices[j + 2]];
354
+ const jA = j, jB = j + 1, jC = j + 2;
355
+ const A = vertices[triangleIndices[jA]], B = vertices[triangleIndices[jB]], C = vertices[triangleIndices[jC]];
355
356
  const O = { x: (A.x + B.x + C.x) / 3, y: (A.y + B.y + C.y) / 3 };
356
357
  const in1 = Utils.inPolygon(O, vertices1), in2 = Utils.inPolygon(O, vertices2);
357
358
  if (in1 && in2 && operator === 'intersect'
@@ -412,7 +413,7 @@ var Pacem;
412
413
  }
413
414
  polygons.push({ vertices: cleanupPolygon(boundaryVertices) });
414
415
  return {
415
- polygons, mesh
416
+ polygons, mesh, triangles: triangles.map(vertices => { return { vertices }; })
416
417
  };
417
418
  }
418
419
  static mesh(point, ...points) {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- "use strict";var Pacem;!function(t){!function(e){!function(e){class Vector{static unit(t){const e={x:t.x,y:t.y};return this.normalize(e),e}static magSqr(t){return t.x*t.x+t.y*t.y}static mag(t){return Math.sqrt(Vector.magSqr(t))}static normalize(t){const e=Vector.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r}static from(e,r){return t.Point.subtract(e,r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static areClose(t,e){return(e.x-t.x).isCloseTo(0)&&(e.y-t.y).isCloseTo(0)}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){class Vertex{x;y;index;constructor(t,e,r=-1){this.x=t,this.y=e,this.index=r}equals(t){return this.x===t.x&&this.y===t.y}}class Triangle{v0;v1;v2;circumCirc;constructor(t,e,r){this.v0=t,this.v1=e,this.v2=r,this.circumCirc=function(t,e,r){const n=t.x,s=t.y,i=e.x,o=e.y,a=r.x,m=r.y,c=2*(n*(o-m)+i*(m-s)+a*(s-o));if(Math.abs(c)<1e-12)return{c:{x:0,y:0},r:1/0};const l=((n*n+s*s)*(o-m)+(i*i+o*o)*(m-s)+(a*a+m*m)*(s-o))/c,u=((n*n+s*s)*(a-i)+(i*i+o*o)*(n-a)+(a*a+m*m)*(i-n))/c;return{c:{x:l,y:u},r:Math.hypot(l-n,u-s)}}(t,e,r)}inCircumcircle(t){const e=this.circumCirc.c.x-t.x,r=this.circumCirc.c.y-t.y;return Math.hypot(e,r)<=this.circumCirc.r+1e-9}}function e(t,e){const r=[];e=e.filter(e=>!e.inCircumcircle(t)||(r.push({v0:e.v0,v1:e.v1}),r.push({v0:e.v1,v1:e.v2}),r.push({v0:e.v2,v1:e.v0}),!1));const n=function(t){const e=[];for(let r=0;r<t.length;++r){let n=!0;for(let e=0;e<t.length;++e)if(r!==e){const s=t[r],i=t[e];if(s.v0.equals(i.v0)&&s.v1.equals(i.v1)||s.v0.equals(i.v1)&&s.v1.equals(i.v0)){n=!1;break}}n&&e.push(t[r])}return e}(r);for(const r of n)e.push(new Triangle(r.v0,r.v1,t));return e}function r(t){if(t.length<3)return[];const r=function(t){let e=1/0,r=1/0,n=-1/0,s=-1/0;for(const i of t)e=Math.min(e,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),s=Math.max(s,i.y);const i=10*(n-e),o=10*(s-r),a=new Vertex(e-i,r-3*o),m=new Vertex(e-i,s+o),c=new Vertex(n+3*i,s+o);return new Triangle(a,m,c)}(t);let n=[r];for(const r of t)n=e(r,n);return n=n.filter(t=>!(t.v0===r.v0||t.v0===r.v1||t.v0===r.v2||t.v1===r.v0||t.v1===r.v1||t.v1===r.v2||t.v2===r.v0||t.v2===r.v1||t.v2===r.v2)),n}t.Delaunay=class Delaunay{static triangulate(t){return function(t){if(t.length<3)return[];const e=r(t.map((t,e)=>new Vertex(t.x,t.y,e))),n=[];for(const t of e)n.push(t.v0.index,t.v1.index,t.v2.index);return n}(t)}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,s=e.LinearAlgebra.Vector;function i(e){return t.Point.isPoint(e)}class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+Utils.slopeRad(t,e))%n}static slopeDeg(t,e){return Utils.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+Utils.slopeDeg(t,e))%360}static intersect(e,r,...n){return Array.isArray(e)&&Array.isArray(r)?Utils._intersectSegments(e,r,!0):t.Rect.isRect(e)?Utils._intersectRects(...arguments):"vertices"in e?Utils._mergePolygons(e,r,"intersect")?.polygons??null:null}static boundingBox(t){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=-Number.MAX_VALUE,s=-Number.MAX_VALUE;t.length;for(let i of t)e=Math.min(e,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),s=Math.max(s,i.y);return{x:e,y:r,width:n-e,height:s-r}}static combinePolygons(t,e,r){return Utils._mergePolygons(t,e,r)}static _mergePolygons(e,r,n){if(t.NullChecker.isNullOrEmpty(e?.vertices)||t.NullChecker.isNullOrEmpty(r?.vertices))return null;const s=e.vertices.filter(t=>Utils.inPolygon(t,r.vertices));if(e.vertices.length==s.length)return{polygons:"intersect"===n?[e]:[r]};const i=r.vertices.filter(t=>Utils.inPolygon(t,e.vertices));if(r.vertices.length===i.length)return{polygons:"intersect"===n?[r]:[e]};const o=Utils.boundingBox(e.vertices),a=Utils.boundingBox(r.vertices),m=Utils.intersect(o,a);if(!(t.Rect.isRect(m)&&m.width>0&&m.height>0))return null;const{vertices:c}=e,{vertices:l}=r;if(c.length<3||l.length<3)return null;const u=(t,e,r)=>[t,r[(e+1)%r.length]],f=(t,e)=>t.x===e.x?t.y-e.y:t.x-e.x,h=c.map(u),y=l.map(u),x=c.concat(l),g=new Map,p=t=>{if(!g.has(t)){const e=[];g.set(t,e)}return g.get(t)};let M=!1;for(let e of h){const r=p(e);for(let n of y){const s=p(n),i=Utils.intersect(e,n);t.NullChecker.isNull(i)||(M=!0,x.push(i),r.push(i),s.push(i))}}if(0===s.length&&0===i.length&&!M)return"union"===n?{polygons:[e,r]}:null;const d=[];for(let e of h.concat(y)){const r=p(e);if(t.NullChecker.isNullOrEmpty(r))d.push(e);else{const t=e.concat(r).sort(f);for(let e=0;e<t.length-1;e++)d.push([t[e],t[e+1]])}}var v,b=!1;do{x.sort(f),x.filter((t,e,r)=>0===e||!Utils.areClose(t,r[e-1])),v=Utils.mesh(x);const{vertices:e,triangleIndices:r}=v;b=!1;for(let n=0;n<r.length;n+=3){const s=r[n],i=r[n+1],o=r[n+2],a=e[s],m=e[i],c=e[o],l=[[a,m],[m,c],[c,a]];for(let e of d)for(let r of l){const n=Utils.areClose(r[0],e[0])||Utils.areClose(r[1],e[1])||Utils.areClose(r[0],e[1])||Utils.areClose(r[1],e[0])?null:Utils.intersect(r,e);t.NullChecker.isNull(n)||-1!==x.findIndex(t=>Utils.areClose(t,n,4))||(b=!0,x.push(n))}}}while(b);const{vertices:w,triangleIndices:z}=v,U=[];for(let t=0;t<z.length;t+=3){const e=w[z[t]],r=w[z[t+1]],s=w[z[t+2]],i={x:(e.x+r.x+s.x)/3,y:(e.y+r.y+s.y)/3},o=Utils.inPolygon(i,c),a=Utils.inPolygon(i,l);(o&&a&&"intersect"===n||(o||a)&&"union"===n||(o&&!a||!o&&a)&&"difference"===n)&&U.push([e,r,s])}const A=U.flatMap(([t,e,r])=>[[t,e],[e,r],[r,t]]),D=[];for(let t=0;t<A.length;t++){const e=A[t];if(0==t){D.push(e);continue}const r=D.findIndex(t=>Utils.areClose(t[0],e[0])&&Utils.areClose(t[1],e[1])||Utils.areClose(t[0],e[1])&&Utils.areClose(t[1],e[0]));-1===r?D.push(e):D.splice(r,1)}if(D.length<3)return null;const C=[],N=t=>{const{length:e}=t,r=Utils.areClose(t[0],t[e-1]),n=t.slice(0,r?e-1:e);return n.length>3&&Utils.inSegment(n[0],[n[1],n[n.length-1]])&&n.shift(),n},[P,V]=D.shift(),q=[P,V];for(;D.length>1;){const t=q[q.length-1],e=D.findIndex(e=>Utils.areClose(e[0],t)||Utils.areClose(e[1],t));if(-1===e){C.push({vertices:N(q.splice(0))});const[t,e]=D.shift();q.push(t,e)}else{const[r]=D.splice(e,1),n=Utils.areClose(r[0],t)?r[1]:Utils.areClose(r[1],t)?r[0]:null;q.length>1&&Utils.inSegment(q[q.length-1],[q[q.length-2],n])?q.splice(q.length-1,1,n):q.push(n)}}return C.push({vertices:N(q)}),{polygons:C,mesh:v}}static mesh(t,...r){const n=[].concat(t).concat(r);return{vertices:n,triangleIndices:e.Delaunay.triangulate(n)}}static intersectLines(t,e,r,n){let s,i;if(Array.isArray(t)&&Array.isArray(e)&&2===t.length&&2===e.length&&"number"==typeof t[0]&&"number"==typeof e[0]&&"number"==typeof t[1]&&"number"==typeof e[1]&&(r=e[0],n=e[1],e=t[1],t=t[0]),"number"==typeof t&&"number"==typeof e){s=[{x:0,y:e},{x:1,y:t+e}],i=[{x:0,y:n},{x:1,y:r+n}]}else s=t,i=e;return Utils._intersectSegments(s,i,!1)}static cramer(t,e){Array.isArray(t)&&(t={a:t[0],b:t[1],c:t[2]}),Array.isArray(e)&&(e={a:e[0],b:e[1],c:e[2]});let r=(t.b*e.c-t.c*e.b)/(t.b*e.a-t.a*e.b),n=(t.c*e.a-t.a*e.c)/(t.b*e.a-t.a*e.b);return{x:-r.roundoff(),y:-n.roundoff()}}static mq(t,e){let r;if(i(t)?r=t:(r=t[0],e=t[1]),r.x===e.x)return[Number.NaN,Number.NaN];const n=(e.y-r.y)/(e.x-r.x);return[n,r.y-n*r.x]}static _intersectSegments(t,e,r){const n=t[0],s=t[1],i=e[0],o=e[1],a=Math.min(n.x,s.x),m=Math.min(n.y,s.y),c=Math.max(n.x,s.x),l=c-a,u=Math.max(n.y,s.y),f=u-m,h=Math.min(i.x,o.x),y=Math.min(i.y,o.y),x=Math.max(i.x,o.x),g=x-h,p=Math.max(i.y,o.y),M=p-y;if(0===l&&0===g)return null;if(0===f&&0===M)return null;const d=t=>t.x<h||t.x>x||t.x<a||t.x>c,v=t=>t.y<y||t.y>p||t.y<m||t.y>u;var b=null;if(0===l){if(r&&(h>a||x<c))return null;const t=Utils.mq(i,o);b=Utils.cramer([1,0,-a],[t[0],-1,t[1]]),r&&v(b)&&(b=null)}else if(0===g){if(r&&(a>h||c<x))return null;const t=Utils.mq(n,s);b=Utils.cramer([t[0],-1,t[1]],[1,0,-h]),r&&v(b)&&(b=null)}else if(0===f){if(r&&(y>m||p<u))return null;const t=Utils.mq(i,o);b=Utils.cramer([0,1,-m],[t[0],-1,t[1]]),r&&d(b)&&(b=null)}else if(0===M){if(r&&(m>y||u<p))return null;const t=Utils.mq(n,s);b=Utils.cramer([t[0],-1,t[1]],[0,1,-y]),r&&d(b)&&(b=null)}else{let t;if(!r||(t=Utils._intersectRects({x:a,y:m,width:l,height:f},{x:h,y:y,width:g,height:M}))&&t.width>0&&t.height>0){const e=Utils.mq(n,s),a=Utils.mq(i,o),m=e[0],c=a[0],l=e[1],u=a[1];if(m!==c){let e=(b=Utils.cramer([m,-1,l],[c,-1,u])).x,n=b.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(b=null)}}}return null===b?null:{x:b.x,y:b.y}}static _intersectRects(...e){return t.Rect.intersect(...e)}static _areClose(t,e,r=12){return Math.abs(t.x-e.x).isCloseTo(0,r)&&Math.abs(t.y-e.y).isCloseTo(0,r)}static areClose(t,e,r=12){return Utils._areClose(t,e,r)}static dot(t,e){return s.dot(t,e)}static cross(t,e){return s.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&i(n[0])&&i(n[1]))return t.Point.distance(e[0],e[1]);if(i(r))return t.Point.distance(e,r);{const t=r[0],n=r[1];return Math.abs(t*e.x-e.y+n)/Math.sqrt(Math.pow(t,2)+1)}var n}static _pointSegmentDistance(t,e){const r=s.from(e[0],e[1]),n=s.from(e[0],t);return Utils.cross(r,n)}static isWithin(t,e,r,n=12){const s=Utils._pointSegmentDistance(t,e);return!s.isCloseTo(0,n)&&(r?s<0:s>0)}static isBeyond(t,e,r,n=12){return Utils.isWithin(t,e,!r,n)}static inLine(t,e,r=12){return Utils._pointSegmentDistance(t,e).isCloseTo(0,r)}static inSegment(t,e,r=12){const n=Math.min(e[0].x,e[1].x),s=Math.max(e[0].x,e[1].x),i=Math.min(e[0].y,e[1].y),o=Math.max(e[0].y,e[1].y);return t.x>=n&&t.x<=s&&t.y>=i&&t.y<=o&&Utils.inLine(t,e,r)}static inTriangle(e,r){let n;for(let s=0;s<3;s++){const i=r[s],o=r[(s+1)%3],a=t.Point.subtract(o,e),m=t.Point.subtract(i,e),c=Utils.cross(a,m);if(s>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e,r=12){if(!(e?.length>=3))throw"Not enough vertices";const n=e.length;if(3===n)return Utils.inTriangle(t,[e[0],e[1],e[2]]);r>0&&(e=e.map(t=>({x:t.x.roundoff(r),y:t.y.roundoff(r)})),t={x:t.x.roundoff(r),y:t.y.roundoff(r)});let s=Number.MAX_VALUE,i=Number.MAX_VALUE,o=Number.MIN_VALUE,a=Number.MIN_VALUE;for(let t=0;t<n;t++){const r=e[t];s=Math.min(s,r.x),i=Math.min(i,r.y),o=Math.max(o,r.x),a=Math.max(a,r.y)}if(t.x<s||t.x>o||t.y<i||t.y>a)return!1;const m=[{x:s-1,y:t.y},t];let c=0;for(let r=0;r<n;r++){const s=e[r],i=e[(r+1)%n],o=[s,i];if(s.y===t.y){const o=e[(r-1+n)%n];t.x>s.x&&(o.y-t.y)*(i.y-t.y)<0&&c++}else{if(i.y===t.y)continue;null!=Utils.intersect(o,m)&&c++}}return c%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const s=r.length;if(s>=3){for(let t=0;t<r.length;t++){const{x:e,y:i}=r[t],o=t===s-1?0:t+1,{x:a,y:m}=r[o];n+=e*m-i*a}n*=.5}return Math.abs(n.roundoff())}static convexHull(t,...e){const r=[].concat(t).concat(e);if(!(r?.length>1))return r?.slice()??[];const n=r.map(t=>({x:t.x,y:t.y})).sort((t,e)=>t.x===e.x?t.y-e.y:t.x-e.x),s=[];for(const t of n){const e=s[s.length-1];e&&e.x===t.x&&e.y===t.y||s.push(t)}if(s.length<=2)return s;const i=(t,e,r)=>(e.x-t.x)*(r.y-t.y)-(e.y-t.y)*(r.x-t.x),o=[];for(const t of s){for(;o.length>=2&&i(o[o.length-2],o[o.length-1],t)<=0;)o.pop();o.push(t)}const a=[];for(let t=s.length-1;t>=0;t--){const e=s[t];for(;a.length>=2&&i(a[a.length-2],a[a.length-1],e)<=0;)a.pop();a.push(e)}return o.pop(),a.pop(),o.concat(a)}}e.Utils=Utils}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r=180/Math.PI,n=1/r;class Vector3D{static from(...t){if(3!==t.length)throw new RangeError("Must provide exactly 3 numbers");return{x:t[0],y:t[1],z:t[2]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&3===r.length)return Vector3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Vector3D.`)}static i(){return{x:1,y:0,z:0}}static j(){return{x:0,y:1,z:0}}static k(){return{x:0,y:0,z:1}}static zero(){return{x:0,y:0,z:0}}static subtract(t,e){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}}static add(...t){var e={x:0,y:0,z:0};for(var r of t)e.x+=r.x,e.y+=r.y,e.z+=r.z;return e}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}static scale(t,e,r=e,n=e){return{x:t.x*e,y:t.y*r,z:t.z*n}}static magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static areClose(t,e){return(e.x-t.x).isCloseTo(0)&&(e.y-t.y).isCloseTo(0)&&(e.z-t.z).isCloseTo(0)}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}static negate(t){return{x:-t.x,y:-t.y,z:-t.z}}static unit(t){const e={x:t.x,y:t.y,z:t.z};return this.normalize(e),e}static normalize(t){const e=Vector3D.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r,t.z*=r}static angleBetween(t,e){let n;const s=Vector3D.unit(t),i=Vector3D.unit(e);if(Vector3D.dot(s,i)<0){const t={x:-s.x-i.x,y:-s.y-i.y,z:-s.z-i.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:s.x-i.x,y:s.y-i.y,z:s.z-i.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Spherical{static from(t,e,r){return{rho:t.clamp(0,1/0),theta:e.clamp(-180,180),phi:r.clamp(0,360)}}static fromVector(t,e,n){"number"==typeof t&&(t=Vector3D.from(t,e,n));const s=Vector3D.mag(t);if(s.isCloseTo(0))return Spherical.from(0,0,0);const i=Math.atan2(t.x,t.z),o=Math.acos((t.y/s).clamp(-1,1));return Spherical.from(s,i*r,o*r)}static toVector(t){const{rho:e,theta:r,phi:s}=t,i=s*n,o=r*n,a=Math.sin(i)*e;return{x:a*Math.sin(o),y:Math.cos(i)*e,z:a*Math.cos(o)}}static toRotationMatrix(t){const{theta:e,phi:r}=t,s=n*e,i=Math.sin(s),o=Math.cos(s),a=n*r,m=Math.sin(a),c=Math.cos(a);return Matrix3D.from(i*c,i*m,o,0,o*c,o*m,-i,0,-m,c,0,0,0,0,0,1)}}e.Spherical=Spherical;class Matrix3DUtils{static modify(t,e){const{m11:r,m12:n,m13:s,m14:i,m21:o,m22:a,m23:m,m24:c,m31:l,m32:u,m33:f,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:p}=t,M={m11:r,m12:n,m13:s,m14:i,m21:o,m22:a,m23:m,m24:c,m31:l,m32:u,m33:f,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:p};return e(M),M}static clone(t){return Matrix3DUtils.modify(t,t=>{})}static multiply(t,e){return Matrix3D.isIdentity(t)?e:Matrix3D.isIdentity(e)?t:Matrix3D.from(t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.offsetX,t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.offsetY,t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.offsetZ,t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.offsetX,t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.offsetY,t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.offsetZ,t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.offsetX,t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.offsetY,t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.offsetZ,t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,t.offsetX*e.m11+t.offsetY*e.m21+t.offsetZ*e.m31+t.m44*e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+t.offsetZ*e.m32+t.m44*e.offsetY,t.offsetX*e.m13+t.offsetY*e.m23+t.offsetZ*e.m33+t.m44*e.offsetZ,t.offsetX*e.m14+t.offsetY*e.m24+t.offsetZ*e.m34+t.m44*e.m44)}}class Matrix3D{static identity(){return{m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,offsetX:0,offsetY:0,offsetZ:0,m44:1}}static from(...t){if(16!==t.length)throw new RangeError("Must provide exactly 16 numbers");return{m11:t[0],m12:t[1],m13:t[2],m14:t[3],m21:t[4],m22:t[5],m23:t[6],m24:t[7],m31:t[8],m32:t[9],m33:t[10],m34:t[11],offsetX:t[12],offsetY:t[13],offsetZ:t[14],m44:t[15]}}static transpose(t){return Matrix3D.from(t.m11,t.m21,t.m31,t.offsetX,t.m12,t.m22,t.m32,t.offsetY,t.m13,t.m23,t.m33,t.offsetZ,t.m14,t.m24,t.m34,t.m44)}static toArray(t){return[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44]}static clone(t,e){return"function"==typeof e?Matrix3DUtils.modify(t,e):Matrix3DUtils.clone(t)}static scale(t,e,r,n){return"number"==typeof e?(r??=e,n??=e):(n=e.z,r=e.y,e=e.x),Matrix3DUtils.modify(t,t=>{t.m11*=e,t.m22*=r,t.m33*=n})}static translate(t,e){return Matrix3DUtils.modify(t,t=>{t.offsetX+=e.x,t.offsetY+=e.y,t.offsetZ+=e.z})}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&16===r.length)return Matrix3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Matrix3D.`)}static isIdentity(t){return 1==t.m11&&0==t.m12&&0==t.m13&&0==t.m14&&0==t.m21&&1==t.m22&&0==t.m23&&0==t.m24&&0==t.m31&&0==t.m32&&1==t.m33&&0==t.m34&&0==t.offsetX&&0==t.offsetY&&0==t.offsetZ&&1==t.m44}static isAffine(t){return 0==t.m14&&0==t.m24&&0==t.m34&&1==t.m44}static determinant(t){if(Matrix3D.isIdentity(t))return 1;if(Matrix3D.isAffine(t))return t.m11*(t.m22*t.m33-t.m32*t.m23)-t.m12*(t.m21*t.m33-t.m31*t.m23)+t.m13*(t.m21*t.m32-t.m31*t.m22);{const e=t.m13*t.m24-t.m23*t.m14,r=t.m13*t.m34-t.m33*t.m14,n=t.m13*t.m44-t.offsetZ*t.m14,s=t.m23*t.m34-t.m33*t.m24,i=t.m23*t.m44-t.offsetZ*t.m24,o=t.m33*t.m44-t.offsetZ*t.m34,a=t.m22*r-t.m32*e-t.m12*s,m=t.m12*i-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*o,l=t.m22*o-t.m32*i+t.offsetY*s;return t.offsetX*a+t.m31*m+t.m21*c+t.m11*l}}static multiply(...t){if(0===t.length)throw new ReferenceError("Matrix not provided.");const e=Array.from(t);let r=e[0];for(let t=1;t<e.length;t++)r=Matrix3DUtils.multiply(r,e[t]);return r}static invert(t){if(Matrix3D.isAffine(t)){const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m12*t.m23-t.m22*t.m13,n=t.m32*t.m13-t.m12*t.m33,s=t.m22*t.m33-t.m32*t.m23,i=t.m21*t.m13-t.m11*t.m23,o=t.m11*t.m33-t.m31*t.m13,a=t.m31*t.m23-t.m21*t.m33,m=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,l=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,f=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*l-t.offsetZ*m-t.m13*f,x=t.m13*h-t.m33*l+t.offsetZ*c,g=t.m33*f-t.offsetZ*u-t.m23*h,p=m,M=-c,d=u,v=1/e;return Matrix3D.from(s*v,n*v,r*v,0,a*v,o*v,i*v,0,d*v,M*v,p*v,0,g*v,x*v,y*v,1)}{const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m33*t.m44-t.m34*t.offsetZ,n=t.m32*t.m44-t.m34*t.offsetY,s=t.m31*t.m44-t.m34*t.offsetX,i=t.m32*t.offsetZ-t.m33*t.offsetY,o=t.m31*t.offsetZ-t.m33*t.offsetX,a=t.m31*t.offsetY-t.m32*t.offsetX,m=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,l=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,f=t.m31*t.offsetZ-t.m33*t.offsetX,h=t.m31*t.offsetY-t.m32*t.offsetX,y=t.m23*t.m44-t.m24*t.offsetZ,x=t.m22*t.m44-t.m24*t.offsetY,g=t.m21*t.m44-t.m24*t.offsetX,p=t.m22*t.offsetZ-t.m23*t.offsetY,M=t.m21*t.offsetZ-t.m23*t.offsetX,d=t.m21*t.offsetY-t.m22*t.offsetX,v=t.m23*t.m34-t.m24*t.m33,b=t.m22*t.m34-t.m24*t.m32,w=t.m21*t.m34-t.m24*t.m31,z=t.m22*t.m33-t.m23*t.m32,U=t.m21*t.m33-t.m23*t.m31,A=t.m21*t.m32-t.m22*t.m31,D=t.m22*r-t.m23*n+t.m24*i,C=-(t.m21*r-t.m23*s+t.m24*o),N=t.m21*n-t.m22*s+t.m24*a,P=-(t.m21*i-t.m22*o+t.m23*a),V=-(t.m12*m-t.m13*c+t.m14*u),q=t.m11*m-t.m13*l+t.m14*f,X=-(t.m11*c-t.m12*l+t.m14*h),S=t.m11*u-t.m12*f+t.m13*h,Y=t.m12*y-t.m13*x+t.m14*p,Z=-(t.m11*y-t.m13*g+t.m14*M),E=t.m11*x-t.m12*g+t.m14*d,_=-(t.m11*p-t.m12*M+t.m13*d),T=-(t.m12*v-t.m13*b+t.m14*z),L=t.m11*v-t.m13*w+t.m14*U,I=-(t.m11*b-t.m12*w+t.m14*A),R=t.m11*z-t.m12*U+t.m13*A,Q=1/e;return Matrix3D.from(D*Q,V*Q,Y*Q,T*Q,C*Q,q*Q,Z*Q,L*Q,N*Q,X*Q,E*Q,I*Q,P*Q,S*Q,_*Q,R*Q)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,s=r.y,i=r.z;if(r.x=n*e.m11+s*e.m21+i*e.m31+e.offsetX,r.y=n*e.m12+s*e.m22+i*e.m32+e.offsetY,r.z=n*e.m13+s*e.m23+i*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var o=n*e.m14+s*e.m24+i*e.m34+e.m44;0!=o&&(r.x/=o,r.y/=o,r.z/=o)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{static identity(){return Quaternion.from(0,0,0,1)}static from(...t){if(4!==t.length)throw new RangeError("Must provide exactly 4 numbers");return{x:t[0],y:t[1],z:t[2],w:t[3]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&4===r.length)return Quaternion.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Quaternion.`)}static fromVectors(t,e){Vector3D.normalize(t),Vector3D.normalize(e);const r=(t,e,r,n)=>{const s=Quaternion.from(t,e,r,n);return Quaternion.normalize(s),s};let n=Vector3D.dot(t,e)+1;return n.isCloseTo(0)?Math.abs(t.x)>Math.abs(t.z)?r(-t.y,t.x,0,0):r(0,-t.z,t.y,0):r(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x,n)}static normalize(t){const e=Quaternion.mag(t);if(e.isCloseTo(0))t.x=t.y=t.z=0,t.w=1;else{const r=1/e;t.x*=r,t.y*=r,t.z*=r,t.w*=r}}static unit(t){const e=Quaternion.from(t.x,t.y,t.z,t.w);return Quaternion.normalize(e),e}static fromAxisAngle(t,e){var r=n*(e%=360),s=Vector3D.mag(t);if(0==s)throw new RangeError("Invalid argument");var i=Math.sin(.5*r)/s,o=t.x*i,a=t.y*i,m=t.z*i;return Quaternion.from(o,a,m,Math.cos(.5*r))}static fromRotationMatrix(t){const e=t.m11+t.m22+t.m33+t.m44;if(e>0){const r=.5/Math.sqrt(e),n=.25/r,s=(t.m23-t.m32)*r,i=(t.m31-t.m13)*r,o=(t.m12-t.m21)*r;return Quaternion.from(s,i,o,n)}if(t.m11>t.m22&&t.m11>t.m22){const e=.5/Math.sqrt(t.m44+t.m11-t.m22-t.m33),r=(t.m23-t.m32)*e,n=.25/e,s=(t.m12+t.m21)*e,i=(t.m31+t.m13)*e;return Quaternion.from(n,s,i,r)}if(t.m22>t.m33){const e=.5/Math.sqrt(t.m44+t.m22-t.m11-t.m33),r=(t.m23+t.m32)*e,n=.25/e,s=(t.m12+t.m21)*e,i=(t.m31-t.m13)*e;return Quaternion.from(s,n,r,i)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,s=(t.m12-t.m21)*e,i=(t.m31-t.m13)*e;return Quaternion.from(i,r,n,s)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,t.w)}static mag(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w)}static norm(t){return t.x*t.x+t.y*t.y+t.z*t.z}static axis(t){return 0==t.x&&0==t.y&&0==t.z?Vector3D.j():Vector3D.unit(t)}static transform(t,e){Quaternion.normalize(e);const r=Vector3D.cross(e,t),n=Vector3D.scale(r,2),s=Vector3D.cross(e,n);return{x:t.x+e.w*n.x+s.x,y:t.y+e.w*n.y+s.y,z:t.z+e.w*n.z+s.z}}static angle(t){let e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=t.w;if(e>Number.MAX_VALUE){const n=Math.max(Math.abs(t.x),Math.max(Math.abs(t.y),Math.abs(t.z))),s=t.x/n,i=t.y/n,o=t.z/n;e=Math.sqrt(s*s+i*i+o*o),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,s=t.z,i=t.w;return e.m11=1-2*n*n-2*s*s,e.m12=2*r*n+2*i*s,e.m13=2*r*s-2*i*n,e.m21=2*r*n-2*i*s,e.m22=1-2*r*r-2*s*s,e.m23=2*n*s+2*i*r,e.m31=2*i*n+2*r*s,e.m32=2*n*s-2*i*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=Quaternion.unit(t);return Quaternion.conjugate(e)}static multiply(t,e){return Quaternion.from(t.w*e.x+t.x+e.w+t.y*e.z-t.z*e.y,t.w*e.y-t.x*e.z+t.y*e.w+t.z*e.x,t.w*e.z+t.x*e.y-t.y*e.x+t.z*e.w,t.w*e.w-t.x*e.x-t.y*e.y-t.z*e.z)}static dot(t,e){return Quaternion.multiply(t,Quaternion.conjugate(e)).w}}e.Quaternion=Quaternion}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=t.Geometry.LinearAlgebra.Vector3D;t.Geometry.LinearAlgebra.Matrix3D;e.Utils3D=class Utils3D{static intersect(t,e){const[n,s]=t,i=r.subtract(n,s),[o,a,m]=e,c=r.subtract(o,a),l=r.subtract(o,m),u=r.cross(i,l),f=r.dot(c,u);if(f.isCloseTo(0))return null;const h=1/f,y=r.subtract(n,o),x=h*r.dot(y,u);if(x<0||x>1)return null;const g=r.cross(y,c),p=h*r.dot(i,g);if(p<0||x+p>1)return null;const M=h*r.dot(l,g);return M<0||M.isCloseTo(0)?null:r.add(n,r.scale(i,M))}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){class Polygon{static _eps=1e-12;static isPolygon(e){return function(e){let r;return"vertices"in e&&Array.isArray(e.vertices)&&(r=e.vertices).length>=3&&r.every(e=>t.Point.isPoint(e))}(e)}static from(...t){return{vertices:Array.from(t)}}static contains(t,r){return e.Utils.inPolygon(r,t.vertices,12)}static centroid(t){const e=Polygon.boundingBox(t);return{x:e.x+e.width/2,y:e.y+e.height/2}}static boundingBox(t){return e.Utils.boundingBox(t.vertices)}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],s=e[t-1];r.push([s,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let s=0;for(let e=0;e<r.length;e++){const i=r[(e-1+n)%n],o=r[e],a=r[(e+1)%n],m=t.Angle.angleBetween(o,i,a);if(0!==s){if(s!=Math.sign(m))return!1}else s=Math.sign(m)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const s=Polygon.sides(r);for(let r of s)for(let n of s){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const s=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(s))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,s]}=e;return t.Angle.angleBetween(n,r,s)>0}static expand(r,n){const{vertices:s}=r,i=s.length,o=[];for(let r=0;r<s.length;r++){const a=s[(r-1+i)%i],m=s[r],c=s[(r+1)%i],l=t.Angle.angleBetween(m,a,c),u=-n/Math.sin(Math.abs(l)/2),f=t.Matrix2D.scale(t.Matrix2D.identity,u),h=t.Point.subtract(m,a);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(m,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,f);o.push(t.Point.add(m,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:o}}static area(t){return e.Utils.area(t.vertices)}static intersect(e,r){return t.Geometry.Utils.intersect(e,r)}static convexHull(t){return{vertices:e.Utils.convexHull(t.vertices)}}}e.Polygon=Polygon}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){function e(t){return"number"==typeof t&&(t={real:t,img:0}),t}var r;function n(t,e){const r={};return Object.defineProperty(r,"real",{value:t,writable:!1}),Object.defineProperty(r,"img",{value:e,writable:!1}),r}function s(){return r||(r=n(Number.NaN,Number.NaN))}t.Complex=class Complex{static build(t,e){return this.isComplex(t)?t:(e??=0,"number"!=typeof t||"number"!=typeof e?s():n(t,e||0))}static add(t,r){const s=e(t),i=e(r);return n(s.real+i.real,s.img+i.img)}static subtract(t,r){const s=e(t),i=e(r);return n(s.real-i.real,s.img-i.img)}static multiply(t,r){const s=e(t),i=e(r);return n(s.real*i.real-s.img*i.img,s.real*i.img+s.img*i.real)}static divide(t,r){const i=e(t),o=e(r),a=this.absSquare(o).roundoff();if(0===a)return s();const m=1/a;return n(m*(i.real*o.real+i.img*o.img),m*(i.img*o.real-i.real*o.img))}static absSquare(t){const r=e(t);return Math.pow(r.real,2)+Math.pow(r.img,2)}static modulus(t){return Math.sqrt(this.absSquare(t))}static isComplex(t){return null!=t&&"object"==typeof t&&"real"in t&&"img"in t&&"number"==typeof t.real&&"number"==typeof t.img}static conjugate(t){return n((t=e(t)).real,0==Math.abs(t.img)?0:-t.img)}static equals(t,e){const r=this.build(t),n=this.build(e);return!(!this.isComplex(t)||!this.isComplex(e))&&(r.real===n.real&&r.img===n.img)}static get NaC(){return s()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const s=r[n]=r[n]||{};return s[e]=s[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function s(e){const r=[],i=e.length;if(1===i)return[t.Complex.build(e[0])];const o=s(e.filter((t,e)=>e%2==0)),a=s(e.filter((t,e)=>e%2==1));for(var m=0;m<i/2;m++){const e=o[m],s=t.Complex.multiply(n(m,i),a[m]);r[m]=t.Complex.add(e,s),r[m+i/2]=t.Complex.subtract(e,s)}return r}e.Fourier=class Fourier{static transform(t,e=!0){return(r=(t=t||[]).length)>0&&!(r&r-1)?this.fft(t,e):this.dft(t,e);var r}static invert(t,e=!0){return this.idft(t||[],e)}static dft(e,r=!0){const s=(e||[])?.length,i=r?1/Math.sqrt(s):1,o=[];for(let r=0;r<s;r++){o.push({real:0,img:0});for(let a=0;a<s;a++){const m=n(r*a,s),c=t.Complex.multiply(e[a],m),l=t.Complex.multiply(c,i);o[r]=t.Complex.add(o[r],l)}}return o}static idft(e,r=!0){const n=e.map(e=>t.Complex.build(e.img,e.real));return this.transform(n,r).map(e=>t.Complex.build(e.img,e.real))}static fft(e,r=!0){const n=s(e);if(!r)return n;const i=1/Math.sqrt(e.length);return n.map(e=>t.Complex.multiply(e,i))}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=Math.sqrt(Math.PI);function r(t){const e=Math.abs(t),r=1/(1+.5*e),n=r*Math.exp(-e*e-1.26551223+r*(1.00002368+r*(.37409196+r*(.09678418+r*(r*(.27886807+r*(r*(1.48851587+r*(.17087277*r-.82215223))-1.13520398))-.18628806)))));return t>=0?n:2-n}class Gaussian{constructor(t,e){this.mean=t,this.stdev=Math.abs(e),this.variance=Math.pow(e,2)}mean;stdev;variance;static get normal(){return n}weight(t){return Math.exp(-.5*Math.pow(this._z(t),2))}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return this.weight(t)/r}_z(t){return(t-this.mean)/this.stdev}probability(t){return.5*r(-this._z(t)/Math.SQRT2)}}t.Gaussian=Gaussian;const n=new Gaussian(0,1)}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){class Lagrange{constructor(t){this.#t=t}#t;#e=null;_prepareBarycentric(){if(this.#e)return;const t=this.#t||[],e=t.length;if(0===e)return void(this.#e=[]);const r=new Array(e),n=new Array(e);for(let s=0;s<e;s++){let i=0,o=1;const a=t[s].x;for(let r=0;r<e;r++){if(r===s)continue;const e=a-t[r].x;if(0===e)throw new Error("Invalid function provided.");e<0&&(o=-o),i+=Math.log(Math.abs(e))}r[s]=-i,n[s]=o}let s=r[0];for(let t=1;t<e;t++)r[t]>s&&(s=r[t]);const i=new Array(e);for(let t=0;t<e;t++){const e=Math.exp(r[t]-s);i[t]=n[t]*e}this.#e=i}_computeBarycentric(t){const e=this.#t||[];this.#e||this._prepareBarycentric();const r=this.#e||[];let n=0,s=0;for(let i=0;i<e.length;i++){const o=e[i].x;if(t===o)return e[i].y;const a=r[i]/(t-o);n+=a*e[i].y,s+=a}return n/s}interpolate(t){return this._computeBarycentric(t)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Lagrange(e)}}t.Lagrange=Lagrange,t.Lagrangian={create:Lagrange.create};class Pchip{xs;ys;ms;constructor(t){if(!t||t.length<2)throw new Error("Need at least 2 points");const e=t.slice().sort((t,e)=>t.x-e.x);this.xs=e.map(t=>t.x),this.ys=e.map(t=>t.y),this.ms=this.computeDerivatives()}computeDerivatives(){const t=this.xs.length,e=new Array(t-1),r=new Array(t-1);for(let n=0;n<t-1;n++)e[n]=this.xs[n+1]-this.xs[n],r[n]=(this.ys[n+1]-this.ys[n])/e[n];const n=new Array(t).fill(0);n[0]=r[0],n[t-1]=r[t-2];for(let s=1;s<t-1;s++){const t=r[s-1],i=r[s];if(0===t||0===i||t*i<=0)n[s]=0;else{const r=2*e[s]+e[s-1],o=e[s]+2*e[s-1];n[s]=(r+o)/(r/t+o/i)}}for(let e=0;e<t-1;e++)if(0===r[e])n[e]=0,n[e+1]=0;else{const t=n[e]/r[e],s=n[e+1]/r[e],i=t*t+s*s;if(i>9){const o=3/Math.sqrt(i);n[e]=o*t*r[e],n[e+1]=o*s*r[e]}}return n}interpolate(t){const e=this.xs,r=this.ys,n=this.ms,s=e.length;if(t<=e[0]){const s=n[0];return r[0]+s*(t-e[0])}if(t>=e[s-1]){const i=n[s-1];return r[s-1]+i*(t-e[s-1])}let i=0,o=s-1;for(;o-i>1;){const r=i+o>>1;e[r]<=t?i=r:o=r}const a=e[i+1]-e[i],m=(t-e[i])/a,c=m*m,l=c*m,u=l-2*c+m,f=-2*l+3*c,h=l-c;return(2*l-3*c+1)*r[i]+u*(n[i]*a)+f*r[i+1]+h*(n[i+1]*a)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Pchip(e)}}t.Pchip=Pchip;class Newton{xs;coeffs;constructor(t){if(!t||0===t.length)throw new Error("Need at least 1 point");const e=t.slice().sort((t,e)=>t.x-e.x);this.xs=e.map(t=>t.x);const r=e.length,n=e.map(t=>t.y);for(let t=1;t<r;t++)for(let e=r-1;e>=t;e--){const r=this.xs[e]-this.xs[e-t];if(0===r)throw new Error("Invalid function provided.");n[e]=(n[e]-n[e-1])/r}this.coeffs=n}interpolate(t){const e=this.xs,r=this.coeffs,n=r.length;if(0===n)return NaN;let s=r[n-1];for(let i=n-2;i>=0;i--)s=s*(t-e[i])+r[i];return s}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Newton(e)}}t.Newton=Newton}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r="0123456789abcdefghijklmnopqrstuvwxyz",n="Radix out of range: possible values go between positive 1 exclusive and 36 inclusive";class Utils{static lcd(...e){if(t.NullChecker.isNullOrEmpty(e)||e.length<=1)throw"Insufficient set of numbers.";function r(t,e){return e?r(e,t%e):0===e?t:NaN}function n(t,e){return t*e/r(t,e)}let s=Math.round(e[0]);for(let t=1;t<e.length;t++)s=n(s,Math.round(e[t]));return s}static gcd(t,e){return t=Math.round(t),e=Math.round(e),0===t?e:Utils.gcd(e%t,t)}static rebaseInt(e,r,n){return t.Numbers.rebase(e,r,n)}static rebaseFloat(t,e,r,n=12){const s=Utils.rebaseFloat10ToN,i=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):s(e,r,n)}if(10===r)return i(t.toString(),e,n);return s(i(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,s=12){const i=r;if(e<=1||e>i.length)throw new Error(n);const o=(t??"0").toString().toLowerCase(),a=Number.NaN;if("0"===o)return 0;const m=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(o);if(m.length<2)return a;const c="-"===m[1]?-1:1,l=m[2]||"0",u=m[3]||".0";let f=0,h=0;for(let t of l+u.substr(1)){const r=i.indexOf(t);if(-1===r||r>=e)return a;f+=r*Math.pow(e,l.length-h-1),h++}return c*f}static rebaseFloat10ToNIntBase(t,e,s=12){const i=r;if(e<=1||e>36)throw new Error(n);const o=e;let a=Math.abs(t??0);if(0===a||Number.isNaN(a))return t.toString();let m=(a%1).roundoff(),c="";for(;;){let t=a/o,e=Math.floor(t),r=(a-e*o).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:i[n]+c,e<=0)break;a=e}if(c=c.replace(/^0+/,""),c||="0",0===m)return c;let l="";do{a=(m*o).roundoff();const t=Math.floor(a),e=(a-t).roundoff();t>=36?l=`[${t}]`:l+=i[t],m=e}while(!m.isCloseTo(0)&&l.length<s);return/^0*$/.test(l)?c:(Math.sign(t)<0?"-":"")+c+"."+l.replace(/0+$/,"")}static rebaseFloat10ToN(e,s,i=12){const o=r;if(s<=1||s>o.length)throw new Error(n);const a=s;let m=Math.abs(e??0);if(0===m||Number.isNaN(m))return e.toString();let c=Math.sign(e)<0?"-":"",l=[],u=[];for(let t=0;t<20;t++)l.push("0"),u.push("0");const f=a%1==0?a:Math.ceil(a);function h(t,e,r){const n=t?l:u,s=n[e]=n[e]||"0",i=o.indexOf(s)+r,a=i%f,m=Math.floor(i/f);return n[e]=o[a],m>0&&(t?h(t,e+1,m):0===e?h(!0,0,m):h(!1,e-1,m)),m}let y=0;for(;;){const e=Math.floor(t.Numbers.log(m,a)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),m=(m-Math.pow(a,e).roundoff()).roundoff(),r||y++,0===m||y>=100){const t=c+(l.reverse().map(t=>t||"0").join("").replace(/^0+/,"")||"0"),e=u.map(t=>t||"0").join("").substr(0,i).replace(/0+$/,"");return/^0*$/.test(e)?t:t+"."+e}}}}e.Utils=Utils}(e.NumberTheory||(e.NumberTheory={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=(t,e)=>t;function r(t,r=e){return t.reduce((t,e,n)=>t+r(e,n),0)}function n(t,n=e){return r(t,n)/t.length}function s(t,r=e,s=!1){const i=n(t,r);return t.reduce((t,e)=>Math.pow(e-i,2)+t,0)/(t.length-(s?1:0))}function i(t,r=e,n=!1){const i=s(t,r,n);return Math.sqrt(i)}function o(t,e){return(r,n,s,i)=>{let o=r,a=n,m=t(o,a),c=e(o,a),l=s(m),u=s(c);for(;a-o>i;)l<u?(a=c,c=m,u=l,m=t(o,a),l=s(m)):(o=m,m=c,l=u,c=e(o,a),u=s(c));return.5*(m+c)}}t.Utils=class Utils{static sum(t,e){return r(t,e)}static mean(t,e){return n(t,e)}static median(t,r){return function(t,r=e){const n=t.slice(0),s=n.length;n.sort((t,e)=>r(t)-r(e));const i=Math.ceil(n.length/2)-1;return s%2==1?n[i]:.5*(n[i+1]+n[i])}(t,r)}static mode(t,r){return function(t,r=e){const n=Object.groupBy(t,r);let s,i=0;for(let t in n){const e=n[t].length;e>i&&(s=parseInt(t),i=e)}return s}(t,r)}static var(t,e){return s(t,e,!0)}static varp(t,e){return s(t,e,!1)}static stdevp(t,e){return i(t,e,!1)}static stdev(t,e){return i(t,e,!0)}static correlation(t,r,s,i){return function(t,r,s=e,i=e){const o=Array.isArray(r);if(o&&r.length!==t.length)throw new Error("Sets must be of the same length.");const a=t.length,m=t,c=o?r:t,l=o?s:r,u=o?i:s,f=n(m,l),h=n(c,u);let y=0,x=0,g=0;for(let t=0;t<a;t++){const e=m[t],r=c[t],n=l(e,t)-f,s=u(r,t)-h;y+=n*s,x+=n*n,g+=s*s}return y/Math.sqrt(x*g)}(t,r,s,i)}static linearRegression(t,r,n,s){return function(t,r,n=e,s=e){const i=Array.isArray(r);if(i&&r.length!==t.length)throw new Error("Sets must be of the same length.");const o=t,a=i?r:t,m=i?n:r,c=m??(t=>t.x),l=(i?s:m)??(t=>t.y),u=t.length;let f=0,h=0,y=0,x=0,g=0;for(let t=0;t<u;t++){const e=o[t],r=a[t],n=c(e,t),s=l(r,t);f+=n*s,h+=n,y+=s,x+=n*n,g+=s*s}const p=(u*f-h*y)/(u*x-Math.pow(h,2));return[p,(y-p*h)/u]}(t,r,n,s)}static gaussian(e,r){return new t.Gaussian(e,r)}};t.SearchFunctions={linear:(t=2)=>function(t){if(t<=1)throw new RangeError("segments must be a number grater than 1.");return(e,r,n,s=.001)=>o((e,r)=>e+(r-e)/t,(e,r)=>r-(r-e)/t)(e,r,n,s)}(t),goldenRatio:(t,e,r,n=.001)=>o((t,e)=>e-(e-t)/1.618,(t,e)=>t+(e-t)/1.618)(t,e,r,n),gaussian:(t,e,r,n=.001)=>{var s=null,i=null;const a=(t,e)=>(i??=e-t,s??=i/Math.sqrt(12),s*(e-t)/i);return o((t,e)=>Math.max(t,(e+t)/2-a(t,e)),(t,e)=>Math.min(e,(e+t)/2+a(t,e)))(t,e,r,n)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
6
+ "use strict";var Pacem;!function(t){!function(e){!function(e){class Vector{static unit(t){const e={x:t.x,y:t.y};return this.normalize(e),e}static magSqr(t){return t.x*t.x+t.y*t.y}static mag(t){return Math.sqrt(Vector.magSqr(t))}static normalize(t){const e=Vector.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r}static from(e,r){return t.Point.subtract(e,r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static areClose(t,e){return(e.x-t.x).isCloseTo(0)&&(e.y-t.y).isCloseTo(0)}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){class Vertex{x;y;index;constructor(t,e,r=-1){this.x=t,this.y=e,this.index=r}equals(t){return this.x===t.x&&this.y===t.y}}class Triangle{v0;v1;v2;circumCirc;constructor(t,e,r){this.v0=t,this.v1=e,this.v2=r,this.circumCirc=function(t,e,r){const n=t.x,s=t.y,i=e.x,o=e.y,a=r.x,m=r.y,c=2*(n*(o-m)+i*(m-s)+a*(s-o));if(Math.abs(c)<1e-12)return{c:{x:0,y:0},r:1/0};const l=((n*n+s*s)*(o-m)+(i*i+o*o)*(m-s)+(a*a+m*m)*(s-o))/c,u=((n*n+s*s)*(a-i)+(i*i+o*o)*(n-a)+(a*a+m*m)*(i-n))/c;return{c:{x:l,y:u},r:Math.hypot(l-n,u-s)}}(t,e,r)}inCircumcircle(t){const e=this.circumCirc.c.x-t.x,r=this.circumCirc.c.y-t.y;return Math.hypot(e,r)<=this.circumCirc.r+1e-9}}function e(t,e){const r=[];e=e.filter(e=>!e.inCircumcircle(t)||(r.push({v0:e.v0,v1:e.v1}),r.push({v0:e.v1,v1:e.v2}),r.push({v0:e.v2,v1:e.v0}),!1));const n=function(t){const e=[];for(let r=0;r<t.length;++r){let n=!0;for(let e=0;e<t.length;++e)if(r!==e){const s=t[r],i=t[e];if(s.v0.equals(i.v0)&&s.v1.equals(i.v1)||s.v0.equals(i.v1)&&s.v1.equals(i.v0)){n=!1;break}}n&&e.push(t[r])}return e}(r);for(const r of n)e.push(new Triangle(r.v0,r.v1,t));return e}function r(t){if(t.length<3)return[];const r=function(t){let e=1/0,r=1/0,n=-1/0,s=-1/0;for(const i of t)e=Math.min(e,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),s=Math.max(s,i.y);const i=10*(n-e),o=10*(s-r),a=new Vertex(e-i,r-3*o),m=new Vertex(e-i,s+o),c=new Vertex(n+3*i,s+o);return new Triangle(a,m,c)}(t);let n=[r];for(const r of t)n=e(r,n);return n=n.filter(t=>!(t.v0===r.v0||t.v0===r.v1||t.v0===r.v2||t.v1===r.v0||t.v1===r.v1||t.v1===r.v2||t.v2===r.v0||t.v2===r.v1||t.v2===r.v2)),n}t.Delaunay=class Delaunay{static triangulate(t){return function(t){if(t.length<3)return[];const e=r(t.map((t,e)=>new Vertex(t.x,t.y,e))),n=[];for(const t of e)n.push(t.v0.index,t.v1.index,t.v2.index);return n}(t)}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,s=e.LinearAlgebra.Vector;function i(e){return t.Point.isPoint(e)}class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+Utils.slopeRad(t,e))%n}static slopeDeg(t,e){return Utils.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+Utils.slopeDeg(t,e))%360}static intersect(e,r,...n){return Array.isArray(e)&&Array.isArray(r)?Utils._intersectSegments(e,r,!0):t.Rect.isRect(e)?Utils._intersectRects(...arguments):"vertices"in e?Utils._mergePolygons(e,r,"intersect")?.polygons??null:null}static boundingBox(t){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=-Number.MAX_VALUE,s=-Number.MAX_VALUE;t.length;for(let i of t)e=Math.min(e,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),s=Math.max(s,i.y);return{x:e,y:r,width:n-e,height:s-r}}static combinePolygons(t,e,r){return Utils._mergePolygons(t,e,r)}static _mergePolygons(e,r,n){if(t.NullChecker.isNullOrEmpty(e?.vertices)||t.NullChecker.isNullOrEmpty(r?.vertices))return null;const s=e.vertices.filter(t=>Utils.inPolygon(t,r.vertices));if(e.vertices.length==s.length)return{polygons:"intersect"===n?[e]:[r]};const i=r.vertices.filter(t=>Utils.inPolygon(t,e.vertices));if(r.vertices.length===i.length)return{polygons:"intersect"===n?[r]:[e]};const o=Utils.boundingBox(e.vertices),a=Utils.boundingBox(r.vertices),m=Utils.intersect(o,a);if(!(t.Rect.isRect(m)&&m.width>0&&m.height>0))return null;const{vertices:c}=e,{vertices:l}=r;if(c.length<3||l.length<3)return null;const u=(t,e,r)=>[t,r[(e+1)%r.length]],f=(t,e)=>t.x===e.x?t.y-e.y:t.x-e.x,h=c.map(u),y=l.map(u),x=c.concat(l),g=new Map,p=t=>{if(!g.has(t)){const e=[];g.set(t,e)}return g.get(t)};let M=!1;for(let e of h){const r=p(e);for(let n of y){const s=p(n),i=Utils.intersect(e,n);t.NullChecker.isNull(i)||(M=!0,x.push(i),r.push(i),s.push(i))}}if(0===s.length&&0===i.length&&!M)return"union"===n?{polygons:[e,r]}:null;const d=[];for(let e of h.concat(y)){const r=p(e);if(t.NullChecker.isNullOrEmpty(r))d.push(e);else{const t=e.concat(r).sort(f);for(let e=0;e<t.length-1;e++)d.push([t[e],t[e+1]])}}var v,b=!1;do{x.sort(f),x.filter((t,e,r)=>0===e||!Utils.areClose(t,r[e-1])),v=Utils.mesh(x);const{vertices:e,triangleIndices:r}=v;b=!1;for(let n=0;n<r.length;n+=3){const s=r[n],i=r[n+1],o=r[n+2],a=e[s],m=e[i],c=e[o],l=[[a,m],[m,c],[c,a]];for(let e of d)for(let r of l){const n=Utils.areClose(r[0],e[0])||Utils.areClose(r[1],e[1])||Utils.areClose(r[0],e[1])||Utils.areClose(r[1],e[0])?null:Utils.intersect(r,e);t.NullChecker.isNull(n)||-1!==x.findIndex(t=>Utils.areClose(t,n,4))||(b=!0,x.push(n))}}}while(b);const{vertices:w,triangleIndices:z}=v,U=[];for(let t=0;t<z.length;t+=3){const e=t+1,r=t+2,s=w[z[t]],i=w[z[e]],o=w[z[r]],a={x:(s.x+i.x+o.x)/3,y:(s.y+i.y+o.y)/3},m=Utils.inPolygon(a,c),u=Utils.inPolygon(a,l);(m&&u&&"intersect"===n||(m||u)&&"union"===n||(m&&!u||!m&&u)&&"difference"===n)&&U.push([s,i,o])}const A=U.flatMap(([t,e,r])=>[[t,e],[e,r],[r,t]]),D=[];for(let t=0;t<A.length;t++){const e=A[t];if(0==t){D.push(e);continue}const r=D.findIndex(t=>Utils.areClose(t[0],e[0])&&Utils.areClose(t[1],e[1])||Utils.areClose(t[0],e[1])&&Utils.areClose(t[1],e[0]));-1===r?D.push(e):D.splice(r,1)}if(D.length<3)return null;const C=[],N=t=>{const{length:e}=t,r=Utils.areClose(t[0],t[e-1]),n=t.slice(0,r?e-1:e);return n.length>3&&Utils.inSegment(n[0],[n[1],n[n.length-1]])&&n.shift(),n},[P,V]=D.shift(),q=[P,V];for(;D.length>1;){const t=q[q.length-1],e=D.findIndex(e=>Utils.areClose(e[0],t)||Utils.areClose(e[1],t));if(-1===e){C.push({vertices:N(q.splice(0))});const[t,e]=D.shift();q.push(t,e)}else{const[r]=D.splice(e,1),n=Utils.areClose(r[0],t)?r[1]:Utils.areClose(r[1],t)?r[0]:null;q.length>1&&Utils.inSegment(q[q.length-1],[q[q.length-2],n])?q.splice(q.length-1,1,n):q.push(n)}}return C.push({vertices:N(q)}),{polygons:C,mesh:v,triangles:U.map(t=>({vertices:t}))}}static mesh(t,...r){const n=[].concat(t).concat(r);return{vertices:n,triangleIndices:e.Delaunay.triangulate(n)}}static intersectLines(t,e,r,n){let s,i;if(Array.isArray(t)&&Array.isArray(e)&&2===t.length&&2===e.length&&"number"==typeof t[0]&&"number"==typeof e[0]&&"number"==typeof t[1]&&"number"==typeof e[1]&&(r=e[0],n=e[1],e=t[1],t=t[0]),"number"==typeof t&&"number"==typeof e){s=[{x:0,y:e},{x:1,y:t+e}],i=[{x:0,y:n},{x:1,y:r+n}]}else s=t,i=e;return Utils._intersectSegments(s,i,!1)}static cramer(t,e){Array.isArray(t)&&(t={a:t[0],b:t[1],c:t[2]}),Array.isArray(e)&&(e={a:e[0],b:e[1],c:e[2]});let r=(t.b*e.c-t.c*e.b)/(t.b*e.a-t.a*e.b),n=(t.c*e.a-t.a*e.c)/(t.b*e.a-t.a*e.b);return{x:-r.roundoff(),y:-n.roundoff()}}static mq(t,e){let r;if(i(t)?r=t:(r=t[0],e=t[1]),r.x===e.x)return[Number.NaN,Number.NaN];const n=(e.y-r.y)/(e.x-r.x);return[n,r.y-n*r.x]}static _intersectSegments(t,e,r){const n=t[0],s=t[1],i=e[0],o=e[1],a=Math.min(n.x,s.x),m=Math.min(n.y,s.y),c=Math.max(n.x,s.x),l=c-a,u=Math.max(n.y,s.y),f=u-m,h=Math.min(i.x,o.x),y=Math.min(i.y,o.y),x=Math.max(i.x,o.x),g=x-h,p=Math.max(i.y,o.y),M=p-y;if(0===l&&0===g)return null;if(0===f&&0===M)return null;const d=t=>t.x<h||t.x>x||t.x<a||t.x>c,v=t=>t.y<y||t.y>p||t.y<m||t.y>u;var b=null;if(0===l){if(r&&(h>a||x<c))return null;const t=Utils.mq(i,o);b=Utils.cramer([1,0,-a],[t[0],-1,t[1]]),r&&v(b)&&(b=null)}else if(0===g){if(r&&(a>h||c<x))return null;const t=Utils.mq(n,s);b=Utils.cramer([t[0],-1,t[1]],[1,0,-h]),r&&v(b)&&(b=null)}else if(0===f){if(r&&(y>m||p<u))return null;const t=Utils.mq(i,o);b=Utils.cramer([0,1,-m],[t[0],-1,t[1]]),r&&d(b)&&(b=null)}else if(0===M){if(r&&(m>y||u<p))return null;const t=Utils.mq(n,s);b=Utils.cramer([t[0],-1,t[1]],[0,1,-y]),r&&d(b)&&(b=null)}else{let t;if(!r||(t=Utils._intersectRects({x:a,y:m,width:l,height:f},{x:h,y:y,width:g,height:M}))&&t.width>0&&t.height>0){const e=Utils.mq(n,s),a=Utils.mq(i,o),m=e[0],c=a[0],l=e[1],u=a[1];if(m!==c){let e=(b=Utils.cramer([m,-1,l],[c,-1,u])).x,n=b.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(b=null)}}}return null===b?null:{x:b.x,y:b.y}}static _intersectRects(...e){return t.Rect.intersect(...e)}static _areClose(t,e,r=12){return Math.abs(t.x-e.x).isCloseTo(0,r)&&Math.abs(t.y-e.y).isCloseTo(0,r)}static areClose(t,e,r=12){return Utils._areClose(t,e,r)}static dot(t,e){return s.dot(t,e)}static cross(t,e){return s.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&i(n[0])&&i(n[1]))return t.Point.distance(e[0],e[1]);if(i(r))return t.Point.distance(e,r);{const t=r[0],n=r[1];return Math.abs(t*e.x-e.y+n)/Math.sqrt(Math.pow(t,2)+1)}var n}static _pointSegmentDistance(t,e){const r=s.from(e[0],e[1]),n=s.from(e[0],t);return Utils.cross(r,n)}static isWithin(t,e,r,n=12){const s=Utils._pointSegmentDistance(t,e);return!s.isCloseTo(0,n)&&(r?s<0:s>0)}static isBeyond(t,e,r,n=12){return Utils.isWithin(t,e,!r,n)}static inLine(t,e,r=12){return Utils._pointSegmentDistance(t,e).isCloseTo(0,r)}static inSegment(t,e,r=12){const n=Math.min(e[0].x,e[1].x),s=Math.max(e[0].x,e[1].x),i=Math.min(e[0].y,e[1].y),o=Math.max(e[0].y,e[1].y);return t.x>=n&&t.x<=s&&t.y>=i&&t.y<=o&&Utils.inLine(t,e,r)}static inTriangle(e,r){let n;for(let s=0;s<3;s++){const i=r[s],o=r[(s+1)%3],a=t.Point.subtract(o,e),m=t.Point.subtract(i,e),c=Utils.cross(a,m);if(s>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e,r=12){if(!(e?.length>=3))throw"Not enough vertices";const n=e.length;if(3===n)return Utils.inTriangle(t,[e[0],e[1],e[2]]);r>0&&(e=e.map(t=>({x:t.x.roundoff(r),y:t.y.roundoff(r)})),t={x:t.x.roundoff(r),y:t.y.roundoff(r)});let s=Number.MAX_VALUE,i=Number.MAX_VALUE,o=Number.MIN_VALUE,a=Number.MIN_VALUE;for(let t=0;t<n;t++){const r=e[t];s=Math.min(s,r.x),i=Math.min(i,r.y),o=Math.max(o,r.x),a=Math.max(a,r.y)}if(t.x<s||t.x>o||t.y<i||t.y>a)return!1;const m=[{x:s-1,y:t.y},t];let c=0;for(let r=0;r<n;r++){const s=e[r],i=e[(r+1)%n],o=[s,i];if(s.y===t.y){const o=e[(r-1+n)%n];t.x>s.x&&(o.y-t.y)*(i.y-t.y)<0&&c++}else{if(i.y===t.y)continue;null!=Utils.intersect(o,m)&&c++}}return c%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const s=r.length;if(s>=3){for(let t=0;t<r.length;t++){const{x:e,y:i}=r[t],o=t===s-1?0:t+1,{x:a,y:m}=r[o];n+=e*m-i*a}n*=.5}return Math.abs(n.roundoff())}static convexHull(t,...e){const r=[].concat(t).concat(e);if(!(r?.length>1))return r?.slice()??[];const n=r.map(t=>({x:t.x,y:t.y})).sort((t,e)=>t.x===e.x?t.y-e.y:t.x-e.x),s=[];for(const t of n){const e=s[s.length-1];e&&e.x===t.x&&e.y===t.y||s.push(t)}if(s.length<=2)return s;const i=(t,e,r)=>(e.x-t.x)*(r.y-t.y)-(e.y-t.y)*(r.x-t.x),o=[];for(const t of s){for(;o.length>=2&&i(o[o.length-2],o[o.length-1],t)<=0;)o.pop();o.push(t)}const a=[];for(let t=s.length-1;t>=0;t--){const e=s[t];for(;a.length>=2&&i(a[a.length-2],a[a.length-1],e)<=0;)a.pop();a.push(e)}return o.pop(),a.pop(),o.concat(a)}}e.Utils=Utils}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r=180/Math.PI,n=1/r;class Vector3D{static from(...t){if(3!==t.length)throw new RangeError("Must provide exactly 3 numbers");return{x:t[0],y:t[1],z:t[2]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&3===r.length)return Vector3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Vector3D.`)}static i(){return{x:1,y:0,z:0}}static j(){return{x:0,y:1,z:0}}static k(){return{x:0,y:0,z:1}}static zero(){return{x:0,y:0,z:0}}static subtract(t,e){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}}static add(...t){var e={x:0,y:0,z:0};for(var r of t)e.x+=r.x,e.y+=r.y,e.z+=r.z;return e}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}static scale(t,e,r=e,n=e){return{x:t.x*e,y:t.y*r,z:t.z*n}}static magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static areClose(t,e){return(e.x-t.x).isCloseTo(0)&&(e.y-t.y).isCloseTo(0)&&(e.z-t.z).isCloseTo(0)}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}static negate(t){return{x:-t.x,y:-t.y,z:-t.z}}static unit(t){const e={x:t.x,y:t.y,z:t.z};return this.normalize(e),e}static normalize(t){const e=Vector3D.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r,t.z*=r}static angleBetween(t,e){let n;const s=Vector3D.unit(t),i=Vector3D.unit(e);if(Vector3D.dot(s,i)<0){const t={x:-s.x-i.x,y:-s.y-i.y,z:-s.z-i.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:s.x-i.x,y:s.y-i.y,z:s.z-i.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Spherical{static from(t,e,r){return{rho:t.clamp(0,1/0),theta:e.clamp(-180,180),phi:r.clamp(0,360)}}static fromVector(t,e,n){"number"==typeof t&&(t=Vector3D.from(t,e,n));const s=Vector3D.mag(t);if(s.isCloseTo(0))return Spherical.from(0,0,0);const i=Math.atan2(t.x,t.z),o=Math.acos((t.y/s).clamp(-1,1));return Spherical.from(s,i*r,o*r)}static toVector(t){const{rho:e,theta:r,phi:s}=t,i=s*n,o=r*n,a=Math.sin(i)*e;return{x:a*Math.sin(o),y:Math.cos(i)*e,z:a*Math.cos(o)}}static toRotationMatrix(t){const{theta:e,phi:r}=t,s=n*e,i=Math.sin(s),o=Math.cos(s),a=n*r,m=Math.sin(a),c=Math.cos(a);return Matrix3D.from(i*c,i*m,o,0,o*c,o*m,-i,0,-m,c,0,0,0,0,0,1)}}e.Spherical=Spherical;class Matrix3DUtils{static modify(t,e){const{m11:r,m12:n,m13:s,m14:i,m21:o,m22:a,m23:m,m24:c,m31:l,m32:u,m33:f,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:p}=t,M={m11:r,m12:n,m13:s,m14:i,m21:o,m22:a,m23:m,m24:c,m31:l,m32:u,m33:f,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:p};return e(M),M}static clone(t){return Matrix3DUtils.modify(t,t=>{})}static multiply(t,e){return Matrix3D.isIdentity(t)?e:Matrix3D.isIdentity(e)?t:Matrix3D.from(t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.offsetX,t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.offsetY,t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.offsetZ,t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.offsetX,t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.offsetY,t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.offsetZ,t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.offsetX,t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.offsetY,t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.offsetZ,t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,t.offsetX*e.m11+t.offsetY*e.m21+t.offsetZ*e.m31+t.m44*e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+t.offsetZ*e.m32+t.m44*e.offsetY,t.offsetX*e.m13+t.offsetY*e.m23+t.offsetZ*e.m33+t.m44*e.offsetZ,t.offsetX*e.m14+t.offsetY*e.m24+t.offsetZ*e.m34+t.m44*e.m44)}}class Matrix3D{static identity(){return{m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,offsetX:0,offsetY:0,offsetZ:0,m44:1}}static from(...t){if(16!==t.length)throw new RangeError("Must provide exactly 16 numbers");return{m11:t[0],m12:t[1],m13:t[2],m14:t[3],m21:t[4],m22:t[5],m23:t[6],m24:t[7],m31:t[8],m32:t[9],m33:t[10],m34:t[11],offsetX:t[12],offsetY:t[13],offsetZ:t[14],m44:t[15]}}static transpose(t){return Matrix3D.from(t.m11,t.m21,t.m31,t.offsetX,t.m12,t.m22,t.m32,t.offsetY,t.m13,t.m23,t.m33,t.offsetZ,t.m14,t.m24,t.m34,t.m44)}static toArray(t){return[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44]}static clone(t,e){return"function"==typeof e?Matrix3DUtils.modify(t,e):Matrix3DUtils.clone(t)}static scale(t,e,r,n){return"number"==typeof e?(r??=e,n??=e):(n=e.z,r=e.y,e=e.x),Matrix3DUtils.modify(t,t=>{t.m11*=e,t.m22*=r,t.m33*=n})}static translate(t,e){return Matrix3DUtils.modify(t,t=>{t.offsetX+=e.x,t.offsetY+=e.y,t.offsetZ+=e.z})}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&16===r.length)return Matrix3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Matrix3D.`)}static isIdentity(t){return 1==t.m11&&0==t.m12&&0==t.m13&&0==t.m14&&0==t.m21&&1==t.m22&&0==t.m23&&0==t.m24&&0==t.m31&&0==t.m32&&1==t.m33&&0==t.m34&&0==t.offsetX&&0==t.offsetY&&0==t.offsetZ&&1==t.m44}static isAffine(t){return 0==t.m14&&0==t.m24&&0==t.m34&&1==t.m44}static determinant(t){if(Matrix3D.isIdentity(t))return 1;if(Matrix3D.isAffine(t))return t.m11*(t.m22*t.m33-t.m32*t.m23)-t.m12*(t.m21*t.m33-t.m31*t.m23)+t.m13*(t.m21*t.m32-t.m31*t.m22);{const e=t.m13*t.m24-t.m23*t.m14,r=t.m13*t.m34-t.m33*t.m14,n=t.m13*t.m44-t.offsetZ*t.m14,s=t.m23*t.m34-t.m33*t.m24,i=t.m23*t.m44-t.offsetZ*t.m24,o=t.m33*t.m44-t.offsetZ*t.m34,a=t.m22*r-t.m32*e-t.m12*s,m=t.m12*i-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*o,l=t.m22*o-t.m32*i+t.offsetY*s;return t.offsetX*a+t.m31*m+t.m21*c+t.m11*l}}static multiply(...t){if(0===t.length)throw new ReferenceError("Matrix not provided.");const e=Array.from(t);let r=e[0];for(let t=1;t<e.length;t++)r=Matrix3DUtils.multiply(r,e[t]);return r}static invert(t){if(Matrix3D.isAffine(t)){const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m12*t.m23-t.m22*t.m13,n=t.m32*t.m13-t.m12*t.m33,s=t.m22*t.m33-t.m32*t.m23,i=t.m21*t.m13-t.m11*t.m23,o=t.m11*t.m33-t.m31*t.m13,a=t.m31*t.m23-t.m21*t.m33,m=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,l=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,f=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*l-t.offsetZ*m-t.m13*f,x=t.m13*h-t.m33*l+t.offsetZ*c,g=t.m33*f-t.offsetZ*u-t.m23*h,p=m,M=-c,d=u,v=1/e;return Matrix3D.from(s*v,n*v,r*v,0,a*v,o*v,i*v,0,d*v,M*v,p*v,0,g*v,x*v,y*v,1)}{const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m33*t.m44-t.m34*t.offsetZ,n=t.m32*t.m44-t.m34*t.offsetY,s=t.m31*t.m44-t.m34*t.offsetX,i=t.m32*t.offsetZ-t.m33*t.offsetY,o=t.m31*t.offsetZ-t.m33*t.offsetX,a=t.m31*t.offsetY-t.m32*t.offsetX,m=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,l=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,f=t.m31*t.offsetZ-t.m33*t.offsetX,h=t.m31*t.offsetY-t.m32*t.offsetX,y=t.m23*t.m44-t.m24*t.offsetZ,x=t.m22*t.m44-t.m24*t.offsetY,g=t.m21*t.m44-t.m24*t.offsetX,p=t.m22*t.offsetZ-t.m23*t.offsetY,M=t.m21*t.offsetZ-t.m23*t.offsetX,d=t.m21*t.offsetY-t.m22*t.offsetX,v=t.m23*t.m34-t.m24*t.m33,b=t.m22*t.m34-t.m24*t.m32,w=t.m21*t.m34-t.m24*t.m31,z=t.m22*t.m33-t.m23*t.m32,U=t.m21*t.m33-t.m23*t.m31,A=t.m21*t.m32-t.m22*t.m31,D=t.m22*r-t.m23*n+t.m24*i,C=-(t.m21*r-t.m23*s+t.m24*o),N=t.m21*n-t.m22*s+t.m24*a,P=-(t.m21*i-t.m22*o+t.m23*a),V=-(t.m12*m-t.m13*c+t.m14*u),q=t.m11*m-t.m13*l+t.m14*f,X=-(t.m11*c-t.m12*l+t.m14*h),S=t.m11*u-t.m12*f+t.m13*h,Y=t.m12*y-t.m13*x+t.m14*p,Z=-(t.m11*y-t.m13*g+t.m14*M),E=t.m11*x-t.m12*g+t.m14*d,_=-(t.m11*p-t.m12*M+t.m13*d),T=-(t.m12*v-t.m13*b+t.m14*z),L=t.m11*v-t.m13*w+t.m14*U,I=-(t.m11*b-t.m12*w+t.m14*A),R=t.m11*z-t.m12*U+t.m13*A,Q=1/e;return Matrix3D.from(D*Q,V*Q,Y*Q,T*Q,C*Q,q*Q,Z*Q,L*Q,N*Q,X*Q,E*Q,I*Q,P*Q,S*Q,_*Q,R*Q)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,s=r.y,i=r.z;if(r.x=n*e.m11+s*e.m21+i*e.m31+e.offsetX,r.y=n*e.m12+s*e.m22+i*e.m32+e.offsetY,r.z=n*e.m13+s*e.m23+i*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var o=n*e.m14+s*e.m24+i*e.m34+e.m44;0!=o&&(r.x/=o,r.y/=o,r.z/=o)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{static identity(){return Quaternion.from(0,0,0,1)}static from(...t){if(4!==t.length)throw new RangeError("Must provide exactly 4 numbers");return{x:t[0],y:t[1],z:t[2],w:t[3]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&4===r.length)return Quaternion.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Quaternion.`)}static fromVectors(t,e){Vector3D.normalize(t),Vector3D.normalize(e);const r=(t,e,r,n)=>{const s=Quaternion.from(t,e,r,n);return Quaternion.normalize(s),s};let n=Vector3D.dot(t,e)+1;return n.isCloseTo(0)?Math.abs(t.x)>Math.abs(t.z)?r(-t.y,t.x,0,0):r(0,-t.z,t.y,0):r(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x,n)}static normalize(t){const e=Quaternion.mag(t);if(e.isCloseTo(0))t.x=t.y=t.z=0,t.w=1;else{const r=1/e;t.x*=r,t.y*=r,t.z*=r,t.w*=r}}static unit(t){const e=Quaternion.from(t.x,t.y,t.z,t.w);return Quaternion.normalize(e),e}static fromAxisAngle(t,e){var r=n*(e%=360),s=Vector3D.mag(t);if(0==s)throw new RangeError("Invalid argument");var i=Math.sin(.5*r)/s,o=t.x*i,a=t.y*i,m=t.z*i;return Quaternion.from(o,a,m,Math.cos(.5*r))}static fromRotationMatrix(t){const e=t.m11+t.m22+t.m33+t.m44;if(e>0){const r=.5/Math.sqrt(e),n=.25/r,s=(t.m23-t.m32)*r,i=(t.m31-t.m13)*r,o=(t.m12-t.m21)*r;return Quaternion.from(s,i,o,n)}if(t.m11>t.m22&&t.m11>t.m22){const e=.5/Math.sqrt(t.m44+t.m11-t.m22-t.m33),r=(t.m23-t.m32)*e,n=.25/e,s=(t.m12+t.m21)*e,i=(t.m31+t.m13)*e;return Quaternion.from(n,s,i,r)}if(t.m22>t.m33){const e=.5/Math.sqrt(t.m44+t.m22-t.m11-t.m33),r=(t.m23+t.m32)*e,n=.25/e,s=(t.m12+t.m21)*e,i=(t.m31-t.m13)*e;return Quaternion.from(s,n,r,i)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,s=(t.m12-t.m21)*e,i=(t.m31-t.m13)*e;return Quaternion.from(i,r,n,s)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,t.w)}static mag(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w)}static norm(t){return t.x*t.x+t.y*t.y+t.z*t.z}static axis(t){return 0==t.x&&0==t.y&&0==t.z?Vector3D.j():Vector3D.unit(t)}static transform(t,e){Quaternion.normalize(e);const r=Vector3D.cross(e,t),n=Vector3D.scale(r,2),s=Vector3D.cross(e,n);return{x:t.x+e.w*n.x+s.x,y:t.y+e.w*n.y+s.y,z:t.z+e.w*n.z+s.z}}static angle(t){let e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=t.w;if(e>Number.MAX_VALUE){const n=Math.max(Math.abs(t.x),Math.max(Math.abs(t.y),Math.abs(t.z))),s=t.x/n,i=t.y/n,o=t.z/n;e=Math.sqrt(s*s+i*i+o*o),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,s=t.z,i=t.w;return e.m11=1-2*n*n-2*s*s,e.m12=2*r*n+2*i*s,e.m13=2*r*s-2*i*n,e.m21=2*r*n-2*i*s,e.m22=1-2*r*r-2*s*s,e.m23=2*n*s+2*i*r,e.m31=2*i*n+2*r*s,e.m32=2*n*s-2*i*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=Quaternion.unit(t);return Quaternion.conjugate(e)}static multiply(t,e){return Quaternion.from(t.w*e.x+t.x+e.w+t.y*e.z-t.z*e.y,t.w*e.y-t.x*e.z+t.y*e.w+t.z*e.x,t.w*e.z+t.x*e.y-t.y*e.x+t.z*e.w,t.w*e.w-t.x*e.x-t.y*e.y-t.z*e.z)}static dot(t,e){return Quaternion.multiply(t,Quaternion.conjugate(e)).w}}e.Quaternion=Quaternion}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=t.Geometry.LinearAlgebra.Vector3D;t.Geometry.LinearAlgebra.Matrix3D;e.Utils3D=class Utils3D{static intersect(t,e){const[n,s]=t,i=r.subtract(n,s),[o,a,m]=e,c=r.subtract(o,a),l=r.subtract(o,m),u=r.cross(i,l),f=r.dot(c,u);if(f.isCloseTo(0))return null;const h=1/f,y=r.subtract(n,o),x=h*r.dot(y,u);if(x<0||x>1)return null;const g=r.cross(y,c),p=h*r.dot(i,g);if(p<0||x+p>1)return null;const M=h*r.dot(l,g);return M<0||M.isCloseTo(0)?null:r.add(n,r.scale(i,M))}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){class Polygon{static _eps=1e-12;static isPolygon(e){return function(e){let r;return"vertices"in e&&Array.isArray(e.vertices)&&(r=e.vertices).length>=3&&r.every(e=>t.Point.isPoint(e))}(e)}static from(...t){return{vertices:Array.from(t)}}static contains(t,r){return e.Utils.inPolygon(r,t.vertices,12)}static centroid(t){const e=Polygon.boundingBox(t);return{x:e.x+e.width/2,y:e.y+e.height/2}}static boundingBox(t){return e.Utils.boundingBox(t.vertices)}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],s=e[t-1];r.push([s,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let s=0;for(let e=0;e<r.length;e++){const i=r[(e-1+n)%n],o=r[e],a=r[(e+1)%n],m=t.Angle.angleBetween(o,i,a);if(0!==s){if(s!=Math.sign(m))return!1}else s=Math.sign(m)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const s=Polygon.sides(r);for(let r of s)for(let n of s){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const s=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(s))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,s]}=e;return t.Angle.angleBetween(n,r,s)>0}static expand(r,n){const{vertices:s}=r,i=s.length,o=[];for(let r=0;r<s.length;r++){const a=s[(r-1+i)%i],m=s[r],c=s[(r+1)%i],l=t.Angle.angleBetween(m,a,c),u=-n/Math.sin(Math.abs(l)/2),f=t.Matrix2D.scale(t.Matrix2D.identity,u),h=t.Point.subtract(m,a);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(m,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,f);o.push(t.Point.add(m,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:o}}static area(t){return e.Utils.area(t.vertices)}static intersect(e,r){return t.Geometry.Utils.intersect(e,r)}static convexHull(t){return{vertices:e.Utils.convexHull(t.vertices)}}}e.Polygon=Polygon}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){function e(t){return"number"==typeof t&&(t={real:t,img:0}),t}var r;function n(t,e){const r={};return Object.defineProperty(r,"real",{value:t,writable:!1}),Object.defineProperty(r,"img",{value:e,writable:!1}),r}function s(){return r||(r=n(Number.NaN,Number.NaN))}t.Complex=class Complex{static build(t,e){return this.isComplex(t)?t:(e??=0,"number"!=typeof t||"number"!=typeof e?s():n(t,e||0))}static add(t,r){const s=e(t),i=e(r);return n(s.real+i.real,s.img+i.img)}static subtract(t,r){const s=e(t),i=e(r);return n(s.real-i.real,s.img-i.img)}static multiply(t,r){const s=e(t),i=e(r);return n(s.real*i.real-s.img*i.img,s.real*i.img+s.img*i.real)}static divide(t,r){const i=e(t),o=e(r),a=this.absSquare(o).roundoff();if(0===a)return s();const m=1/a;return n(m*(i.real*o.real+i.img*o.img),m*(i.img*o.real-i.real*o.img))}static absSquare(t){const r=e(t);return Math.pow(r.real,2)+Math.pow(r.img,2)}static modulus(t){return Math.sqrt(this.absSquare(t))}static isComplex(t){return null!=t&&"object"==typeof t&&"real"in t&&"img"in t&&"number"==typeof t.real&&"number"==typeof t.img}static conjugate(t){return n((t=e(t)).real,0==Math.abs(t.img)?0:-t.img)}static equals(t,e){const r=this.build(t),n=this.build(e);return!(!this.isComplex(t)||!this.isComplex(e))&&(r.real===n.real&&r.img===n.img)}static get NaC(){return s()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const s=r[n]=r[n]||{};return s[e]=s[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function s(e){const r=[],i=e.length;if(1===i)return[t.Complex.build(e[0])];const o=s(e.filter((t,e)=>e%2==0)),a=s(e.filter((t,e)=>e%2==1));for(var m=0;m<i/2;m++){const e=o[m],s=t.Complex.multiply(n(m,i),a[m]);r[m]=t.Complex.add(e,s),r[m+i/2]=t.Complex.subtract(e,s)}return r}e.Fourier=class Fourier{static transform(t,e=!0){return(r=(t=t||[]).length)>0&&!(r&r-1)?this.fft(t,e):this.dft(t,e);var r}static invert(t,e=!0){return this.idft(t||[],e)}static dft(e,r=!0){const s=(e||[])?.length,i=r?1/Math.sqrt(s):1,o=[];for(let r=0;r<s;r++){o.push({real:0,img:0});for(let a=0;a<s;a++){const m=n(r*a,s),c=t.Complex.multiply(e[a],m),l=t.Complex.multiply(c,i);o[r]=t.Complex.add(o[r],l)}}return o}static idft(e,r=!0){const n=e.map(e=>t.Complex.build(e.img,e.real));return this.transform(n,r).map(e=>t.Complex.build(e.img,e.real))}static fft(e,r=!0){const n=s(e);if(!r)return n;const i=1/Math.sqrt(e.length);return n.map(e=>t.Complex.multiply(e,i))}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=Math.sqrt(Math.PI);function r(t){const e=Math.abs(t),r=1/(1+.5*e),n=r*Math.exp(-e*e-1.26551223+r*(1.00002368+r*(.37409196+r*(.09678418+r*(r*(.27886807+r*(r*(1.48851587+r*(.17087277*r-.82215223))-1.13520398))-.18628806)))));return t>=0?n:2-n}class Gaussian{constructor(t,e){this.mean=t,this.stdev=Math.abs(e),this.variance=Math.pow(e,2)}mean;stdev;variance;static get normal(){return n}weight(t){return Math.exp(-.5*Math.pow(this._z(t),2))}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return this.weight(t)/r}_z(t){return(t-this.mean)/this.stdev}probability(t){return.5*r(-this._z(t)/Math.SQRT2)}}t.Gaussian=Gaussian;const n=new Gaussian(0,1)}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){class Lagrange{constructor(t){this.#t=t}#t;#e=null;_prepareBarycentric(){if(this.#e)return;const t=this.#t||[],e=t.length;if(0===e)return void(this.#e=[]);const r=new Array(e),n=new Array(e);for(let s=0;s<e;s++){let i=0,o=1;const a=t[s].x;for(let r=0;r<e;r++){if(r===s)continue;const e=a-t[r].x;if(0===e)throw new Error("Invalid function provided.");e<0&&(o=-o),i+=Math.log(Math.abs(e))}r[s]=-i,n[s]=o}let s=r[0];for(let t=1;t<e;t++)r[t]>s&&(s=r[t]);const i=new Array(e);for(let t=0;t<e;t++){const e=Math.exp(r[t]-s);i[t]=n[t]*e}this.#e=i}_computeBarycentric(t){const e=this.#t||[];this.#e||this._prepareBarycentric();const r=this.#e||[];let n=0,s=0;for(let i=0;i<e.length;i++){const o=e[i].x;if(t===o)return e[i].y;const a=r[i]/(t-o);n+=a*e[i].y,s+=a}return n/s}interpolate(t){return this._computeBarycentric(t)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Lagrange(e)}}t.Lagrange=Lagrange,t.Lagrangian={create:Lagrange.create};class Pchip{xs;ys;ms;constructor(t){if(!t||t.length<2)throw new Error("Need at least 2 points");const e=t.slice().sort((t,e)=>t.x-e.x);this.xs=e.map(t=>t.x),this.ys=e.map(t=>t.y),this.ms=this.computeDerivatives()}computeDerivatives(){const t=this.xs.length,e=new Array(t-1),r=new Array(t-1);for(let n=0;n<t-1;n++)e[n]=this.xs[n+1]-this.xs[n],r[n]=(this.ys[n+1]-this.ys[n])/e[n];const n=new Array(t).fill(0);n[0]=r[0],n[t-1]=r[t-2];for(let s=1;s<t-1;s++){const t=r[s-1],i=r[s];if(0===t||0===i||t*i<=0)n[s]=0;else{const r=2*e[s]+e[s-1],o=e[s]+2*e[s-1];n[s]=(r+o)/(r/t+o/i)}}for(let e=0;e<t-1;e++)if(0===r[e])n[e]=0,n[e+1]=0;else{const t=n[e]/r[e],s=n[e+1]/r[e],i=t*t+s*s;if(i>9){const o=3/Math.sqrt(i);n[e]=o*t*r[e],n[e+1]=o*s*r[e]}}return n}interpolate(t){const e=this.xs,r=this.ys,n=this.ms,s=e.length;if(t<=e[0]){const s=n[0];return r[0]+s*(t-e[0])}if(t>=e[s-1]){const i=n[s-1];return r[s-1]+i*(t-e[s-1])}let i=0,o=s-1;for(;o-i>1;){const r=i+o>>1;e[r]<=t?i=r:o=r}const a=e[i+1]-e[i],m=(t-e[i])/a,c=m*m,l=c*m,u=l-2*c+m,f=-2*l+3*c,h=l-c;return(2*l-3*c+1)*r[i]+u*(n[i]*a)+f*r[i+1]+h*(n[i+1]*a)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Pchip(e)}}t.Pchip=Pchip;class Newton{xs;coeffs;constructor(t){if(!t||0===t.length)throw new Error("Need at least 1 point");const e=t.slice().sort((t,e)=>t.x-e.x);this.xs=e.map(t=>t.x);const r=e.length,n=e.map(t=>t.y);for(let t=1;t<r;t++)for(let e=r-1;e>=t;e--){const r=this.xs[e]-this.xs[e-t];if(0===r)throw new Error("Invalid function provided.");n[e]=(n[e]-n[e-1])/r}this.coeffs=n}interpolate(t){const e=this.xs,r=this.coeffs,n=r.length;if(0===n)return NaN;let s=r[n-1];for(let i=n-2;i>=0;i--)s=s*(t-e[i])+r[i];return s}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map((t,e)=>"number"==typeof t?{x:e,y:t}:t);return new Newton(e)}}t.Newton=Newton}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r="0123456789abcdefghijklmnopqrstuvwxyz",n="Radix out of range: possible values go between positive 1 exclusive and 36 inclusive";class Utils{static lcd(...e){if(t.NullChecker.isNullOrEmpty(e)||e.length<=1)throw"Insufficient set of numbers.";function r(t,e){return e?r(e,t%e):0===e?t:NaN}function n(t,e){return t*e/r(t,e)}let s=Math.round(e[0]);for(let t=1;t<e.length;t++)s=n(s,Math.round(e[t]));return s}static gcd(t,e){return t=Math.round(t),e=Math.round(e),0===t?e:Utils.gcd(e%t,t)}static rebaseInt(e,r,n){return t.Numbers.rebase(e,r,n)}static rebaseFloat(t,e,r,n=12){const s=Utils.rebaseFloat10ToN,i=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):s(e,r,n)}if(10===r)return i(t.toString(),e,n);return s(i(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,s=12){const i=r;if(e<=1||e>i.length)throw new Error(n);const o=(t??"0").toString().toLowerCase(),a=Number.NaN;if("0"===o)return 0;const m=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(o);if(m.length<2)return a;const c="-"===m[1]?-1:1,l=m[2]||"0",u=m[3]||".0";let f=0,h=0;for(let t of l+u.substr(1)){const r=i.indexOf(t);if(-1===r||r>=e)return a;f+=r*Math.pow(e,l.length-h-1),h++}return c*f}static rebaseFloat10ToNIntBase(t,e,s=12){const i=r;if(e<=1||e>36)throw new Error(n);const o=e;let a=Math.abs(t??0);if(0===a||Number.isNaN(a))return t.toString();let m=(a%1).roundoff(),c="";for(;;){let t=a/o,e=Math.floor(t),r=(a-e*o).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:i[n]+c,e<=0)break;a=e}if(c=c.replace(/^0+/,""),c||="0",0===m)return c;let l="";do{a=(m*o).roundoff();const t=Math.floor(a),e=(a-t).roundoff();t>=36?l=`[${t}]`:l+=i[t],m=e}while(!m.isCloseTo(0)&&l.length<s);return/^0*$/.test(l)?c:(Math.sign(t)<0?"-":"")+c+"."+l.replace(/0+$/,"")}static rebaseFloat10ToN(e,s,i=12){const o=r;if(s<=1||s>o.length)throw new Error(n);const a=s;let m=Math.abs(e??0);if(0===m||Number.isNaN(m))return e.toString();let c=Math.sign(e)<0?"-":"",l=[],u=[];for(let t=0;t<20;t++)l.push("0"),u.push("0");const f=a%1==0?a:Math.ceil(a);function h(t,e,r){const n=t?l:u,s=n[e]=n[e]||"0",i=o.indexOf(s)+r,a=i%f,m=Math.floor(i/f);return n[e]=o[a],m>0&&(t?h(t,e+1,m):0===e?h(!0,0,m):h(!1,e-1,m)),m}let y=0;for(;;){const e=Math.floor(t.Numbers.log(m,a)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),m=(m-Math.pow(a,e).roundoff()).roundoff(),r||y++,0===m||y>=100){const t=c+(l.reverse().map(t=>t||"0").join("").replace(/^0+/,"")||"0"),e=u.map(t=>t||"0").join("").substr(0,i).replace(/0+$/,"");return/^0*$/.test(e)?t:t+"."+e}}}}e.Utils=Utils}(e.NumberTheory||(e.NumberTheory={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=(t,e)=>t;function r(t,r=e){return t.reduce((t,e,n)=>t+r(e,n),0)}function n(t,n=e){return r(t,n)/t.length}function s(t,r=e,s=!1){const i=n(t,r);return t.reduce((t,e)=>Math.pow(e-i,2)+t,0)/(t.length-(s?1:0))}function i(t,r=e,n=!1){const i=s(t,r,n);return Math.sqrt(i)}function o(t,e){return(r,n,s,i)=>{let o=r,a=n,m=t(o,a),c=e(o,a),l=s(m),u=s(c);for(;a-o>i;)l<u?(a=c,c=m,u=l,m=t(o,a),l=s(m)):(o=m,m=c,l=u,c=e(o,a),u=s(c));return.5*(m+c)}}t.Utils=class Utils{static sum(t,e){return r(t,e)}static mean(t,e){return n(t,e)}static median(t,r){return function(t,r=e){const n=t.slice(0),s=n.length;n.sort((t,e)=>r(t)-r(e));const i=Math.ceil(n.length/2)-1;return s%2==1?n[i]:.5*(n[i+1]+n[i])}(t,r)}static mode(t,r){return function(t,r=e){const n=Object.groupBy(t,r);let s,i=0;for(let t in n){const e=n[t].length;e>i&&(s=parseInt(t),i=e)}return s}(t,r)}static var(t,e){return s(t,e,!0)}static varp(t,e){return s(t,e,!1)}static stdevp(t,e){return i(t,e,!1)}static stdev(t,e){return i(t,e,!0)}static correlation(t,r,s,i){return function(t,r,s=e,i=e){const o=Array.isArray(r);if(o&&r.length!==t.length)throw new Error("Sets must be of the same length.");const a=t.length,m=t,c=o?r:t,l=o?s:r,u=o?i:s,f=n(m,l),h=n(c,u);let y=0,x=0,g=0;for(let t=0;t<a;t++){const e=m[t],r=c[t],n=l(e,t)-f,s=u(r,t)-h;y+=n*s,x+=n*n,g+=s*s}return y/Math.sqrt(x*g)}(t,r,s,i)}static linearRegression(t,r,n,s){return function(t,r,n=e,s=e){const i=Array.isArray(r);if(i&&r.length!==t.length)throw new Error("Sets must be of the same length.");const o=t,a=i?r:t,m=i?n:r,c=m??(t=>t.x),l=(i?s:m)??(t=>t.y),u=t.length;let f=0,h=0,y=0,x=0,g=0;for(let t=0;t<u;t++){const e=o[t],r=a[t],n=c(e,t),s=l(r,t);f+=n*s,h+=n,y+=s,x+=n*n,g+=s*s}const p=(u*f-h*y)/(u*x-Math.pow(h,2));return[p,(y-p*h)/u]}(t,r,n,s)}static gaussian(e,r){return new t.Gaussian(e,r)}};t.SearchFunctions={linear:(t=2)=>function(t){if(t<=1)throw new RangeError("segments must be a number grater than 1.");return(e,r,n,s=.001)=>o((e,r)=>e+(r-e)/t,(e,r)=>r-(r-e)/t)(e,r,n,s)}(t),goldenRatio:(t,e,r,n=.001)=>o((t,e)=>e-(e-t)/1.618,(t,e)=>t+(e-t)/1.618)(t,e,r,n),gaussian:(t,e,r,n=.001)=>{var s=null,i=null;const a=(t,e)=>(i??=e-t,s??=i/Math.sqrt(12),s*(e-t)/i);return o((t,e)=>Math.max(t,(e+t)/2-a(t,e)),(t,e)=>Math.min(e,(e+t)/2+a(t,e)))(t,e,r,n)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.60.2-young (https://js.pacem.it)
2
+ * pacem v0.60.2-zeno (https://js.pacem.it)
3
3
  * Copyright 2026 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.60.2-young",
2
+ "version": "0.60.2-zeno",
3
3
  "name": "pacem",
4
4
  "homepage": "https://js.pacem.it",
5
5
  "repository": {