pimath 0.0.125 → 0.0.127

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 (84) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +5 -5
  2. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30_[Default_Changelist]/shelved.patch +192 -192
  3. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_10_43_[Default_Changelist]/shelved.patch +2404 -2404
  4. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01_[Default_Changelist]/shelved.patch +1362 -1362
  5. package/dev/pimath.js +7945 -0
  6. package/dev/pimath.js.map +1 -0
  7. package/dist/pimath.js +192 -221
  8. package/dist/pimath.js.map +1 -1
  9. package/dist/pimath.min.js +1 -1
  10. package/dist/pimath.min.js.map +1 -1
  11. package/docs/.nojekyll +1 -0
  12. package/docs/assets/highlight.css +78 -0
  13. package/docs/assets/main.js +59 -0
  14. package/docs/assets/navigation.js +1 -0
  15. package/docs/assets/search.js +1 -0
  16. package/docs/assets/style.css +1383 -0
  17. package/docs/classes/Logicalset.Logicalset.html +217 -0
  18. package/docs/classes/Polynom.Rational.html +397 -0
  19. package/docs/classes/Vector-1.Vector.html +490 -0
  20. package/docs/classes/Vector.Point.html +337 -0
  21. package/docs/classes/algebra_equation.Equation.html +790 -0
  22. package/docs/classes/algebra_linearSystem.LinearSystem.html +404 -0
  23. package/docs/classes/algebra_monom.Monom.html +962 -0
  24. package/docs/classes/algebra_polynom.Polynom.html +1275 -0
  25. package/docs/classes/coefficients_fraction.Fraction.html +934 -0
  26. package/docs/classes/geometry_circle.Circle.html +472 -0
  27. package/docs/classes/geometry_line.Line.html +774 -0
  28. package/docs/classes/geometry_triangle.Triangle.html +429 -0
  29. package/docs/classes/numeric.Numeric.html +265 -0
  30. package/docs/classes/shutingyard.Shutingyard.html +250 -0
  31. package/docs/enums/algebra_equation.PARTICULAR_SOLUTION.html +83 -0
  32. package/docs/enums/geometry_line.LinePropriety.html +97 -0
  33. package/docs/enums/shutingyard.ShutingyardMode.html +97 -0
  34. package/docs/enums/shutingyard.ShutingyardType.html +111 -0
  35. package/docs/index.html +63 -0
  36. package/docs/interfaces/algebra_equation.ISolution.html +105 -0
  37. package/docs/interfaces/algebra_polynom.IEuclidian.html +87 -0
  38. package/docs/interfaces/geometry_triangle.remarquableLines.html +163 -0
  39. package/docs/modules/Logicalset.html +65 -0
  40. package/docs/modules/Polynom.html +65 -0
  41. package/docs/modules/Vector-1.html +65 -0
  42. package/docs/modules/Vector.html +65 -0
  43. package/docs/modules/algebra_equation.html +69 -0
  44. package/docs/modules/algebra_linearSystem.html +61 -0
  45. package/docs/modules/algebra_monom.html +65 -0
  46. package/docs/modules/algebra_polynom.html +69 -0
  47. package/docs/modules/coefficients_fraction.html +65 -0
  48. package/docs/modules/geometry_circle.html +61 -0
  49. package/docs/modules/geometry_line.html +65 -0
  50. package/docs/modules/geometry_triangle.html +65 -0
  51. package/docs/modules/numeric.html +61 -0
  52. package/docs/modules/shutingyard.html +75 -0
  53. package/docs/types/algebra_monom.literalType.html +61 -0
  54. package/docs/types/algebra_polynom.PolynomParsingType.html +56 -0
  55. package/docs/types/coefficients_fraction.FractionParsingType.html +56 -0
  56. package/docs/types/shutingyard.Token.html +63 -0
  57. package/docs/types/shutingyard.tokenType.html +68 -0
  58. package/docs/variables/shutingyard.tokenConstant.html +61 -0
  59. package/esm/index.js +1 -1
  60. package/esm/index.js.map +1 -1
  61. package/esm/maths/algebra/monom.d.ts +19 -19
  62. package/esm/maths/algebra/monom.js +66 -66
  63. package/esm/maths/algebra/monom.js.map +1 -1
  64. package/esm/maths/algebra/polynom.d.ts +14 -14
  65. package/esm/maths/algebra/polynom.js +72 -50
  66. package/esm/maths/algebra/polynom.js.map +1 -1
  67. package/esm/maths/numeric.js +3 -48
  68. package/esm/maths/numeric.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/index.ts +1 -1
  71. package/src/maths/algebra/monom.ts +138 -130
  72. package/src/maths/algebra/polynom.ts +97 -82
  73. package/src/maths/geometry/line.ts +22 -25
  74. package/src/maths/geometry/point.ts +43 -29
  75. package/src/maths/numeric.ts +61 -90
  76. package/src/maths/randomization/random.ts +7 -0
  77. package/src/maths/randomization/rndGeometryCircle.ts +50 -0
  78. package/src/maths/randomization/rndTypes.ts +10 -4
  79. package/tests/algebra/linear.test.ts +1 -1
  80. package/tests/algebra/polynom.test.ts +162 -1
  81. package/tests/algebra/study.test.ts +1 -0
  82. package/tests/geometry/circle.test.ts +320 -115
  83. package/tests/geometry/line.test.ts +8 -17
  84. package/tests/numeric.test.ts +19 -3
