pacem 0.51.0 → 0.51.1-akkad

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 +3 -2
  45. package/dist/js/pacem-numerical.js +32 -4
  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.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -108,7 +108,8 @@ declare namespace Pacem.Geometry.LinearAlgebra {
108
108
  static toArray(m: Matrix3D): number[];
109
109
  static clone(m: Matrix3D): Matrix3D;
110
110
  static scale(m: Matrix3D, scale: number): Matrix3D;
111
- static scale(m: Matrix3D, x: number, y: number, z: number): Matrix3D;
111
+ static scale(m: Matrix3D, sx: number, sy: number, sz: number): Matrix3D;
112
+ static translate(m: Matrix3D, offset: Vector3D): Matrix3D;
112
113
  static parse(input: string): Matrix3D;
113
114
  static isIdentity(m: Matrix3D): boolean;
114
115
  static isAffine(m: Matrix3D): boolean;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -407,6 +407,22 @@ var Pacem;
407
407
  }
408
408
  }
409
409
  LinearAlgebra.Vector3D = Vector3D;
410
+ class Matrix3DModifier {
411
+ static modify(m, action) {
412
+ const { m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, offsetX, offsetY, offsetZ, m44 } = m;
413
+ const retval = {
414
+ m11, m12, m13, m14,
415
+ m21, m22, m23, m24,
416
+ m31, m32, m33, m34,
417
+ offsetX, offsetY, offsetZ, m44
418
+ };
419
+ action(retval);
420
+ return retval;
421
+ }
422
+ static clone(m) {
423
+ return Matrix3DModifier.modify(m, _ => { });
424
+ }
425
+ }
410
426
  class Matrix3D {
411
427
  static identity() {
412
428
  return {
@@ -473,10 +489,21 @@ var Pacem;
473
489
  m.offsetX, m.offsetY, m.offsetZ, m.m44];
474
490
  }
475
491
  static clone(m) {
476
- return Matrix3D.from.apply(null, Matrix3D.toArray(m));
492
+ return Matrix3DModifier.clone(m);
477
493
  }
478
494
  static scale(m, x, y = x, z = x) {
479
- return Matrix3D.from(m.m11 * x, m.m12, m.m13, m.m14, m.m21, m.m22 * y, m.m23, m.m24, m.m31, m.m32, m.m33 * z, m.m34, m.offsetX, m.offsetY, m.offsetZ, m.m44);
495
+ return Matrix3DModifier.modify(m, s => {
496
+ s.m11 *= x;
497
+ s.m22 *= y;
498
+ s.m33 *= z;
499
+ });
500
+ }
501
+ static translate(m, offset) {
502
+ return Matrix3DModifier.modify(m, s => {
503
+ s.offsetX += offset.x;
504
+ s.offsetY += offset.y;
505
+ s.offsetZ += offset.z;
506
+ });
480
507
  }
481
508
  static parse(input) {
482
509
  const arr = Pacem.parseAsNumericalArray(input);
@@ -495,8 +522,9 @@ var Pacem;
495
522
  return m.m14 == .0 && m.m24 == .0 && m.m34 == .0 && m.m44 == 1.0;
496
523
  }
497
524
  static determinant(m) {
498
- if (Matrix3D.isIdentity(m))
525
+ if (Matrix3D.isIdentity(m)) {
499
526
  return 1.0;
527
+ }
500
528
  else if (Matrix3D.isAffine(m)) {
501
529
  return m.m11 * (m.m22 * m.m33 - m.m32 * m.m23)
502
530
  - m.m12 * (m.m21 * m.m33 - m.m31 * m.m23)
@@ -1,6 +1,6 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- 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}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,m=e.LinearAlgebra.Vector;function s(e){return t.Point.isPoint(e)}e.Utils=class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+this.slopeRad(t,e))%n}static slopeDeg(t,e){return this.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+this.slopeDeg(t,e))%360}static intersect(t,e,...r){return Array.isArray(t)&&Array.isArray(e)?this._intersectSegments(t,e,!0):this._intersectRects.apply(this,arguments)}static intersectLines(t,e,r,n){let m,s;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){m=[{x:0,y:e},{x:1,y:t+e}],s=[{x:0,y:n},{x:1,y:r+n}]}else m=t,s=e;return this._intersectSegments(m,s,!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(s(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],m=t[1],s=e[0],a=e[1],o=Math.min(n.x,m.x),i=Math.min(n.y,m.y),c=Math.max(n.x,m.x),f=c-o,u=Math.max(n.y,m.y),l=u-i,h=Math.min(s.x,a.x),y=Math.min(s.y,a.y),x=Math.max(s.x,a.x),g=x-h,M=Math.max(s.y,a.y),p=M-y;if(0===f&&0===g)return null;if(0===l&&0===p)return null;const d=t=>t.x<h||t.x>x||t.x<o||t.x>c,b=t=>t.y<y||t.y>M||t.y<i||t.y>u;var w=null;if(0===f){if(r&&(h>o||x<c))return null;const t=this.mq(s,a);w=this.cramer([1,0,-o],[t[0],-1,t[1]]),r&&b(w)&&(w=null)}else if(0===g){if(r&&(o>h||c<x))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[1,0,-h]),r&&b(w)&&(w=null)}else if(0===l){if(r&&(y>i||M<u))return null;const t=this.mq(s,a);w=this.cramer([0,1,-i],[t[0],-1,t[1]]),r&&d(w)&&(w=null)}else if(0===p){if(r&&(i>y||u<M))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[0,1,-y]),r&&d(w)&&(w=null)}else{let t;if(!r||(t=this._intersectRects({x:o,y:i,width:f,height:l},{x:h,y:y,width:g,height:p}))&&t.width>0&&t.height>0){const e=this.mq(n,m),o=this.mq(s,a),i=e[0],c=o[0],f=e[1],u=o[1];if(i!==c){let e=(w=this.cramer([i,-1,f],[c,-1,u])).x,n=w.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(w=null)}}}return null===w?null:{x:w.x,y:w.y}}static _intersectRects(...e){return t.Rect.intersect.apply(this,e)}static dot(t,e){return m.dot(t,e)}static cross(t,e){return m.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&s(n[0])&&s(n[1]))return t.Point.distance(e[0],e[1]);if(s(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 inLine(t,e){const r=m.from(e[0],t),n=m.from(t,e[1]);return this.cross(r,n).isCloseTo(0)}static inSegment(t,e){const r=Math.min(e[0].x,e[1].x),n=Math.max(e[0].x,e[1].x),m=Math.min(e[0].y,e[1].y),s=Math.max(e[0].y,e[1].y);return t.x>=r&&t.x<=n&&t.y>=m&&t.y<=s&&this.inLine(t,e)}static inTriangle(e,r){let n;for(let m=0;m<3;m++){const s=r[m],a=r[(m+1)%3],o=t.Point.subtract(a,e),i=t.Point.subtract(s,e),c=this.cross(o,i);if(m>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e,r){if(!(e?.length>=3))throw"Not enough vertices";const n=e.length;if(3===n)return this.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 m=Number.MAX_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,o=Number.MIN_VALUE;for(let t=0;t<n;t++){const r=e[t];m=Math.min(m,r.x),s=Math.min(s,r.y),a=Math.max(a,r.x),o=Math.max(o,r.y)}if(t.x<m||t.x>a||t.y<s||t.y>o)return!1;const i=[{x:m-1,y:t.y},t];let c=0;for(let r=0;r<n;r++){const m=e[r],s=e[(r+1)%n],a=[m,s];if(m.y===t.y){const a=e[(r-1+n)%n];t.x>m.x&&(a.y-t.y)*(s.y-t.y)<0&&c++}else{if(s.y===t.y)continue;null!=this.intersect(a,i)&&c++}}return c%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const m=r.length;if(m>=3){for(let t=0;t<r.length;t++){const{x:e,y:s}=r[t],a=t===m-1?0:t+1,{x:o,y:i}=r[a];n+=e*i-s*o}n*=.5}return Math.abs(n.roundoff())}}}(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 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 magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}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 m=Vector3D.unit(t),s=Vector3D.unit(e);if(Vector3D.dot(m,s)<0){const t={x:-m.x-s.x,y:-m.y-s.y,z:-m.z-s.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:m.x-s.x,y:m.y-s.y,z:m.z-s.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;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 perspective(t,e,r=.1,n=1){const m=Math.tan(.5*Math.PI-.5*t),s=m/e,a=Number.isFinite(n),o=a?n/(r-n):-1,i=a?n*r/(r-n):-r;return Matrix3D.from(s,0,0,0,0,m,0,0,0,0,o,-1,0,0,i,0)}static orthographic(t,e,r,n,m,s){return Matrix3D.from(2/(e-t),0,0,0,0,2/(r-n),0,0,0,0,1/(m-s),0,(t+e)/(t-e),(r+n)/(n-r),m/(m-s),1)}static lookAt(t,r,n){const m=Vector3D.subtract(r,t);Vector3D.normalize(m);const s=Vector3D.cross(n,m);Vector3D.normalize(s);const a=Vector3D.cross(m,s);Vector3D.normalize(a);const o=-e.Vector.dot(s,t),i=-e.Vector.dot(a,t),c=-e.Vector.dot(m,t);return Matrix3D.from(s.x,a.x,m.x,0,s.y,a.y,m.y,0,s.z,a.z,m.z,0,o,i,c,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){return Matrix3D.from.apply(null,Matrix3D.toArray(t))}static scale(t,e,r=e,n=e){return Matrix3D.from(t.m11*e,t.m12,t.m13,t.m14,t.m21,t.m22*r,t.m23,t.m24,t.m31,t.m32,t.m33*n,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44)}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,m=t.m23*t.m34-t.m33*t.m24,s=t.m23*t.m44-t.offsetZ*t.m24,a=t.m33*t.m44-t.offsetZ*t.m34,o=t.m22*r-t.m32*e-t.m12*m,i=t.m12*s-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*a,f=t.m22*a-t.m32*s+t.offsetY*m;return t.offsetX*o+t.m31*i+t.m21*c+t.m11*f}}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)}static invert(t){if(Matrix3D.isAffine(t)){const e=t.m12*t.m23-t.m22*t.m13,r=t.m32*t.m13-t.m12*t.m33,n=t.m22*t.m33-t.m32*t.m23,m=Matrix3D.determinant(t);if(0==m)return null;const s=t.m21*t.m13-t.m11*t.m23,a=t.m11*t.m33-t.m31*t.m13,o=t.m31*t.m23-t.m21*t.m33,i=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,f=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,l=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*f-t.offsetZ*i-t.m13*l,x=t.m13*h-t.m33*f+t.offsetZ*c,g=t.m33*l-t.offsetZ*u-t.m23*h,M=i,p=-c,d=u,b=1/m;return Matrix3D.from(n*b,r*b,e*b,0,o*b,a*b,s*b,0,d*b,p*b,M*b,0,g*b,x*b,y*b,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,m=t.m31*t.m44-t.m34*t.offsetX,s=t.m32*t.offsetZ-t.m33*t.offsetY,a=t.m31*t.offsetZ-t.m33*t.offsetX,o=t.m31*t.offsetY-t.m32*t.offsetX,i=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,f=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,l=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,M=t.m22*t.offsetZ-t.m23*t.offsetY,p=t.m21*t.offsetZ-t.m23*t.offsetX,d=t.m21*t.offsetY-t.m22*t.offsetX,b=t.m23*t.m34-t.m24*t.m33,w=t.m22*t.m34-t.m24*t.m32,z=t.m21*t.m34-t.m24*t.m31,A=t.m22*t.m33-t.m23*t.m32,v=t.m21*t.m33-t.m23*t.m31,D=t.m21*t.m32-t.m22*t.m31,N=t.m22*r-t.m23*n+t.m24*s,P=-(t.m21*r-t.m23*m+t.m24*a),V=t.m21*n-t.m22*m+t.m24*o,C=-(t.m21*s-t.m22*a+t.m23*o),X=-(t.m12*i-t.m13*c+t.m14*u),q=t.m11*i-t.m13*f+t.m14*l,Y=-(t.m11*c-t.m12*f+t.m14*h),Z=t.m11*u-t.m12*l+t.m13*h,I=t.m12*y-t.m13*x+t.m14*M,L=-(t.m11*y-t.m13*g+t.m14*p),E=t.m11*x-t.m12*g+t.m14*d,U=-(t.m11*M-t.m12*p+t.m13*d),S=-(t.m12*b-t.m13*w+t.m14*A),_=t.m11*b-t.m13*z+t.m14*v,Q=-(t.m11*w-t.m12*z+t.m14*D),R=t.m11*A-t.m12*v+t.m13*D,j=1/e;return Matrix3D.from(N*j,X*j,I*j,S*j,P*j,q*j,L*j,_*j,V*j,Y*j,E*j,Q*j,C*j,Z*j,U*j,R*j)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,m=r.y,s=r.z;if(r.x=n*e.m11+m*e.m21+s*e.m31+e.offsetX,r.y=n*e.m12+m*e.m22+s*e.m32+e.offsetY,r.z=n*e.m13+m*e.m23+s*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var a=n*e.m14+m*e.m24+s*e.m34+e.m44;0!=a&&(r.x/=a,r.y/=a,r.z/=a)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{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 fromAxisAngle(t,e){var r=n*(e%=360),m=Vector3D.mag(t);if(0==m)throw new RangeError("Invalid argument");var s=Math.sin(.5*r)/m,a=t.x*s,o=t.y*s,i=t.z*s;return Quaternion.from(a,o,i,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,m=(t.m23-t.m32)*r,s=(t.m31-t.m13)*r,a=(t.m12-t.m21)*r;return Quaternion.from(m,s,a,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,m=(t.m12+t.m21)*e,s=(t.m31+t.m13)*e;return Quaternion.from(n,m,s,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,m=(t.m12+t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(m,n,r,s)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,m=(t.m12-t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(s,r,n,m)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,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 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))),m=t.x/n,s=t.y/n,a=t.z/n;e=Math.sqrt(m*m+s*s+a*a),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,m=t.z,s=t.w;return e.m11=1-2*n*n-2*m*m,e.m12=2*r*n+2*s*m,e.m13=2*r*m-2*s*n,e.m21=2*r*n-2*s*m,e.m22=1-2*r*r-2*m*m,e.m23=2*n*m+2*s*r,e.m31=2*s*n+2*r*m,e.m32=2*n*m-2*s*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=1/Quaternion.norm(t),r=Quaternion.conjugate(t);return r.x*=e,r.y*=e,r.z*=e,r.w*=e,r}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){class Polygon{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){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=Number.MIN_VALUE,m=Number.MIN_VALUE;const{vertices:s}=t;s.length;for(let t of s)e=Math.min(e,t.x),r=Math.min(r,t.y),n=Math.max(n,t.x),m=Math.max(m,t.y);return{x:e,y:r,width:n-e,height:m-r}}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],m=e[t-1];r.push([m,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let m=0;for(let e=0;e<r.length;e++){const s=r[(e-1+n)%n],a=r[e],o=r[(e+1)%n],i=t.Angle.angleBetween(a,s,o);if(0!==m){if(m!=Math.sign(i))return!1}else m=Math.sign(i)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const m=Polygon.sides(r);for(let r of m)for(let n of m){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const m=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(m))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,m]}=e;return t.Angle.angleBetween(n,r,m)>0}static expand(r,n){const{vertices:m}=r,s=m.length,a=[];for(let r=0;r<m.length;r++){const o=m[(r-1+s)%s],i=m[r],c=m[(r+1)%s],f=t.Angle.angleBetween(i,o,c),u=-n/Math.sin(Math.abs(f)/2),l=t.Matrix2D.scale(t.Matrix2D.identity,u),h=t.Point.subtract(i,o);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(i,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,l);a.push(t.Point.add(i,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:a}}static area(t){return e.Utils.area(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 m(){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?m():n(t,e||0))}static add(t,r){const m=e(t),s=e(r);return n(m.real+s.real,m.img+s.img)}static subtract(t,r){const m=e(t),s=e(r);return n(m.real-s.real,m.img-s.img)}static multiply(t,r){const m=e(t),s=e(r);return n(m.real*s.real-m.img*s.img,m.real*s.img+m.img*s.real)}static divide(t,r){const s=e(t),a=e(r),o=this.absSquare(a).roundoff();if(0===o)return m();const i=1/o;return n(i*(s.real*a.real+s.img*a.img),i*(s.img*a.real-s.real*a.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 m()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const m=r[n]=r[n]||{};return m[e]=m[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function m(e){const r=[],s=e.length;if(1===s)return[t.Complex.build(e[0])];const a=m(e.filter(((t,e)=>e%2==0))),o=m(e.filter(((t,e)=>e%2==1)));for(var i=0;i<s/2;i++){const e=a[i],m=t.Complex.multiply(n(i,s),o[i]);r[i]=t.Complex.add(e,m),r[i+s/2]=t.Complex.subtract(e,m)}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 m=(e||[])?.length,s=r?1/Math.sqrt(m):1,a=[];for(let r=0;r<m;r++){a.push({real:0,img:0});for(let o=0;o<m;o++){const i=n(r*o,m),c=t.Complex.multiply(e[o],i),f=t.Complex.multiply(c,s);a[r]=t.Complex.add(a[r],f)}}return a}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=m(e);if(!r)return n;const s=1/Math.sqrt(e.length);return n.map((e=>t.Complex.multiply(e,s)))}}}(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){let e,r,n;return r=Math.abs(t),e=1/(1+.5*r),n=e*Math.exp(-r*r-1.26551223+e*(1.00002368+e*(.37409196+e*(.09678418+e*(e*(.27886807+e*(e*(1.48851587+e*(.17087277*e-.82215223))-1.13520398))-.18628806))))),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}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return Math.exp(-.5*Math.pow(this._z(t),2))/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 Lagrangian{constructor(...t){this.#t=Array.from(t)||[]}#t;#e;_unsafeCreate(){const t=this.#t||[];let e,r="var ljs = [];\n";for(let n=0;n<t.length;n++){const m=t[n],s=m.x;if(null!=e&&e>=s)throw new Error("Invalid function provided.");e=s,r+=`ljs.push( ${m.y}`;for(let e=0;e<t.length;e++)if(e!==n){const n=t[e];r+=` * ((x - ${n.x})/${s-n.x})`}r+=");\n"}r+="return ljs.reduce((prev, next) => prev + next, 0);",this.#e=new Function("x",r)}_compute(t){const e=this.#t||[];let r;const n=[];for(let m=0;m<e.length;m++){const s=e[m].x;if(null!=r&&r>=s)throw new Error("Invalid function provided.");r=s;let a=e[m].y;for(let r=0;r<e.length;r++)if(r!==m){const n=e[r];a*=(t-n.x)/(s-n.x)}n.push(a)}return n.reduce(((t,e)=>t+e),0)}interpolate(t){return"function"==typeof this.#e?this.#e.apply(null,[t]):this._compute(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)),r=new(Function.prototype.bind.apply(Lagrangian,[null].concat(e)));try{r._unsafeCreate()}catch(t){}return r}}t.Lagrangian=Lagrangian}(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 m=Math.round(e[0]);for(let t=1;t<e.length;t++)m=n(m,Math.round(e[t]));return m}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 m=Utils.rebaseFloat10ToN,s=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):m(e,r,n)}if(10===r)return s(t.toString(),e,n);return m(s(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,m=12){const s=r;if(e<=1||e>s.length)throw new Error(n);const a=(t??"0").toString().toLowerCase(),o=Number.NaN;if("0"===a)return 0;const i=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(a);if(i.length<2)return o;const c="-"===i[1]?-1:1,f=i[2]||"0",u=i[3]||".0";let l=0,h=0;for(let t of f+u.substr(1)){const r=s.indexOf(t);if(-1===r||r>=e)return o;l+=r*Math.pow(e,f.length-h-1),h++}return c*l}static rebaseFloat10ToNIntBase(t,e,m=12){const s=r;if(e<=1||e>36)throw new Error(n);const a=e;let o=Math.abs(t??0);if(0===o||Number.isNaN(o))return t.toString();let i=(o%1).roundoff(),c="";for(;;){let t=o/a,e=Math.floor(t),r=(o-e*a).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:s[n]+c,e<=0)break;o=e}if(c=c.replace(/^0+/,""),c||="0",0===i)return c;let f="";do{o=(i*a).roundoff();const t=Math.floor(o),e=(o-t).roundoff();t>=36?f=`[${t}]`:f+=s[t],i=e}while(!i.isCloseTo(0)&&f.length<m);return/^0*$/.test(f)?c:(Math.sign(t)<0?"-":"")+c+"."+f.replace(/0+$/,"")}static rebaseFloat10ToN(e,m,s=12){const a=r;if(m<=1||m>a.length)throw new Error(n);const o=m;let i=Math.abs(e??0);if(0===i||Number.isNaN(i))return e.toString();let c=Math.sign(e)<0?"-":"",f=[],u=[];for(let t=0;t<20;t++)f.push("0"),u.push("0");const l=o%1==0?o:Math.ceil(o);function h(t,e,r){const n=t?f:u,m=n[e]=n[e]||"0",s=a.indexOf(m)+r,o=s%l,i=Math.floor(s/l);return n[e]=a[o],i>0&&(t?h(t,e+1,i):0===e?h(!0,0,i):h(!1,e-1,i)),i}let y=0;for(;;){const e=Math.floor(t.Numbers.log(i,o)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),i=(i-Math.pow(o,e).roundoff()).roundoff(),r||y++,0===i||y>=100){const t=c+(f.reverse().map((t=>t||"0")).join("").replace(/^0+/,"")||"0"),e=u.map((t=>t||"0")).join("").substr(0,s).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 m(t,r=e,m=!1){const s=n(t,r);return t.reduce(((t,e)=>Math.pow(e-s,2)+t),0)/(t.length-(m?1:0))}function s(t,r=e,n=!1){const s=m(t,r,n);return Math.sqrt(s)}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),m=n.length;n.sort(((t,e)=>r(t)-r(e)));const s=Math.ceil(n.length/2)-1;return m%2==1?n[s]:.5*(n[s+1]+n[s])}(t,r)}static mode(t,r){return function(t,r=e){const n=Object.groupBy(t,r);let m,s=0;for(let t in n){const e=n[t].length;e>s&&(m=parseInt(t),s=e)}return m}(t,r)}static var(t,e){return m(t,e,!0)}static varp(t,e){return m(t,e,!1)}static stdevp(t,e){return s(t,e,!1)}static stdev(t,e){return s(t,e,!0)}static correlation(t,r,m,s){return function(t,r,m=e,s=e){const a=Array.isArray(r);if(a&&r.length!==t.length)throw new Error("Sets must be of the same length.");const o=t.length,i=t,c=a?r:t,f=a?m:r,u=a?s:m,l=n(i,f),h=n(c,u);let y=0,x=0,g=0;for(let t=0;t<o;t++){const e=i[t],r=c[t],n=f(e,t)-l,m=u(r,t)-h;y+=n*m,x+=n*n,g+=m*m}return y/Math.sqrt(x*g)}(t,r,m,s)}static linearRegression(t,r,n,m){return function(t,r,n=e,m=e){const s=Array.isArray(r);if(s&&r.length!==t.length)throw new Error("Sets must be of the same length.");const a=t,o=s?r:t,i=s?n:r,c=i??(t=>t.x),f=(s?m:i)??(t=>t.y),u=t.length;let l=0,h=0,y=0,x=0,g=0;for(let t=0;t<u;t++){const e=a[t],r=o[t],n=c(e,t),m=f(r,t);l+=n*m,h+=n,y+=m,x+=n*n,g+=m*m}const M=(u*l-h*y)/(u*x-Math.pow(h,2));return[M,(y-M*h)/u]}(t,r,n,m)}static gaussian(e,r){return new t.Gaussian(e,r)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
6
+ 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}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,m=e.LinearAlgebra.Vector;function s(e){return t.Point.isPoint(e)}e.Utils=class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+this.slopeRad(t,e))%n}static slopeDeg(t,e){return this.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+this.slopeDeg(t,e))%360}static intersect(t,e,...r){return Array.isArray(t)&&Array.isArray(e)?this._intersectSegments(t,e,!0):this._intersectRects.apply(this,arguments)}static intersectLines(t,e,r,n){let m,s;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){m=[{x:0,y:e},{x:1,y:t+e}],s=[{x:0,y:n},{x:1,y:r+n}]}else m=t,s=e;return this._intersectSegments(m,s,!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(s(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],m=t[1],s=e[0],a=e[1],o=Math.min(n.x,m.x),i=Math.min(n.y,m.y),c=Math.max(n.x,m.x),f=c-o,u=Math.max(n.y,m.y),l=u-i,h=Math.min(s.x,a.x),y=Math.min(s.y,a.y),x=Math.max(s.x,a.x),g=x-h,M=Math.max(s.y,a.y),d=M-y;if(0===f&&0===g)return null;if(0===l&&0===d)return null;const p=t=>t.x<h||t.x>x||t.x<o||t.x>c,b=t=>t.y<y||t.y>M||t.y<i||t.y>u;var w=null;if(0===f){if(r&&(h>o||x<c))return null;const t=this.mq(s,a);w=this.cramer([1,0,-o],[t[0],-1,t[1]]),r&&b(w)&&(w=null)}else if(0===g){if(r&&(o>h||c<x))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[1,0,-h]),r&&b(w)&&(w=null)}else if(0===l){if(r&&(y>i||M<u))return null;const t=this.mq(s,a);w=this.cramer([0,1,-i],[t[0],-1,t[1]]),r&&p(w)&&(w=null)}else if(0===d){if(r&&(i>y||u<M))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[0,1,-y]),r&&p(w)&&(w=null)}else{let t;if(!r||(t=this._intersectRects({x:o,y:i,width:f,height:l},{x:h,y:y,width:g,height:d}))&&t.width>0&&t.height>0){const e=this.mq(n,m),o=this.mq(s,a),i=e[0],c=o[0],f=e[1],u=o[1];if(i!==c){let e=(w=this.cramer([i,-1,f],[c,-1,u])).x,n=w.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(w=null)}}}return null===w?null:{x:w.x,y:w.y}}static _intersectRects(...e){return t.Rect.intersect.apply(this,e)}static dot(t,e){return m.dot(t,e)}static cross(t,e){return m.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&s(n[0])&&s(n[1]))return t.Point.distance(e[0],e[1]);if(s(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 inLine(t,e){const r=m.from(e[0],t),n=m.from(t,e[1]);return this.cross(r,n).isCloseTo(0)}static inSegment(t,e){const r=Math.min(e[0].x,e[1].x),n=Math.max(e[0].x,e[1].x),m=Math.min(e[0].y,e[1].y),s=Math.max(e[0].y,e[1].y);return t.x>=r&&t.x<=n&&t.y>=m&&t.y<=s&&this.inLine(t,e)}static inTriangle(e,r){let n;for(let m=0;m<3;m++){const s=r[m],a=r[(m+1)%3],o=t.Point.subtract(a,e),i=t.Point.subtract(s,e),c=this.cross(o,i);if(m>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e,r){if(!(e?.length>=3))throw"Not enough vertices";const n=e.length;if(3===n)return this.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 m=Number.MAX_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,o=Number.MIN_VALUE;for(let t=0;t<n;t++){const r=e[t];m=Math.min(m,r.x),s=Math.min(s,r.y),a=Math.max(a,r.x),o=Math.max(o,r.y)}if(t.x<m||t.x>a||t.y<s||t.y>o)return!1;const i=[{x:m-1,y:t.y},t];let c=0;for(let r=0;r<n;r++){const m=e[r],s=e[(r+1)%n],a=[m,s];if(m.y===t.y){const a=e[(r-1+n)%n];t.x>m.x&&(a.y-t.y)*(s.y-t.y)<0&&c++}else{if(s.y===t.y)continue;null!=this.intersect(a,i)&&c++}}return c%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const m=r.length;if(m>=3){for(let t=0;t<r.length;t++){const{x:e,y:s}=r[t],a=t===m-1?0:t+1,{x:o,y:i}=r[a];n+=e*i-s*o}n*=.5}return Math.abs(n.roundoff())}}}(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 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 magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}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 m=Vector3D.unit(t),s=Vector3D.unit(e);if(Vector3D.dot(m,s)<0){const t={x:-m.x-s.x,y:-m.y-s.y,z:-m.z-s.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:m.x-s.x,y:m.y-s.y,z:m.z-s.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Matrix3DModifier{static modify(t,e){const{m11:r,m12:n,m13:m,m14:s,m21:a,m22:o,m23:i,m24:c,m31:f,m32:u,m33:l,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:M}=t,d={m11:r,m12:n,m13:m,m14:s,m21:a,m22:o,m23:i,m24:c,m31:f,m32:u,m33:l,m34:h,offsetX:y,offsetY:x,offsetZ:g,m44:M};return e(d),d}static clone(t){return Matrix3DModifier.modify(t,(t=>{}))}}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 perspective(t,e,r=.1,n=1){const m=Math.tan(.5*Math.PI-.5*t),s=m/e,a=Number.isFinite(n),o=a?n/(r-n):-1,i=a?n*r/(r-n):-r;return Matrix3D.from(s,0,0,0,0,m,0,0,0,0,o,-1,0,0,i,0)}static orthographic(t,e,r,n,m,s){return Matrix3D.from(2/(e-t),0,0,0,0,2/(r-n),0,0,0,0,1/(m-s),0,(t+e)/(t-e),(r+n)/(n-r),m/(m-s),1)}static lookAt(t,r,n){const m=Vector3D.subtract(r,t);Vector3D.normalize(m);const s=Vector3D.cross(n,m);Vector3D.normalize(s);const a=Vector3D.cross(m,s);Vector3D.normalize(a);const o=-e.Vector.dot(s,t),i=-e.Vector.dot(a,t),c=-e.Vector.dot(m,t);return Matrix3D.from(s.x,a.x,m.x,0,s.y,a.y,m.y,0,s.z,a.z,m.z,0,o,i,c,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){return Matrix3DModifier.clone(t)}static scale(t,e,r=e,n=e){return Matrix3DModifier.modify(t,(t=>{t.m11*=e,t.m22*=r,t.m33*=n}))}static translate(t,e){return Matrix3DModifier.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,m=t.m23*t.m34-t.m33*t.m24,s=t.m23*t.m44-t.offsetZ*t.m24,a=t.m33*t.m44-t.offsetZ*t.m34,o=t.m22*r-t.m32*e-t.m12*m,i=t.m12*s-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*a,f=t.m22*a-t.m32*s+t.offsetY*m;return t.offsetX*o+t.m31*i+t.m21*c+t.m11*f}}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)}static invert(t){if(Matrix3D.isAffine(t)){const e=t.m12*t.m23-t.m22*t.m13,r=t.m32*t.m13-t.m12*t.m33,n=t.m22*t.m33-t.m32*t.m23,m=Matrix3D.determinant(t);if(0==m)return null;const s=t.m21*t.m13-t.m11*t.m23,a=t.m11*t.m33-t.m31*t.m13,o=t.m31*t.m23-t.m21*t.m33,i=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,f=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,l=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*f-t.offsetZ*i-t.m13*l,x=t.m13*h-t.m33*f+t.offsetZ*c,g=t.m33*l-t.offsetZ*u-t.m23*h,M=i,d=-c,p=u,b=1/m;return Matrix3D.from(n*b,r*b,e*b,0,o*b,a*b,s*b,0,p*b,d*b,M*b,0,g*b,x*b,y*b,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,m=t.m31*t.m44-t.m34*t.offsetX,s=t.m32*t.offsetZ-t.m33*t.offsetY,a=t.m31*t.offsetZ-t.m33*t.offsetX,o=t.m31*t.offsetY-t.m32*t.offsetX,i=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,f=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,l=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,M=t.m22*t.offsetZ-t.m23*t.offsetY,d=t.m21*t.offsetZ-t.m23*t.offsetX,p=t.m21*t.offsetY-t.m22*t.offsetX,b=t.m23*t.m34-t.m24*t.m33,w=t.m22*t.m34-t.m24*t.m32,z=t.m21*t.m34-t.m24*t.m31,A=t.m22*t.m33-t.m23*t.m32,v=t.m21*t.m33-t.m23*t.m31,D=t.m21*t.m32-t.m22*t.m31,N=t.m22*r-t.m23*n+t.m24*s,P=-(t.m21*r-t.m23*m+t.m24*a),V=t.m21*n-t.m22*m+t.m24*o,X=-(t.m21*s-t.m22*a+t.m23*o),C=-(t.m12*i-t.m13*c+t.m14*u),Y=t.m11*i-t.m13*f+t.m14*l,Z=-(t.m11*c-t.m12*f+t.m14*h),q=t.m11*u-t.m12*l+t.m13*h,I=t.m12*y-t.m13*x+t.m14*M,L=-(t.m11*y-t.m13*g+t.m14*d),E=t.m11*x-t.m12*g+t.m14*p,U=-(t.m11*M-t.m12*d+t.m13*p),S=-(t.m12*b-t.m13*w+t.m14*A),_=t.m11*b-t.m13*z+t.m14*v,Q=-(t.m11*w-t.m12*z+t.m14*D),R=t.m11*A-t.m12*v+t.m13*D,j=1/e;return Matrix3D.from(N*j,C*j,I*j,S*j,P*j,Y*j,L*j,_*j,V*j,Z*j,E*j,Q*j,X*j,q*j,U*j,R*j)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,m=r.y,s=r.z;if(r.x=n*e.m11+m*e.m21+s*e.m31+e.offsetX,r.y=n*e.m12+m*e.m22+s*e.m32+e.offsetY,r.z=n*e.m13+m*e.m23+s*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var a=n*e.m14+m*e.m24+s*e.m34+e.m44;0!=a&&(r.x/=a,r.y/=a,r.z/=a)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{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 fromAxisAngle(t,e){var r=n*(e%=360),m=Vector3D.mag(t);if(0==m)throw new RangeError("Invalid argument");var s=Math.sin(.5*r)/m,a=t.x*s,o=t.y*s,i=t.z*s;return Quaternion.from(a,o,i,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,m=(t.m23-t.m32)*r,s=(t.m31-t.m13)*r,a=(t.m12-t.m21)*r;return Quaternion.from(m,s,a,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,m=(t.m12+t.m21)*e,s=(t.m31+t.m13)*e;return Quaternion.from(n,m,s,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,m=(t.m12+t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(m,n,r,s)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,m=(t.m12-t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(s,r,n,m)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,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 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))),m=t.x/n,s=t.y/n,a=t.z/n;e=Math.sqrt(m*m+s*s+a*a),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,m=t.z,s=t.w;return e.m11=1-2*n*n-2*m*m,e.m12=2*r*n+2*s*m,e.m13=2*r*m-2*s*n,e.m21=2*r*n-2*s*m,e.m22=1-2*r*r-2*m*m,e.m23=2*n*m+2*s*r,e.m31=2*s*n+2*r*m,e.m32=2*n*m-2*s*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=1/Quaternion.norm(t),r=Quaternion.conjugate(t);return r.x*=e,r.y*=e,r.z*=e,r.w*=e,r}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){class Polygon{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){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=Number.MIN_VALUE,m=Number.MIN_VALUE;const{vertices:s}=t;s.length;for(let t of s)e=Math.min(e,t.x),r=Math.min(r,t.y),n=Math.max(n,t.x),m=Math.max(m,t.y);return{x:e,y:r,width:n-e,height:m-r}}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],m=e[t-1];r.push([m,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let m=0;for(let e=0;e<r.length;e++){const s=r[(e-1+n)%n],a=r[e],o=r[(e+1)%n],i=t.Angle.angleBetween(a,s,o);if(0!==m){if(m!=Math.sign(i))return!1}else m=Math.sign(i)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const m=Polygon.sides(r);for(let r of m)for(let n of m){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const m=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(m))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,m]}=e;return t.Angle.angleBetween(n,r,m)>0}static expand(r,n){const{vertices:m}=r,s=m.length,a=[];for(let r=0;r<m.length;r++){const o=m[(r-1+s)%s],i=m[r],c=m[(r+1)%s],f=t.Angle.angleBetween(i,o,c),u=-n/Math.sin(Math.abs(f)/2),l=t.Matrix2D.scale(t.Matrix2D.identity,u),h=t.Point.subtract(i,o);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(i,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,l);a.push(t.Point.add(i,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:a}}static area(t){return e.Utils.area(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 m(){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?m():n(t,e||0))}static add(t,r){const m=e(t),s=e(r);return n(m.real+s.real,m.img+s.img)}static subtract(t,r){const m=e(t),s=e(r);return n(m.real-s.real,m.img-s.img)}static multiply(t,r){const m=e(t),s=e(r);return n(m.real*s.real-m.img*s.img,m.real*s.img+m.img*s.real)}static divide(t,r){const s=e(t),a=e(r),o=this.absSquare(a).roundoff();if(0===o)return m();const i=1/o;return n(i*(s.real*a.real+s.img*a.img),i*(s.img*a.real-s.real*a.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 m()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const m=r[n]=r[n]||{};return m[e]=m[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function m(e){const r=[],s=e.length;if(1===s)return[t.Complex.build(e[0])];const a=m(e.filter(((t,e)=>e%2==0))),o=m(e.filter(((t,e)=>e%2==1)));for(var i=0;i<s/2;i++){const e=a[i],m=t.Complex.multiply(n(i,s),o[i]);r[i]=t.Complex.add(e,m),r[i+s/2]=t.Complex.subtract(e,m)}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 m=(e||[])?.length,s=r?1/Math.sqrt(m):1,a=[];for(let r=0;r<m;r++){a.push({real:0,img:0});for(let o=0;o<m;o++){const i=n(r*o,m),c=t.Complex.multiply(e[o],i),f=t.Complex.multiply(c,s);a[r]=t.Complex.add(a[r],f)}}return a}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=m(e);if(!r)return n;const s=1/Math.sqrt(e.length);return n.map((e=>t.Complex.multiply(e,s)))}}}(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){let e,r,n;return r=Math.abs(t),e=1/(1+.5*r),n=e*Math.exp(-r*r-1.26551223+e*(1.00002368+e*(.37409196+e*(.09678418+e*(e*(.27886807+e*(e*(1.48851587+e*(.17087277*e-.82215223))-1.13520398))-.18628806))))),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}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return Math.exp(-.5*Math.pow(this._z(t),2))/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 Lagrangian{constructor(...t){this.#t=Array.from(t)||[]}#t;#e;_unsafeCreate(){const t=this.#t||[];let e,r="var ljs = [];\n";for(let n=0;n<t.length;n++){const m=t[n],s=m.x;if(null!=e&&e>=s)throw new Error("Invalid function provided.");e=s,r+=`ljs.push( ${m.y}`;for(let e=0;e<t.length;e++)if(e!==n){const n=t[e];r+=` * ((x - ${n.x})/${s-n.x})`}r+=");\n"}r+="return ljs.reduce((prev, next) => prev + next, 0);",this.#e=new Function("x",r)}_compute(t){const e=this.#t||[];let r;const n=[];for(let m=0;m<e.length;m++){const s=e[m].x;if(null!=r&&r>=s)throw new Error("Invalid function provided.");r=s;let a=e[m].y;for(let r=0;r<e.length;r++)if(r!==m){const n=e[r];a*=(t-n.x)/(s-n.x)}n.push(a)}return n.reduce(((t,e)=>t+e),0)}interpolate(t){return"function"==typeof this.#e?this.#e.apply(null,[t]):this._compute(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)),r=new(Function.prototype.bind.apply(Lagrangian,[null].concat(e)));try{r._unsafeCreate()}catch(t){}return r}}t.Lagrangian=Lagrangian}(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 m=Math.round(e[0]);for(let t=1;t<e.length;t++)m=n(m,Math.round(e[t]));return m}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 m=Utils.rebaseFloat10ToN,s=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):m(e,r,n)}if(10===r)return s(t.toString(),e,n);return m(s(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,m=12){const s=r;if(e<=1||e>s.length)throw new Error(n);const a=(t??"0").toString().toLowerCase(),o=Number.NaN;if("0"===a)return 0;const i=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(a);if(i.length<2)return o;const c="-"===i[1]?-1:1,f=i[2]||"0",u=i[3]||".0";let l=0,h=0;for(let t of f+u.substr(1)){const r=s.indexOf(t);if(-1===r||r>=e)return o;l+=r*Math.pow(e,f.length-h-1),h++}return c*l}static rebaseFloat10ToNIntBase(t,e,m=12){const s=r;if(e<=1||e>36)throw new Error(n);const a=e;let o=Math.abs(t??0);if(0===o||Number.isNaN(o))return t.toString();let i=(o%1).roundoff(),c="";for(;;){let t=o/a,e=Math.floor(t),r=(o-e*a).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:s[n]+c,e<=0)break;o=e}if(c=c.replace(/^0+/,""),c||="0",0===i)return c;let f="";do{o=(i*a).roundoff();const t=Math.floor(o),e=(o-t).roundoff();t>=36?f=`[${t}]`:f+=s[t],i=e}while(!i.isCloseTo(0)&&f.length<m);return/^0*$/.test(f)?c:(Math.sign(t)<0?"-":"")+c+"."+f.replace(/0+$/,"")}static rebaseFloat10ToN(e,m,s=12){const a=r;if(m<=1||m>a.length)throw new Error(n);const o=m;let i=Math.abs(e??0);if(0===i||Number.isNaN(i))return e.toString();let c=Math.sign(e)<0?"-":"",f=[],u=[];for(let t=0;t<20;t++)f.push("0"),u.push("0");const l=o%1==0?o:Math.ceil(o);function h(t,e,r){const n=t?f:u,m=n[e]=n[e]||"0",s=a.indexOf(m)+r,o=s%l,i=Math.floor(s/l);return n[e]=a[o],i>0&&(t?h(t,e+1,i):0===e?h(!0,0,i):h(!1,e-1,i)),i}let y=0;for(;;){const e=Math.floor(t.Numbers.log(i,o)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),i=(i-Math.pow(o,e).roundoff()).roundoff(),r||y++,0===i||y>=100){const t=c+(f.reverse().map((t=>t||"0")).join("").replace(/^0+/,"")||"0"),e=u.map((t=>t||"0")).join("").substr(0,s).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 m(t,r=e,m=!1){const s=n(t,r);return t.reduce(((t,e)=>Math.pow(e-s,2)+t),0)/(t.length-(m?1:0))}function s(t,r=e,n=!1){const s=m(t,r,n);return Math.sqrt(s)}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),m=n.length;n.sort(((t,e)=>r(t)-r(e)));const s=Math.ceil(n.length/2)-1;return m%2==1?n[s]:.5*(n[s+1]+n[s])}(t,r)}static mode(t,r){return function(t,r=e){const n=Object.groupBy(t,r);let m,s=0;for(let t in n){const e=n[t].length;e>s&&(m=parseInt(t),s=e)}return m}(t,r)}static var(t,e){return m(t,e,!0)}static varp(t,e){return m(t,e,!1)}static stdevp(t,e){return s(t,e,!1)}static stdev(t,e){return s(t,e,!0)}static correlation(t,r,m,s){return function(t,r,m=e,s=e){const a=Array.isArray(r);if(a&&r.length!==t.length)throw new Error("Sets must be of the same length.");const o=t.length,i=t,c=a?r:t,f=a?m:r,u=a?s:m,l=n(i,f),h=n(c,u);let y=0,x=0,g=0;for(let t=0;t<o;t++){const e=i[t],r=c[t],n=f(e,t)-l,m=u(r,t)-h;y+=n*m,x+=n*n,g+=m*m}return y/Math.sqrt(x*g)}(t,r,m,s)}static linearRegression(t,r,n,m){return function(t,r,n=e,m=e){const s=Array.isArray(r);if(s&&r.length!==t.length)throw new Error("Sets must be of the same length.");const a=t,o=s?r:t,i=s?n:r,c=i??(t=>t.x),f=(s?m:i)??(t=>t.y),u=t.length;let l=0,h=0,y=0,x=0,g=0;for(let t=0;t<u;t++){const e=a[t],r=o[t],n=c(e,t),m=f(r,t);l+=n*m,h+=n,y+=m,x+=n*n,g+=m*m}const M=(u*l-h*y)/(u*x-Math.pow(h,2));return[M,(y-M*h)/u]}(t,r,n,m)}static gaussian(e,r){return new t.Gaussian(e,r)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.51.0 (https://js.pacem.it)
2
+ * pacem v0.51.1-akkad (https://js.pacem.it)
3
3
  * Copyright 2024 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.51.0",
2
+ "version": "0.51.1-akkad",
3
3
  "name": "pacem",
4
4
  "homepage": "https://js.pacem.it",
5
5
  "repository": {