package/dist/pimath.js CHANGED
@@ -2,57 +2,6 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 607:
6
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7
-
8
- var __webpack_unused_export__;
9
-
10
- __webpack_unused_export__ = ({ value: true });
11
- exports.l = void 0;
12
- const numeric_1 = __webpack_require__(956);
13
- const numexp_1 = __webpack_require__(394);
14
- const shutingyard_1 = __webpack_require__(505);
15
- const random_1 = __webpack_require__(330);
16
- const fraction_1 = __webpack_require__(506);
17
- const nthRoot_1 = __webpack_require__(872);
18
- const monom_1 = __webpack_require__(937);
19
- const polynom_1 = __webpack_require__(38);
20
- const equation_1 = __webpack_require__(760);
21
- const linearSystem_1 = __webpack_require__(554);
22
- const rational_1 = __webpack_require__(107);
23
- const logicalset_1 = __webpack_require__(236);
24
- const vector_1 = __webpack_require__(586);
25
- const line_1 = __webpack_require__(9);
26
- const triangle_1 = __webpack_require__(164);
27
- const circle_1 = __webpack_require__(699);
28
- const point_1 = __webpack_require__(557);
29
- // Expose as global
30
- exports.l = {
31
- ShutingYard: shutingyard_1.Shutingyard,
32
- Numeric: numeric_1.Numeric,
33
- NumExp: numexp_1.NumExp,
34
- Fraction: fraction_1.Fraction,
35
- Root: nthRoot_1.NthRoot,
36
- Monom: monom_1.Monom,
37
- Polynom: polynom_1.Polynom,
38
- Equation: equation_1.Equation,
39
- LinearSystem: linearSystem_1.LinearSystem,
40
- Rational: rational_1.Rational,
41
- Logicalset: logicalset_1.Logicalset,
42
- Random: random_1.Random,
43
- Geometry: {
44
- Vector: vector_1.Vector,
45
- Point: point_1.Point,
46
- Line: line_1.Line,
47
- Triangle: triangle_1.Triangle,
48
- Circle: circle_1.Circle
49
- }
50
- };
51
- window.Pi = exports.l;
52
-
53
-
54
- /***/ }),
55
-
56
5
  /***/ 760:
57
6
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
58
7
 
@@ -1325,8 +1274,6 @@ class Monom {
1325
1274
  * @param value (optional) string The value that should be parse. Can be a Monom, a Fraction, a string or a number. If nothing is provided, it will return the trivial monom (0).
1326
1275
  */
1327
1276
  constructor(value) {
1328
- // ------------------------------------------
1329
- // Creation / parsing functions
1330
1277
  // -----------------------------------------
1331
1278
  /**
1332
1279
  * Parse a string to a monom. The string may include fraction.
@@ -1394,36 +1341,6 @@ class Monom {
1394
1341
  }
1395
1342
  }
1396
1343
  };
1397
- this._shutingYardToReducedMonom = (inputStr) => {
1398
- // Get the RPN array of the current expression
1399
- const SY = new shutingyard_1.Shutingyard().parse(inputStr);
1400
- const rpn = SY.rpn;
1401
- let stack = [], m, pow, letter, q1, q2;
1402
- if (rpn.length === 0) {
1403
- this.zero();
1404
- return this;
1405
- }
1406
- else if (rpn.length === 1) {
1407
- const element = rpn[0];
1408
- this.one();
1409
- if (element.tokenType === 'coefficient') {
1410
- this.coefficient = new fraction_1.Fraction(element.token);
1411
- }
1412
- else if (element.tokenType === 'variable') {
1413
- this.setLetter(element.token, 1);
1414
- }
1415
- return this;
1416
- }
1417
- else {
1418
- // Reset the monom
1419
- for (const element of rpn) {
1420
- this.addToken(stack, element);
1421
- }
1422
- }
1423
- this.one();
1424
- this.multiply(stack[0]);
1425
- return this;
1426
- };
1427
1344
  /**
1428
1345
  * Clone the current Monom.
1429
1346
  */
@@ -1823,6 +1740,9 @@ class Monom {
1823
1740
  }
1824
1741
  return M;
1825
1742
  };
1743
+ // ----------------------------------------
1744
+ // Static functions
1745
+ // ----------------------------------------
1826
1746
  // TODO: The rest of the functions are not used or unnecessary ?
1827
1747
  /**
1828
1748
  * Determine if multiple monoms are similar
@@ -1872,6 +1792,36 @@ class Monom {
1872
1792
  }
1873
1793
  return this.coefficient.clone().divide(div.coefficient).isRelative();
1874
1794
  };
1795
+ this._shutingYardToReducedMonom = (inputStr) => {
1796
+ // Get the RPN array of the current expression
1797
+ const SY = new shutingyard_1.Shutingyard().parse(inputStr);
1798
+ const rpn = SY.rpn;
1799
+ let stack = [], m, pow, letter, q1, q2;
1800
+ if (rpn.length === 0) {
1801
+ this.zero();
1802
+ return this;
1803
+ }
1804
+ else if (rpn.length === 1) {
1805
+ const element = rpn[0];
1806
+ this.one();
1807
+ if (element.tokenType === 'coefficient') {
1808
+ this.coefficient = new fraction_1.Fraction(element.token);
1809
+ }
1810
+ else if (element.tokenType === 'variable') {
1811
+ this.setLetter(element.token, 1);
1812
+ }
1813
+ return this;
1814
+ }
1815
+ else {
1816
+ // Reset the monom
1817
+ for (const element of rpn) {
1818
+ this.addToken(stack, element);
1819
+ }
1820
+ }
1821
+ this.one();
1822
+ this.multiply(stack[0]);
1823
+ return this;
1824
+ };
1875
1825
  this.zero();
1876
1826
  if (value !== undefined) {
1877
1827
  // A string is given - try to parse the value.
@@ -1880,8 +1830,6 @@ class Monom {
1880
1830
  return this;
1881
1831
  }
1882
1832
  // ------------------------------------------
1883
- // Getter and setter
1884
- // ------------------------------------------
1885
1833
  /**
1886
1834
  * Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
1887
1835
  * @returns {Fraction}
@@ -1889,6 +1837,8 @@ class Monom {
1889
1837
  get coefficient() {
1890
1838
  return this._coefficient;
1891
1839
  }
1840
+ // ------------------------------------------
1841
+ // Getter and setter
1892
1842
  /**
1893
1843
  * Set the coefficient \\(k\\) value of the monom
1894
1844
  * @param {Fraction | number | string} F
@@ -1903,6 +1853,13 @@ class Monom {
1903
1853
  get literal() {
1904
1854
  return this._literal;
1905
1855
  }
1856
+ /**
1857
+ * Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
1858
+ * @param {literalType} L
1859
+ */
1860
+ set literal(L) {
1861
+ this._literal = L;
1862
+ }
1906
1863
  /**
1907
1864
  * Get the literal square roots of the Monom.
1908
1865
  * TODO: remove this getter ? Is it used and is it correct ?
@@ -1920,13 +1877,6 @@ class Monom {
1920
1877
  return this._literal;
1921
1878
  }
1922
1879
  }
1923
- /**
1924
- * Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
1925
- * @param {literalType} L
1926
- */
1927
- set literal(L) {
1928
- this._literal = L;
1929
- }
1930
1880
  /**
1931
1881
  * Set the literal part of the monom from a string
1932
1882
  * @param inputStr String like x^2y^3
@@ -2047,28 +1997,6 @@ class Monom {
2047
1997
  }
2048
1998
  return monomDividers.length === 0 ? [new Monom().one()] : monomDividers;
2049
1999
  }
2050
- _getLiteralDividers(arr, letter) {
2051
- let tmpList = [];
2052
- // Be default, this.literal[letter] should be a rational number.
2053
- for (let d = 0; d <= this.literal[letter].value; d++) {
2054
- if (arr.length === 0) {
2055
- let litt = {};
2056
- litt[letter] = new fraction_1.Fraction(d);
2057
- tmpList.push(litt);
2058
- }
2059
- else {
2060
- for (let item of arr) {
2061
- let litt = {};
2062
- for (let currentLetter in item) {
2063
- litt[currentLetter] = item[currentLetter];
2064
- }
2065
- litt[letter] = new fraction_1.Fraction(d);
2066
- tmpList.push(litt);
2067
- }
2068
- }
2069
- }
2070
- return tmpList;
2071
- }
2072
2000
  /**
2073
2001
  * Display the monom, forcing the '+' sign to appear
2074
2002
  */
@@ -2167,11 +2095,30 @@ class Monom {
2167
2095
  isOne() {
2168
2096
  return this._coefficient.value === 1 && this.variables.length === 0;
2169
2097
  }
2098
+ _getLiteralDividers(arr, letter) {
2099
+ let tmpList = [];
2100
+ // Be default, this.literal[letter] should be a rational number.
2101
+ for (let d = 0; d <= this.literal[letter].value; d++) {
2102
+ if (arr.length === 0) {
2103
+ let litt = {};
2104
+ litt[letter] = new fraction_1.Fraction(d);
2105
+ tmpList.push(litt);
2106
+ }
2107
+ else {
2108
+ for (let item of arr) {
2109
+ let litt = {};
2110
+ for (let currentLetter in item) {
2111
+ litt[currentLetter] = item[currentLetter];
2112
+ }
2113
+ litt[letter] = new fraction_1.Fraction(d);
2114
+ tmpList.push(litt);
2115
+ }
2116
+ }
2117
+ }
2118
+ return tmpList;
2119
+ }
2170
2120
  }
2171
2121
  exports.Monom = Monom;
2172
- // ----------------------------------------
2173
- // Static functions
2174
- // ----------------------------------------
2175
2122
  /**
2176
2123
  * Get the least common multiple of monoms
2177
2124
  * @param monoms Array of monoms
@@ -2205,6 +2152,8 @@ Monom.lcm = (...monoms) => {
2205
2152
  }
2206
2153
  return M;
2207
2154
  };
2155
+ // ------------------------------------------
2156
+ // Creation / parsing functions
2208
2157
  /**
2209
2158
  * Multiply two monoms and return a NEW monom.
2210
2159
  * @param monoms
@@ -2475,7 +2424,7 @@ class Polynom {
2475
2424
  if (P.variables.length === 0) {
2476
2425
  let q = this.clone().divide(P);
2477
2426
  return {
2478
- quotient: this.clone().divide(P),
2427
+ quotient: this.clone().divide(P).reduce(),
2479
2428
  reminder: new Polynom().zero()
2480
2429
  };
2481
2430
  }
@@ -2484,17 +2433,19 @@ class Polynom {
2484
2433
  const degreeP = P.degree(letter);
2485
2434
  let newM;
2486
2435
  // Make the euclidian division of the two polynoms.
2487
- let MaxIteration = this.degree(letter).clone().multiply(2);
2488
- while (reminder.degree(letter).geq(degreeP) && MaxIteration.isPositive()) {
2489
- MaxIteration.subtract(1);
2436
+ let MaxIteration = this.degree(letter).value * 2;
2437
+ while (reminder.degree(letter).geq(degreeP) && MaxIteration > 0) {
2438
+ MaxIteration--;
2490
2439
  // Get the greatest monom divided by the max monom of the divider
2491
2440
  newM = reminder.monomByDegree(undefined, letter).clone().divide(maxMP);
2492
- if (newM.isZero()) {
2441
+ if (newM.isZero())
2493
2442
  break;
2494
- }
2495
2443
  // Get the new quotient and reminder.
2496
2444
  quotient.add(newM);
2497
2445
  reminder.subtract(P.clone().multiply(newM));
2446
+ // Check if the reminder is zero.
2447
+ if (newM.degree(letter).isZero())
2448
+ break;
2498
2449
  }
2499
2450
  quotient.reduce();
2500
2451
  reminder.reduce();
@@ -2735,28 +2686,52 @@ class Polynom {
2735
2686
  // -------------------------------------
2736
2687
  this.reduce = () => {
2737
2688
  // Reduce the polynom
2738
- let values = [...this._monoms], vars = [...this.variables];
2739
- this._monoms = [];
2740
- let coeffs = values.filter(x => x.variables.length === 0);
2741
- if (coeffs.length > 0) {
2742
- this._monoms.push(coeffs.reduce((a, b) => a.add(b)));
2743
- }
2744
- // Build the new monoms
2745
- for (let letter of vars) {
2746
- // Monom with same letters, but might be of different degrees
2747
- let M = values.filter(x => x.hasLetter(letter));
2748
- while (M.length > 0) {
2749
- // Take the first element
2750
- const m = M.shift(), degree = m.degree(letter);
2751
- for (let a of M.filter(x => x.degree(letter).isEqual(degree))) {
2752
- m.add(a);
2689
+ let values = this._monoms.map(x => x.clone()), vars = [...this.variables];
2690
+ // Group the monoms by similarity
2691
+ let i = 0;
2692
+ while (i < this._monoms.length) {
2693
+ for (let j = i + 1; j < this._monoms.length; j++) {
2694
+ if (this._monoms[i].isSameAs(this._monoms[j])) {
2695
+ this._monoms[i].add(this._monoms[j]);
2696
+ this._monoms.splice(j, 1);
2697
+ if (this._monoms[i].isZero()) {
2698
+ this._monoms[i] = new monom_1.Monom().zero();
2699
+ }
2700
+ j--;
2753
2701
  }
2754
- this._monoms.push(m);
2755
- // Make the new array.
2756
- M = M.filter(x => x.degree(letter).isNotEqual(degree));
2757
2702
  }
2758
- // reduce the monom
2703
+ i++;
2759
2704
  }
2705
+ //
2706
+ //
2707
+ //
2708
+ // let coeffs = values.filter(x => x.variables.length === 0)
2709
+ //
2710
+ // if (coeffs.length > 0) {
2711
+ // this._monoms.push(coeffs.reduce((a, b) => a.add(b)))
2712
+ // }
2713
+ //
2714
+ // // Build the new monoms
2715
+ // for (let letter of vars) {
2716
+ // // Monom with same letters, but might be of different degrees
2717
+ // let M = values.filter(x => x.hasLetter(letter))
2718
+ //
2719
+ // while (M.length > 0) {
2720
+ // // Take the first element
2721
+ // const m = M.shift(), degree = m.degree(letter)
2722
+ //
2723
+ // for (let a of M.filter(x => x.degree(letter).isEqual(degree))) {
2724
+ // m.add(a)
2725
+ // }
2726
+ //
2727
+ // this._monoms.push(m)
2728
+ //
2729
+ // // Make the new array.
2730
+ // M = M.filter(x => x.degree(letter).isNotEqual(degree))
2731
+ // }
2732
+ // // reduce the monom
2733
+ //
2734
+ // }
2760
2735
  // Remove all null monoms
2761
2736
  this._monoms = this._monoms.filter((m) => {
2762
2737
  return m.coefficient.value !== 0;
@@ -2942,14 +2917,10 @@ class Polynom {
2942
2917
  allDividers = allDividers.filter(x => {
2943
2918
  let pX = P.monoms[0], pC = P.monoms[P.monoms.length - 1], dX = x.monoms[0], dC = x.monoms[x.monoms.length - 1];
2944
2919
  // Check last item (degree zero)
2945
- if (!pC.isDivisible(dC)) {
2920
+ if (!pC.isDivisible(dC))
2946
2921
  return false;
2947
- }
2948
2922
  // Check the first item (degree max)
2949
- if (!pX.isDivisible(dX)) {
2950
- return false;
2951
- }
2952
- return true;
2923
+ return pX.isDivisible(dX);
2953
2924
  });
2954
2925
  }
2955
2926
  }
@@ -3306,18 +3277,6 @@ class Polynom {
3306
3277
  }
3307
3278
  return this;
3308
3279
  }
3309
- get euclidianCache() {
3310
- return this._euclidianCache;
3311
- }
3312
- set euclidianCache(value) {
3313
- this._euclidianCache = value;
3314
- }
3315
- get dirty_zeroes() {
3316
- return this._dirty_zeroes;
3317
- }
3318
- set dirty_zeroes(value) {
3319
- this._dirty_zeroes = value;
3320
- }
3321
3280
  // ------------------------------------------
3322
3281
  get dirty_factors() {
3323
3282
  return this._dirty_factors;
@@ -3325,15 +3284,17 @@ class Polynom {
3325
3284
  set dirty_factors(value) {
3326
3285
  this._dirty_factors = value;
3327
3286
  }
3328
- // ------------------------------------------
3329
- get monoms() {
3330
- return this._monoms;
3287
+ get dirty_zeroes() {
3288
+ return this._dirty_zeroes;
3331
3289
  }
3332
- set monoms(M) {
3333
- this._monoms = M;
3290
+ set dirty_zeroes(value) {
3291
+ this._dirty_zeroes = value;
3334
3292
  }
3335
- get zeroes() {
3336
- return this.getZeroes();
3293
+ get euclidianCache() {
3294
+ return this._euclidianCache;
3295
+ }
3296
+ set euclidianCache(value) {
3297
+ this._euclidianCache = value;
3337
3298
  }
3338
3299
  get factors() {
3339
3300
  return this.factorize();
@@ -3342,9 +3303,19 @@ class Polynom {
3342
3303
  this.mark_as_dirty();
3343
3304
  this._factors = value;
3344
3305
  }
3306
+ // ------------------------------------------
3307
+ get monoms() {
3308
+ return this._monoms;
3309
+ }
3310
+ set monoms(M) {
3311
+ this._monoms = M;
3312
+ }
3345
3313
  get texString() {
3346
3314
  return this._texString;
3347
3315
  }
3316
+ get zeroes() {
3317
+ return this.getZeroes();
3318
+ }
3348
3319
  get texFactors() {
3349
3320
  this.factorize();
3350
3321
  if (this.factors.length <= 1) {
@@ -6531,7 +6502,9 @@ class Numeric {
6531
6502
  }
6532
6503
  }
6533
6504
  // Order numbers.
6534
- D.sort(function (a, b) { return a - b; });
6505
+ D.sort(function (a, b) {
6506
+ return a - b;
6507
+ });
6535
6508
  // Make sure the array of value is unique.
6536
6509
  return [...new Set(D)];
6537
6510
  }
@@ -6604,53 +6577,6 @@ class Numeric {
6604
6577
  }
6605
6578
  static numberCorrection(value, epsilonDigit = 1, epsilonNumberOfDigits = 10, number_of_digits = 8) {
6606
6579
  return +value.toFixed(number_of_digits);
6607
- //
6608
- // // Must modify the number if it's like:
6609
- // // a: 3.0000000000000003
6610
- // // b: 3.9999999999999994
6611
- // // remove the last character
6612
- // // check if around n last characters are either 0 or 9
6613
- // // if it is, 'round' the number.
6614
- // function extractDecimalPart(valueToExtract: number, decimalLength: number){
6615
- // let decimal = valueToExtract.toString()
6616
- //
6617
- // if (!decimal.includes('.')) {
6618
- // return ''
6619
- // }
6620
- //
6621
- // decimal = decimal.split('.')[1]
6622
- // return decimal.substring(0, decimalLength)
6623
- // }
6624
- //
6625
- // const epsilon = Number(`0.${"0".repeat(epsilonNumberOfDigits-1)}${epsilonDigit}`)
6626
- // const decimal = extractDecimalPart(value, epsilonNumberOfDigits)
6627
- // if(decimal===''){return value}
6628
- //
6629
- // const n9 = decimal.match(/9+$/g)
6630
- // const n0 = decimal.match(/0+$/g)
6631
- //
6632
- // if (n9 && n9[0].length >= number_of_digits) {
6633
- // // New tested values.
6634
- // const mod = extractDecimalPart(value + epsilon, epsilonNumberOfDigits),
6635
- // mod0 = mod.match(/0+$/g)
6636
- //
6637
- // if(mod0 && mod0[0].length>= number_of_digits){
6638
- // return +((value+epsilon).toString().split(mod0[0])[0])
6639
- // }
6640
- // }
6641
- //
6642
- // if (n0 && n0[0].length >= number_of_digits) {
6643
- // // New tested values.
6644
- // const mod = extractDecimalPart(value - epsilon, epsilonNumberOfDigits),
6645
- // mod9 = mod.match(/9+$/g)
6646
- //
6647
- // if(mod9 && mod9[0].length>= number_of_digits){
6648
- // // The value can be changed. Remove all nines!
6649
- // return +(value.toString().split(n0[0])[0])
6650
- // }
6651
- // }
6652
- //
6653
- // return value
6654
6580
  }
6655
6581
  static periodic(value) {
6656
6582
  if (Number.isSafeInteger(value)) {
@@ -7880,12 +7806,57 @@ exports.Shutingyard = Shutingyard;
7880
7806
  /******/ }
7881
7807
  /******/
7882
7808
  /************************************************************************/
7883
- /******/
7884
- /******/ // startup
7885
- /******/ // Load entry module and return exports
7886
- /******/ // This entry module is referenced by other modules so it can't be inlined
7887
- /******/ var __webpack_exports__ = __webpack_require__(607);
7888
- /******/
7809
+ var __webpack_exports__ = {};
7810
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
7811
+ (() => {
7812
+ var exports = __webpack_exports__;
7813
+ var __webpack_unused_export__;
7814
+
7815
+ __webpack_unused_export__ = ({ value: true });
7816
+ __webpack_unused_export__ = void 0;
7817
+ const numeric_1 = __webpack_require__(956);
7818
+ const numexp_1 = __webpack_require__(394);
7819
+ const shutingyard_1 = __webpack_require__(505);
7820
+ const random_1 = __webpack_require__(330);
7821
+ const fraction_1 = __webpack_require__(506);
7822
+ const nthRoot_1 = __webpack_require__(872);
7823
+ const monom_1 = __webpack_require__(937);
7824
+ const polynom_1 = __webpack_require__(38);
7825
+ const equation_1 = __webpack_require__(760);
7826
+ const linearSystem_1 = __webpack_require__(554);
7827
+ const rational_1 = __webpack_require__(107);
7828
+ const logicalset_1 = __webpack_require__(236);
7829
+ const vector_1 = __webpack_require__(586);
7830
+ const line_1 = __webpack_require__(9);
7831
+ const triangle_1 = __webpack_require__(164);
7832
+ const circle_1 = __webpack_require__(699);
7833
+ const point_1 = __webpack_require__(557);
7834
+ // Expose as global
7835
+ __webpack_unused_export__ = {
7836
+ ShutingYard: shutingyard_1.Shutingyard,
7837
+ Numeric: numeric_1.Numeric,
7838
+ NumExp: numexp_1.NumExp,
7839
+ Fraction: fraction_1.Fraction,
7840
+ Root: nthRoot_1.NthRoot,
7841
+ Monom: monom_1.Monom,
7842
+ Polynom: polynom_1.Polynom,
7843
+ Equation: equation_1.Equation,
7844
+ LinearSystem: linearSystem_1.LinearSystem,
7845
+ Rational: rational_1.Rational,
7846
+ Logicalset: logicalset_1.Logicalset,
7847
+ Random: random_1.Random,
7848
+ Geometry: {
7849
+ Vector: vector_1.Vector,
7850
+ Point: point_1.Point,
7851
+ Line: line_1.Line,
7852
+ Triangle: triangle_1.Triangle,
7853
+ Circle: circle_1.Circle
7854
+ }
7855
+ };
7856
+ // (<any>window).Pi = PiMath
7857
+
7858
+ })();
7859
+
7889
7860
  /******/ })()
7890
7861
  ;
7891
7862
  //# sourceMappingURL=pimath.js.map