pimath 0.0.41 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +23 -23
- package/dist/pi.js +326 -575
- package/dist/pi.js.map +1 -1
- package/dist/pi.min.js +1 -1
- package/dist/pi.min.js.map +1 -1
- package/docs/assets/highlight.css +78 -78
- package/docs/assets/icons.css +1043 -1043
- package/docs/assets/main.js +52 -52
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1388 -1388
- package/docs/classes/{algebra.Equation.html → Algebra.Equation.html} +25 -25
- package/docs/classes/algebra.Logicalset.html +4 -4
- package/docs/classes/algebra.Monom.html +113 -113
- package/docs/classes/algebra.Polynom.html +29 -29
- package/docs/classes/algebra.Rational.html +3 -3
- package/docs/classes/coefficients.Fraction.html +18 -18
- package/docs/classes/coefficients.Nthroot.html +2 -2
- package/docs/classes/geometry.Circle.html +2 -2
- package/docs/classes/geometry.Line.html +2 -2
- package/docs/classes/geometry.Triangle.html +16 -16
- package/docs/classes/numeric.Numeric.html +13 -13
- package/docs/classes/shutingyard.Shutingyard.html +17 -17
- package/docs/index.html +10 -10
- package/docs/modules/{algebra.html → Algebra.html} +0 -0
- package/docs/modules/{random.html → Random.html} +0 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/maths/algebra/equation.d.ts +2 -6
- package/esm/maths/algebra/equation.js +9 -49
- package/esm/maths/algebra/equation.js.map +1 -1
- package/esm/maths/algebra/polynom.d.ts +1 -4
- package/esm/maths/algebra/polynom.js +62 -120
- package/esm/maths/algebra/polynom.js.map +1 -1
- package/esm/maths/algebra/rational.d.ts +6 -16
- package/esm/maths/algebra/rational.js +29 -140
- package/esm/maths/algebra/rational.js.map +1 -1
- package/esm/maths/coefficients/fraction.d.ts +1 -3
- package/esm/maths/coefficients/fraction.js +5 -37
- package/esm/maths/coefficients/fraction.js.map +1 -1
- package/esm/maths/coefficients/{nthRoot.d.ts → nthroot.d.ts} +5 -5
- package/esm/maths/coefficients/{nthRoot.js → nthroot.js} +5 -5
- package/esm/maths/coefficients/{nthRoot.js.map → nthroot.js.map} +1 -1
- package/esm/maths/geometry/line.js +0 -8
- package/esm/maths/geometry/line.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/maths/algebra/equation.ts +12 -58
- package/src/maths/algebra/polynom.ts +68 -128
- package/src/maths/algebra/rational.ts +98 -242
- package/src/maths/coefficients/fraction.ts +6 -44
- package/src/maths/coefficients/{nthRoot.ts → nthroot.ts} +5 -5
- package/tests/algebra/monom.test.ts +4 -1
- package/tests/coefficients/fraction.test.ts +1 -43
- package/tests/geometry/circle.test.ts +2 -4
- package/tests/algebra/equation.test.ts +0 -38
- package/tests/algebra/rationnal.test.ts +0 -68
package/dist/pi.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ var __webpack_modules__ = ({
|
|
4
|
-
|
|
5
|
-
/***/ 607:
|
|
6
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7
|
-
|
|
8
|
-
var __webpack_unused_export__;
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 607:
|
|
6
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
var __webpack_unused_export__;
|
|
9
9
|
|
|
10
10
|
__webpack_unused_export__ = ({ value: true });
|
|
11
11
|
exports.l = void 0;
|
|
@@ -14,7 +14,7 @@ const numexp_1 = __webpack_require__(735);
|
|
|
14
14
|
const shutingyard_1 = __webpack_require__(505);
|
|
15
15
|
const random_1 = __webpack_require__(330);
|
|
16
16
|
const fraction_1 = __webpack_require__(506);
|
|
17
|
-
const
|
|
17
|
+
const nthroot_1 = __webpack_require__(923);
|
|
18
18
|
const monom_1 = __webpack_require__(937);
|
|
19
19
|
const polynom_1 = __webpack_require__(38);
|
|
20
20
|
const equation_1 = __webpack_require__(760);
|
|
@@ -33,7 +33,7 @@ exports.l = {
|
|
|
33
33
|
Numeric: numeric_1.Numeric,
|
|
34
34
|
NumExp: numexp_1.NumExp,
|
|
35
35
|
Fraction: fraction_1.Fraction,
|
|
36
|
-
Root:
|
|
36
|
+
Root: nthroot_1.Nthroot,
|
|
37
37
|
Monom: monom_1.Monom,
|
|
38
38
|
Polynom: polynom_1.Polynom,
|
|
39
39
|
Equation: equation_1.Equation,
|
|
@@ -52,25 +52,20 @@ exports.l = {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
window.Pi = exports.l;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/***/ }),
|
|
58
|
-
|
|
59
|
-
/***/ 760:
|
|
60
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
61
|
-
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/***/ }),
|
|
58
|
+
|
|
59
|
+
/***/ 760:
|
|
60
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
61
|
+
|
|
62
62
|
|
|
63
63
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
64
|
-
exports.Equation =
|
|
64
|
+
exports.Equation = void 0;
|
|
65
65
|
const polynom_1 = __webpack_require__(38);
|
|
66
66
|
const numeric_1 = __webpack_require__(956);
|
|
67
67
|
const fraction_1 = __webpack_require__(506);
|
|
68
|
-
const
|
|
69
|
-
var PARTICULAR_SOLUTION;
|
|
70
|
-
(function (PARTICULAR_SOLUTION) {
|
|
71
|
-
PARTICULAR_SOLUTION["real"] = "\\mathbb{R}";
|
|
72
|
-
PARTICULAR_SOLUTION["varnothing"] = "\\varnothing";
|
|
73
|
-
})(PARTICULAR_SOLUTION = exports.PARTICULAR_SOLUTION || (exports.PARTICULAR_SOLUTION = {}));
|
|
68
|
+
const nthroot_1 = __webpack_require__(923);
|
|
74
69
|
class Equation {
|
|
75
70
|
/**
|
|
76
71
|
* Create an Equation using two polynoms.
|
|
@@ -79,8 +74,8 @@ class Equation {
|
|
|
79
74
|
*/
|
|
80
75
|
constructor(...equations) {
|
|
81
76
|
// Undetermined texSolutions.
|
|
82
|
-
this._varnothing =
|
|
83
|
-
this._real =
|
|
77
|
+
this._varnothing = '\\varnothing';
|
|
78
|
+
this._real = '\\mathbb{R}';
|
|
84
79
|
// ------------------------------------------
|
|
85
80
|
// Creation / parsing functions
|
|
86
81
|
// -----------------------------------------------
|
|
@@ -275,8 +270,6 @@ class Equation {
|
|
|
275
270
|
default:
|
|
276
271
|
this._solveDegree3plus();
|
|
277
272
|
}
|
|
278
|
-
// cleanup the solutions.
|
|
279
|
-
this._solutions = Equation.makeSolutionsUnique(this._solutions);
|
|
280
273
|
return this;
|
|
281
274
|
};
|
|
282
275
|
this.test = (values) => {
|
|
@@ -407,7 +400,7 @@ class Equation {
|
|
|
407
400
|
}
|
|
408
401
|
else {
|
|
409
402
|
this._solutions = [{
|
|
410
|
-
tex: v.
|
|
403
|
+
tex: v.display,
|
|
411
404
|
value: v.value,
|
|
412
405
|
exact: v
|
|
413
406
|
}];
|
|
@@ -467,7 +460,7 @@ class Equation {
|
|
|
467
460
|
];
|
|
468
461
|
}
|
|
469
462
|
else {
|
|
470
|
-
nthDelta = new
|
|
463
|
+
nthDelta = new nthroot_1.Nthroot(delta).reduce();
|
|
471
464
|
if (nthDelta.hasRadical()) {
|
|
472
465
|
// -b +- coeff\sqrt{radical}
|
|
473
466
|
// -------------------------
|
|
@@ -641,27 +634,9 @@ class Equation {
|
|
|
641
634
|
}
|
|
642
635
|
return this._solutions;
|
|
643
636
|
};
|
|
644
|
-
this._solveDegree3plus = (
|
|
645
|
-
//
|
|
646
|
-
//
|
|
647
|
-
// solve each factors.
|
|
648
|
-
let equ = this.clone().moveLeft();
|
|
649
|
-
equ.left.factorize();
|
|
650
|
-
this._solutions = [];
|
|
651
|
-
equ.left.factors.forEach(factor => {
|
|
652
|
-
if (factor.degree(letter).leq(2)) {
|
|
653
|
-
let factorAsEquation = new Equation(factor, 0);
|
|
654
|
-
factorAsEquation.solve();
|
|
655
|
-
factorAsEquation.solutions.forEach(solution => {
|
|
656
|
-
this._solutions.push(solution);
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
console.log(factor.tex, ': cannot actually get the solution of this equation');
|
|
661
|
-
}
|
|
662
|
-
});
|
|
663
|
-
// TODO: check equation resolution for more than degree 2
|
|
664
|
-
// this._solutions = [{tex: 'solve x - not yet handled', value: NaN, exact: false}]; // ESLint remove system :(
|
|
637
|
+
this._solveDegree3plus = () => {
|
|
638
|
+
// TODO: try to resolve equations with a degree superior than 2.
|
|
639
|
+
this._solutions = [{ tex: 'solve x - not yet handled', value: NaN, exact: false }]; // ESLint remove system :(
|
|
665
640
|
return this._solutions;
|
|
666
641
|
};
|
|
667
642
|
// Default equation
|
|
@@ -776,30 +751,15 @@ class Equation {
|
|
|
776
751
|
set randomizeDefaults(value) {
|
|
777
752
|
this._randomizeDefaults = value;
|
|
778
753
|
}
|
|
779
|
-
static makeSolutionsUnique(solutions, sorted) {
|
|
780
|
-
let solutionAsTex = [], uniqueSolutions = solutions.filter(sol => {
|
|
781
|
-
if (!solutionAsTex.includes(sol.tex)) {
|
|
782
|
-
solutionAsTex.push(sol.tex);
|
|
783
|
-
return true;
|
|
784
|
-
}
|
|
785
|
-
else {
|
|
786
|
-
return false;
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
if (sorted === true) {
|
|
790
|
-
uniqueSolutions.sort((a, b) => a.value - b.value);
|
|
791
|
-
}
|
|
792
|
-
return uniqueSolutions;
|
|
793
|
-
}
|
|
794
754
|
}
|
|
795
755
|
exports.Equation = Equation;
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
/***/ }),
|
|
799
|
-
|
|
800
|
-
/***/ 554:
|
|
801
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
802
|
-
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
/***/ }),
|
|
759
|
+
|
|
760
|
+
/***/ 554:
|
|
761
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
762
|
+
|
|
803
763
|
|
|
804
764
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
805
765
|
exports.LinearSystem = void 0;
|
|
@@ -1060,13 +1020,13 @@ class LinearSystem {
|
|
|
1060
1020
|
}
|
|
1061
1021
|
}
|
|
1062
1022
|
exports.LinearSystem = LinearSystem;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
/***/ }),
|
|
1066
|
-
|
|
1067
|
-
/***/ 236:
|
|
1068
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1069
|
-
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
/***/ }),
|
|
1026
|
+
|
|
1027
|
+
/***/ 236:
|
|
1028
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1029
|
+
|
|
1070
1030
|
|
|
1071
1031
|
/**
|
|
1072
1032
|
* Polynom module contains everything necessary to handle polynoms.
|
|
@@ -1224,13 +1184,13 @@ class Logicalset {
|
|
|
1224
1184
|
}
|
|
1225
1185
|
}
|
|
1226
1186
|
exports.Logicalset = Logicalset;
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
/***/ }),
|
|
1230
|
-
|
|
1231
|
-
/***/ 937:
|
|
1232
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1233
|
-
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
/***/ }),
|
|
1190
|
+
|
|
1191
|
+
/***/ 937:
|
|
1192
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1193
|
+
|
|
1234
1194
|
|
|
1235
1195
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1236
1196
|
exports.Monom = void 0;
|
|
@@ -2066,13 +2026,13 @@ Monom.xmultiply = (...monoms) => {
|
|
|
2066
2026
|
}
|
|
2067
2027
|
return M;
|
|
2068
2028
|
};
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
/***/ }),
|
|
2072
|
-
|
|
2073
|
-
/***/ 38:
|
|
2074
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2075
|
-
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
/***/ }),
|
|
2032
|
+
|
|
2033
|
+
/***/ 38:
|
|
2034
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2035
|
+
|
|
2076
2036
|
|
|
2077
2037
|
/**
|
|
2078
2038
|
* Polynom module contains everything necessary to handle polynoms.*
|
|
@@ -2083,7 +2043,6 @@ const monom_1 = __webpack_require__(937);
|
|
|
2083
2043
|
const shutingyard_1 = __webpack_require__(505);
|
|
2084
2044
|
const numeric_1 = __webpack_require__(956);
|
|
2085
2045
|
const fraction_1 = __webpack_require__(506);
|
|
2086
|
-
const equation_1 = __webpack_require__(760);
|
|
2087
2046
|
/**
|
|
2088
2047
|
* Polynom class can handle polynoms, reorder, resolve, ...
|
|
2089
2048
|
* ```
|
|
@@ -2586,7 +2545,6 @@ class Polynom {
|
|
|
2586
2545
|
P = P.euclidian(tempPolynom).quotient;
|
|
2587
2546
|
}
|
|
2588
2547
|
let securityLoop = P.degree().clone().multiply(2).value;
|
|
2589
|
-
let result;
|
|
2590
2548
|
// securityLoop = 0
|
|
2591
2549
|
while (securityLoop >= 0) {
|
|
2592
2550
|
securityLoop--;
|
|
@@ -2602,7 +2560,7 @@ class Polynom {
|
|
|
2602
2560
|
for (let m1d of m1) {
|
|
2603
2561
|
for (let m2d of m2) {
|
|
2604
2562
|
// if(m1d.degree()===m2d.degree()){continue}
|
|
2605
|
-
let dividerPolynom = new Polynom();
|
|
2563
|
+
let dividerPolynom = new Polynom(), result;
|
|
2606
2564
|
dividerPolynom.monoms = [m1d.clone(), m2d.clone()];
|
|
2607
2565
|
result = P.euclidian(dividerPolynom);
|
|
2608
2566
|
if (result.reminder.isZero()) {
|
|
@@ -2620,103 +2578,72 @@ class Polynom {
|
|
|
2620
2578
|
}
|
|
2621
2579
|
}
|
|
2622
2580
|
}
|
|
2623
|
-
if (!P.isOne()) {
|
|
2624
|
-
factors.push(P.clone());
|
|
2625
|
-
}
|
|
2626
2581
|
this.factors = factors;
|
|
2627
2582
|
return factors;
|
|
2628
2583
|
};
|
|
2629
2584
|
// TODO: get zeroes for more than first degree and for more than natural degrees
|
|
2630
2585
|
this.getZeroes = () => {
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
// let x1 = (-(B.value) + Math.sqrt(D.value)) / (2 * A.value),
|
|
2693
|
-
// x2 = (-(B.value) - Math.sqrt(D.value)) / (2 * A.value);
|
|
2694
|
-
//
|
|
2695
|
-
// zeroes.push(new Fraction(x1.toFixed(3)).reduce());
|
|
2696
|
-
// zeroes.push(new Fraction(x2.toFixed(3)).reduce());
|
|
2697
|
-
// } else if (D.value === 0) {
|
|
2698
|
-
// /*console.log('One zero for ', P.tex); */
|
|
2699
|
-
// } else {
|
|
2700
|
-
// console.log('No zero for ', P.tex);
|
|
2701
|
-
// }
|
|
2702
|
-
// } else {
|
|
2703
|
-
// for (let z of P.getZeroes()) {
|
|
2704
|
-
// // Check if the zero is already in the list.
|
|
2705
|
-
// // if (z === false || z === true) {
|
|
2706
|
-
// // continue;
|
|
2707
|
-
// // }
|
|
2708
|
-
// if (zeroesAsTex.indexOf(z.frac) === -1) {
|
|
2709
|
-
// zeroes.push(z);
|
|
2710
|
-
// zeroesAsTex.push(z.frac);
|
|
2711
|
-
// }
|
|
2712
|
-
// }
|
|
2713
|
-
// }
|
|
2714
|
-
// }
|
|
2715
|
-
//
|
|
2716
|
-
//
|
|
2717
|
-
// return zeroes;
|
|
2718
|
-
// }
|
|
2719
|
-
// return Z;
|
|
2586
|
+
const Z = [];
|
|
2587
|
+
switch (this.degree().value) {
|
|
2588
|
+
case 0:
|
|
2589
|
+
if (this._monoms[0].coefficient.value === 0) {
|
|
2590
|
+
return [true];
|
|
2591
|
+
}
|
|
2592
|
+
else {
|
|
2593
|
+
return [false];
|
|
2594
|
+
}
|
|
2595
|
+
case 1:
|
|
2596
|
+
// There is only one monoms,
|
|
2597
|
+
if (this._monoms.length === 1) {
|
|
2598
|
+
return [new fraction_1.Fraction().zero()];
|
|
2599
|
+
}
|
|
2600
|
+
else {
|
|
2601
|
+
const P = this.clone().reduce().reorder();
|
|
2602
|
+
return [P.monoms[1].coefficient.opposed().divide(P.monoms[0].coefficient)];
|
|
2603
|
+
}
|
|
2604
|
+
// TODO: Determine the zeros of an equation of second degree.
|
|
2605
|
+
//case 2:
|
|
2606
|
+
default:
|
|
2607
|
+
// Make sure the polynom is factorized.
|
|
2608
|
+
if (this._factors.length === 0) {
|
|
2609
|
+
this.factorize();
|
|
2610
|
+
}
|
|
2611
|
+
let zeroes = [], zeroesAsTex = [];
|
|
2612
|
+
for (let P of this._factors) {
|
|
2613
|
+
if (P.degree().greater(2)) {
|
|
2614
|
+
// TODO: Handle other polynom.
|
|
2615
|
+
}
|
|
2616
|
+
else if (P.degree().value === 2) {
|
|
2617
|
+
let A = P.monomByDegree(2).coefficient, B = P.monomByDegree(1).coefficient, C = P.monomByDegree(0).coefficient, D = B.clone().pow(2).subtract(A.clone().multiply(C).multiply(4));
|
|
2618
|
+
if (D.value > 0) {
|
|
2619
|
+
/*console.log('Two zeroes for ', P.tex); */
|
|
2620
|
+
let x1 = (-(B.value) + Math.sqrt(D.value)) / (2 * A.value), x2 = (-(B.value) - Math.sqrt(D.value)) / (2 * A.value);
|
|
2621
|
+
zeroes.push(new fraction_1.Fraction(x1.toFixed(3)).reduce());
|
|
2622
|
+
zeroes.push(new fraction_1.Fraction(x2.toFixed(3)).reduce());
|
|
2623
|
+
}
|
|
2624
|
+
else if (D.value === 0) {
|
|
2625
|
+
/*console.log('One zero for ', P.tex); */
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2628
|
+
console.log('No zero for ', P.tex);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
else {
|
|
2632
|
+
for (let z of P.getZeroes()) {
|
|
2633
|
+
// Check if the zero is already in the list.
|
|
2634
|
+
if (z === false || z === true) {
|
|
2635
|
+
continue;
|
|
2636
|
+
}
|
|
2637
|
+
if (zeroesAsTex.indexOf(z.frac) === -1) {
|
|
2638
|
+
zeroes.push(z);
|
|
2639
|
+
zeroesAsTex.push(z.frac);
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
return zeroes;
|
|
2645
|
+
}
|
|
2646
|
+
return Z;
|
|
2720
2647
|
};
|
|
2721
2648
|
// TODO: analyse the next functions to determine if they are useful or not...
|
|
2722
2649
|
this.monomByDegree = (degree, letter) => {
|
|
@@ -2809,28 +2736,6 @@ class Polynom {
|
|
|
2809
2736
|
}
|
|
2810
2737
|
return M;
|
|
2811
2738
|
};
|
|
2812
|
-
this.limitToInfinity = (letter) => {
|
|
2813
|
-
const M = this.monomByDegree(undefined, letter), sign = M.coefficient.sign(), degree = M.degree(letter);
|
|
2814
|
-
if (degree.isStrictlyPositive()) {
|
|
2815
|
-
return sign === 1 ? (new fraction_1.Fraction()).infinite() : (new fraction_1.Fraction()).infinite().opposed();
|
|
2816
|
-
}
|
|
2817
|
-
else if (degree.isZero()) {
|
|
2818
|
-
return M.coefficient;
|
|
2819
|
-
}
|
|
2820
|
-
// Any other cases
|
|
2821
|
-
return (new fraction_1.Fraction()).zero();
|
|
2822
|
-
};
|
|
2823
|
-
this.limitToNegativeInfinity = (letter) => {
|
|
2824
|
-
const M = this.monomByDegree(undefined, letter), sign = M.coefficient.sign(), degree = M.degree(letter);
|
|
2825
|
-
if (degree.isStrictlyPositive()) {
|
|
2826
|
-
return sign === -1 ? (new fraction_1.Fraction()).infinite() : (new fraction_1.Fraction()).infinite().opposed();
|
|
2827
|
-
}
|
|
2828
|
-
else if (degree.isZero()) {
|
|
2829
|
-
return M.coefficient;
|
|
2830
|
-
}
|
|
2831
|
-
// Any other cases
|
|
2832
|
-
return (new fraction_1.Fraction()).zero();
|
|
2833
|
-
};
|
|
2834
2739
|
this.genDisplay = (output, forceSign, wrapParentheses) => {
|
|
2835
2740
|
let P = '';
|
|
2836
2741
|
for (const k of this._monoms) {
|
|
@@ -3088,9 +2993,6 @@ class Polynom {
|
|
|
3088
2993
|
}
|
|
3089
2994
|
get texFactors() {
|
|
3090
2995
|
this.factorize();
|
|
3091
|
-
if (this.factors.length === 0) {
|
|
3092
|
-
return this.tex;
|
|
3093
|
-
}
|
|
3094
2996
|
let tex = '';
|
|
3095
2997
|
for (let f of this.factors) {
|
|
3096
2998
|
if (f.monoms.length > 1) {
|
|
@@ -3270,13 +3172,13 @@ Polynom.addToken = (stack, element) => {
|
|
|
3270
3172
|
break;
|
|
3271
3173
|
}
|
|
3272
3174
|
};
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
/***/ }),
|
|
3276
|
-
|
|
3277
|
-
/***/ 107:
|
|
3278
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3279
|
-
|
|
3175
|
+
|
|
3176
|
+
|
|
3177
|
+
/***/ }),
|
|
3178
|
+
|
|
3179
|
+
/***/ 107:
|
|
3180
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3181
|
+
|
|
3280
3182
|
|
|
3281
3183
|
/**
|
|
3282
3184
|
* Rational polynom module contains everything necessary to handle rational polynoms.
|
|
@@ -3286,7 +3188,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
3286
3188
|
exports.Rational = void 0;
|
|
3287
3189
|
const polynom_1 = __webpack_require__(38);
|
|
3288
3190
|
const fraction_1 = __webpack_require__(506);
|
|
3289
|
-
const equation_1 = __webpack_require__(760);
|
|
3290
3191
|
/**
|
|
3291
3192
|
* Rational class can handle rational polynoms
|
|
3292
3193
|
*/
|
|
@@ -3304,15 +3205,18 @@ class Rational {
|
|
|
3304
3205
|
};
|
|
3305
3206
|
this.domain = () => {
|
|
3306
3207
|
let zeroes = this._denominator.getZeroes();
|
|
3307
|
-
if (zeroes.length === 0 || zeroes[0]
|
|
3308
|
-
return
|
|
3208
|
+
if (zeroes.length === 0 || zeroes[0] === false) {
|
|
3209
|
+
return '\\mathbb{R}';
|
|
3309
3210
|
}
|
|
3310
|
-
else if (zeroes[0]
|
|
3311
|
-
return
|
|
3211
|
+
else if (zeroes[0] === true) {
|
|
3212
|
+
return '\\varnothing';
|
|
3312
3213
|
}
|
|
3313
3214
|
else {
|
|
3314
3215
|
return '\\mathbb{R}\\setminus\\left{' +
|
|
3315
|
-
zeroes.map(x =>
|
|
3216
|
+
zeroes.map(x => {
|
|
3217
|
+
return (typeof x === 'boolean') ? '' : x.frac;
|
|
3218
|
+
})
|
|
3219
|
+
.join(';') + '\\right}';
|
|
3316
3220
|
}
|
|
3317
3221
|
};
|
|
3318
3222
|
this.amplify = (P) => {
|
|
@@ -3320,12 +3224,6 @@ class Rational {
|
|
|
3320
3224
|
this._denominator.multiply(P);
|
|
3321
3225
|
return this;
|
|
3322
3226
|
};
|
|
3323
|
-
this.derivative = (letter) => {
|
|
3324
|
-
let N = this._numerator.clone(), D = this._denominator.clone(), dN = N.clone().derivative(letter), dD = D.clone().derivative(letter);
|
|
3325
|
-
this._numerator = dN.clone().multiply(D).subtract(N.clone().multiply(dD));
|
|
3326
|
-
this._denominator = D.clone().pow(2);
|
|
3327
|
-
return this;
|
|
3328
|
-
};
|
|
3329
3227
|
this.simplify = (P) => {
|
|
3330
3228
|
let NumeratorEuclidien = this._numerator.euclidian(P);
|
|
3331
3229
|
if (!NumeratorEuclidien.reminder.isZero()) {
|
|
@@ -3340,7 +3238,9 @@ class Rational {
|
|
|
3340
3238
|
return this;
|
|
3341
3239
|
};
|
|
3342
3240
|
this.reduce = () => {
|
|
3241
|
+
console.log(this._numerator.tex);
|
|
3343
3242
|
this._numerator.factorize();
|
|
3243
|
+
console.log(this._numerator.factors.map(x => x.tex));
|
|
3344
3244
|
for (let f of this._numerator.factors) {
|
|
3345
3245
|
this.simplify(f);
|
|
3346
3246
|
}
|
|
@@ -3365,159 +3265,50 @@ class Rational {
|
|
|
3365
3265
|
this.subtract = (R) => {
|
|
3366
3266
|
return this.add(R.clone().opposed());
|
|
3367
3267
|
};
|
|
3368
|
-
this.limits = (value,
|
|
3268
|
+
this.limits = (value, letter) => {
|
|
3369
3269
|
if (value === Infinity || value === -Infinity) {
|
|
3370
|
-
let
|
|
3371
|
-
|
|
3372
|
-
if (
|
|
3373
|
-
return value
|
|
3374
|
-
// return quotient.monomByDegree(undefined, letter).coefficient.sign()===1?(new Fraction()).infinite():(new Fraction()).infinite().opposed()
|
|
3270
|
+
let N = this._numerator.monomByDegree(this._numerator.degree(letter), letter), D = this._denominator.monomByDegree(this._denominator.degree(letter), letter);
|
|
3271
|
+
N.divide(D);
|
|
3272
|
+
if (N.degree(letter).isStrictlyPositive()) {
|
|
3273
|
+
return N.coefficient.sign() * (Math.pow((value > 0 ? 1 : -1), N.degree(letter).value % 2)) === 1 ? Infinity : -Infinity;
|
|
3375
3274
|
}
|
|
3376
|
-
|
|
3377
|
-
return
|
|
3378
|
-
}
|
|
3379
|
-
}
|
|
3380
|
-
else {
|
|
3381
|
-
let evalValues = {}, evalValuesOffset = {}, theLimit, theSign, FR = this.clone().reduce();
|
|
3382
|
-
evalValues[letter === undefined ? 'x' : letter] = new fraction_1.Fraction(value);
|
|
3383
|
-
if (offset !== 'above' && offset !== 'below') {
|
|
3384
|
-
theLimit = FR._numerator.evaluate(evalValues)
|
|
3385
|
-
.divide(FR._denominator.evaluate(evalValues));
|
|
3386
|
-
return theLimit.isInfinity() ? theLimit.abs() : theLimit;
|
|
3275
|
+
if (N.degree(letter).isZero()) {
|
|
3276
|
+
return N.coefficient;
|
|
3387
3277
|
}
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
evalValuesOffset[letter === undefined ? 'x' : letter] = (new fraction_1.Fraction(value)).add(0.000001);
|
|
3391
|
-
}
|
|
3392
|
-
else if (offset === 'below') {
|
|
3393
|
-
evalValuesOffset[letter === undefined ? 'x' : letter] = (new fraction_1.Fraction(value)).subtract(0.000001);
|
|
3394
|
-
}
|
|
3395
|
-
theLimit = FR._numerator.evaluate(evalValues)
|
|
3396
|
-
.divide(FR._denominator.evaluate(evalValues));
|
|
3397
|
-
theSign = FR._numerator.evaluate(evalValuesOffset)
|
|
3398
|
-
.divide(FR._denominator.evaluate(evalValuesOffset)).sign();
|
|
3399
|
-
if (theLimit.isInfinity()) {
|
|
3400
|
-
return theSign === 1 ? theLimit.abs() : theLimit.abs().opposed();
|
|
3401
|
-
}
|
|
3402
|
-
else {
|
|
3403
|
-
return theLimit;
|
|
3404
|
-
}
|
|
3278
|
+
if (N.degree(letter).isStrictlyPositive()) {
|
|
3279
|
+
return N.coefficient.sign() * (Math.pow(-1, N.degree(letter).value % 2)) === 1 ? 0 : -0;
|
|
3405
3280
|
}
|
|
3406
3281
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
// Factorize the numerator and the denominator
|
|
3410
|
-
this._numerator.factorize();
|
|
3411
|
-
this._denominator.factorize();
|
|
3412
|
-
let zeroes = equation_1.Equation.makeSolutionsUnique([...this._numerator.getZeroes(), ...this._denominator.getZeroes()], true), NFactors = this._numerator.factors, DFactors = this._denominator.factors;
|
|
3413
|
-
let tableOfSigns = [], result = [];
|
|
3414
|
-
NFactors.forEach(factor => {
|
|
3415
|
-
tableOfSigns.push(this._makeOneLineOfTableOfSigns(factor, zeroes, 'z'));
|
|
3416
|
-
});
|
|
3417
|
-
DFactors.forEach(factor => {
|
|
3418
|
-
tableOfSigns.push(this._makeOneLineOfTableOfSigns(factor, zeroes, 'd'));
|
|
3419
|
-
});
|
|
3420
|
-
// Empty line
|
|
3421
|
-
tableOfSigns.push([]);
|
|
3422
|
-
// Add the final row as cumulative
|
|
3423
|
-
let resultLine = tableOfSigns[0].map((x, index) => {
|
|
3424
|
-
if (index === 0) {
|
|
3425
|
-
return '';
|
|
3426
|
-
}
|
|
3427
|
-
if (index === tableOfSigns[0].length - 1) {
|
|
3428
|
-
return '';
|
|
3429
|
-
}
|
|
3430
|
-
if (index % 2 === 0) {
|
|
3431
|
-
return 't';
|
|
3432
|
-
}
|
|
3433
|
-
return '+';
|
|
3434
|
-
});
|
|
3435
|
-
for (let current of tableOfSigns) {
|
|
3436
|
-
for (let i = 0; i < current.length; i++) {
|
|
3437
|
-
if (i % 2 === 0) {
|
|
3438
|
-
// t, z or d
|
|
3439
|
-
if (resultLine[i] === 'd') {
|
|
3440
|
-
continue;
|
|
3441
|
-
}
|
|
3442
|
-
if (current[i] !== 't') {
|
|
3443
|
-
resultLine[i] = current[i];
|
|
3444
|
-
}
|
|
3445
|
-
}
|
|
3446
|
-
else {
|
|
3447
|
-
// + or -
|
|
3448
|
-
if (current[i] === '-') {
|
|
3449
|
-
resultLine[i] = resultLine[i] === '+' ? '-' : '+';
|
|
3450
|
-
}
|
|
3451
|
-
}
|
|
3452
|
-
}
|
|
3282
|
+
else {
|
|
3283
|
+
return this._numerator.evaluate({ letter: new fraction_1.Fraction(value) }).divide(this._denominator.evaluate({ letter: new fraction_1.Fraction(value) }));
|
|
3453
3284
|
}
|
|
3454
|
-
// Add the variation line.
|
|
3455
|
-
// TODO: add the variation line.
|
|
3456
|
-
tableOfSigns.push(resultLine);
|
|
3457
|
-
let tos = {
|
|
3458
|
-
factors: [...NFactors, ...DFactors],
|
|
3459
|
-
zeroes: zeroes,
|
|
3460
|
-
signs: tableOfSigns,
|
|
3461
|
-
tex: ''
|
|
3462
|
-
};
|
|
3463
|
-
this._makeTexFromTableOfSigns(tos);
|
|
3464
|
-
return tos;
|
|
3465
|
-
};
|
|
3466
|
-
this._makeTexFromTableOfSigns = (tos) => {
|
|
3467
|
-
let tex = `\\begin{tikzpicture}
|
|
3468
|
-
\\tkzTabInit[lgt=3,espcl=2,deltacl=0]{/1.2,\\(${tos.factors.map(x => x.tex).join('\\)/1,\\(')}\\)/1,/.1,\\(f(x)\\)/1.2}{{\\scriptsize \\hspace{1cm} \\(-\\infty\\)},\\(${tos.zeroes.map(x => x.tex).join('\\),\\(')}\\),{\\scriptsize \\hspace{-1cm} \\(+\\infty\\)}}`;
|
|
3469
|
-
tos.signs.forEach(list => {
|
|
3470
|
-
tex += (`\n\\tkzTabLine{${list.join(',')}}`);
|
|
3471
|
-
});
|
|
3472
|
-
tex += `\n\\end{tikzpicture}`;
|
|
3473
|
-
tos.tex = tex;
|
|
3474
|
-
return tex;
|
|
3475
|
-
};
|
|
3476
|
-
this._makeOneLineOfTableOfSigns = (factor, zeroes, zeroSign) => {
|
|
3477
|
-
let oneLine = [],
|
|
3478
|
-
// TODO : check if there is no zero ?
|
|
3479
|
-
currentZero = factor.getZeroes().map(x => x.tex);
|
|
3480
|
-
// First +/- sign, before the first zero
|
|
3481
|
-
oneLine.push('');
|
|
3482
|
-
oneLine.push(factor.evaluate(zeroes[0].value - 1).sign() === 1 ? '+' : '-');
|
|
3483
|
-
for (let i = 0; i < zeroes.length; i++) {
|
|
3484
|
-
// Add the zero if it's the current one
|
|
3485
|
-
oneLine.push(currentZero.includes(zeroes[i].tex) ? zeroSign : 't');
|
|
3486
|
-
// + / - sign after the current zero
|
|
3487
|
-
if (i < zeroes.length - 1) {
|
|
3488
|
-
oneLine.push(factor.evaluate((zeroes[i].value + zeroes[i + 1].value) / 2).sign() === 1 ? '+' : '-');
|
|
3489
|
-
}
|
|
3490
|
-
else if (i === zeroes.length - 1) {
|
|
3491
|
-
oneLine.push(factor.evaluate(zeroes[i].value + 1).sign() === 1 ? '+' : '-');
|
|
3492
|
-
}
|
|
3493
|
-
}
|
|
3494
|
-
oneLine.push('');
|
|
3495
|
-
return oneLine;
|
|
3496
3285
|
};
|
|
3497
3286
|
this._numerator = numerator ? numerator.clone() : new polynom_1.Polynom();
|
|
3498
3287
|
this._denominator = denominator ? denominator.clone() : new polynom_1.Polynom();
|
|
3499
3288
|
}
|
|
3500
|
-
get numerator() {
|
|
3501
|
-
return this._numerator;
|
|
3502
|
-
}
|
|
3503
|
-
get denominator() {
|
|
3504
|
-
return this._denominator;
|
|
3505
|
-
}
|
|
3506
3289
|
get tex() {
|
|
3507
3290
|
return `\\dfrac{ ${this._numerator.tex} }{ ${this._denominator.tex} }`;
|
|
3508
3291
|
}
|
|
3509
3292
|
get texFactors() {
|
|
3293
|
+
this._numerator.factorize();
|
|
3294
|
+
this._denominator.factorize();
|
|
3510
3295
|
return `\\dfrac{ ${this._numerator.texFactors} }{ ${this._denominator.texFactors} }`;
|
|
3511
3296
|
}
|
|
3297
|
+
get numerator() {
|
|
3298
|
+
return this._numerator;
|
|
3299
|
+
}
|
|
3300
|
+
get denominator() {
|
|
3301
|
+
return this._denominator;
|
|
3302
|
+
}
|
|
3512
3303
|
}
|
|
3513
3304
|
exports.Rational = Rational;
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
/***/ }),
|
|
3517
|
-
|
|
3518
|
-
/***/ 506:
|
|
3519
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3520
|
-
|
|
3305
|
+
|
|
3306
|
+
|
|
3307
|
+
/***/ }),
|
|
3308
|
+
|
|
3309
|
+
/***/ 506:
|
|
3310
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3311
|
+
|
|
3521
3312
|
|
|
3522
3313
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3523
3314
|
exports.Fraction = void 0;
|
|
@@ -3848,10 +3639,10 @@ class Fraction {
|
|
|
3848
3639
|
return isNaN(this._numerator);
|
|
3849
3640
|
};
|
|
3850
3641
|
this.isInfinity = () => {
|
|
3851
|
-
return
|
|
3642
|
+
return this._numerator === Infinity;
|
|
3852
3643
|
};
|
|
3853
3644
|
this.isFinite = () => {
|
|
3854
|
-
return !this.isInfinity()
|
|
3645
|
+
return !this.isInfinity();
|
|
3855
3646
|
};
|
|
3856
3647
|
this.isSquare = () => {
|
|
3857
3648
|
return Math.sqrt(this._numerator) % 1 === 0 && Math.sqrt(this._denominator) % 1 === 0;
|
|
@@ -3896,6 +3687,9 @@ class Fraction {
|
|
|
3896
3687
|
}
|
|
3897
3688
|
return this;
|
|
3898
3689
|
}
|
|
3690
|
+
get isFraction() {
|
|
3691
|
+
return true;
|
|
3692
|
+
}
|
|
3899
3693
|
// ------------------------------------------
|
|
3900
3694
|
// Getter and setter
|
|
3901
3695
|
// ------------------------------------------
|
|
@@ -3916,9 +3710,6 @@ class Fraction {
|
|
|
3916
3710
|
}
|
|
3917
3711
|
// Display getter
|
|
3918
3712
|
get tex() {
|
|
3919
|
-
if (this.isInfinity()) {
|
|
3920
|
-
return `${this.sign() === 1 ? '+' : '-'}\\infty`;
|
|
3921
|
-
}
|
|
3922
3713
|
if (this._denominator === 1) {
|
|
3923
3714
|
return `${this._numerator}`;
|
|
3924
3715
|
}
|
|
@@ -3969,52 +3760,20 @@ Fraction.min = (...fractions) => {
|
|
|
3969
3760
|
}
|
|
3970
3761
|
return M;
|
|
3971
3762
|
};
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
};
|
|
3980
|
-
Fraction.unique = (fractions, sorted) => {
|
|
3981
|
-
// TODO: make sure it's wokring -> test !
|
|
3982
|
-
let unique = {}, distinct = [];
|
|
3983
|
-
fractions.forEach(x => {
|
|
3984
|
-
if (!unique[x.clone().reduce().tex]) {
|
|
3985
|
-
distinct.push(x.clone());
|
|
3986
|
-
unique[x.tex] = true;
|
|
3987
|
-
}
|
|
3988
|
-
});
|
|
3989
|
-
if (sorted) {
|
|
3990
|
-
return Fraction.sort(distinct);
|
|
3991
|
-
}
|
|
3992
|
-
else {
|
|
3993
|
-
return distinct;
|
|
3994
|
-
}
|
|
3995
|
-
};
|
|
3996
|
-
Fraction.sort = (fractions, reverse) => {
|
|
3997
|
-
// Todo make sure it's the correct order, not reverse -> make a test
|
|
3998
|
-
let sorted = fractions.sort((a, b) => a.value - b.value);
|
|
3999
|
-
if (reverse) {
|
|
4000
|
-
sorted.reverse();
|
|
4001
|
-
}
|
|
4002
|
-
return sorted;
|
|
4003
|
-
};
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
/***/ }),
|
|
4007
|
-
|
|
4008
|
-
/***/ 872:
|
|
4009
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
4010
|
-
|
|
3763
|
+
|
|
3764
|
+
|
|
3765
|
+
/***/ }),
|
|
3766
|
+
|
|
3767
|
+
/***/ 923:
|
|
3768
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
3769
|
+
|
|
4011
3770
|
|
|
4012
3771
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4013
|
-
exports.
|
|
3772
|
+
exports.Nthroot = void 0;
|
|
4014
3773
|
/**
|
|
4015
|
-
*
|
|
3774
|
+
* Nthroot is something like "a+b\sqrt{3}
|
|
4016
3775
|
*/
|
|
4017
|
-
class
|
|
3776
|
+
class Nthroot {
|
|
4018
3777
|
constructor(...values) {
|
|
4019
3778
|
// ------------------------------------------
|
|
4020
3779
|
// Creation / parsing functions
|
|
@@ -4120,14 +3879,14 @@ class NthRoot {
|
|
|
4120
3879
|
return this._coefficient * Math.pow(this._radical, 1 / this._nth);
|
|
4121
3880
|
}
|
|
4122
3881
|
}
|
|
4123
|
-
exports.
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
/***/ }),
|
|
4127
|
-
|
|
4128
|
-
/***/ 735:
|
|
4129
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4130
|
-
|
|
3882
|
+
exports.Nthroot = Nthroot;
|
|
3883
|
+
|
|
3884
|
+
|
|
3885
|
+
/***/ }),
|
|
3886
|
+
|
|
3887
|
+
/***/ 735:
|
|
3888
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3889
|
+
|
|
4131
3890
|
|
|
4132
3891
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4133
3892
|
exports.NumExp = void 0;
|
|
@@ -4282,13 +4041,13 @@ class NumExp {
|
|
|
4282
4041
|
}
|
|
4283
4042
|
}
|
|
4284
4043
|
exports.NumExp = NumExp;
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
/***/ }),
|
|
4288
|
-
|
|
4289
|
-
/***/ 75:
|
|
4290
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4291
|
-
|
|
4044
|
+
|
|
4045
|
+
|
|
4046
|
+
/***/ }),
|
|
4047
|
+
|
|
4048
|
+
/***/ 75:
|
|
4049
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4050
|
+
|
|
4292
4051
|
|
|
4293
4052
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4294
4053
|
exports.PolynomExpProduct = exports.PolynomExpFactor = void 0;
|
|
@@ -4534,13 +4293,13 @@ class PolynomExpProduct {
|
|
|
4534
4293
|
}
|
|
4535
4294
|
}
|
|
4536
4295
|
exports.PolynomExpProduct = PolynomExpProduct;
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
/***/ }),
|
|
4540
|
-
|
|
4541
|
-
/***/ 699:
|
|
4542
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4543
|
-
|
|
4296
|
+
|
|
4297
|
+
|
|
4298
|
+
/***/ }),
|
|
4299
|
+
|
|
4300
|
+
/***/ 699:
|
|
4301
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4302
|
+
|
|
4544
4303
|
|
|
4545
4304
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4546
4305
|
exports.Circle = void 0;
|
|
@@ -4847,13 +4606,13 @@ class Circle {
|
|
|
4847
4606
|
}
|
|
4848
4607
|
}
|
|
4849
4608
|
exports.Circle = Circle;
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
/***/ }),
|
|
4853
|
-
|
|
4854
|
-
/***/ 9:
|
|
4855
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4856
|
-
|
|
4609
|
+
|
|
4610
|
+
|
|
4611
|
+
/***/ }),
|
|
4612
|
+
|
|
4613
|
+
/***/ 9:
|
|
4614
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4615
|
+
|
|
4857
4616
|
|
|
4858
4617
|
/**
|
|
4859
4618
|
* This class works for 2d line in a plane.
|
|
@@ -4937,14 +4696,6 @@ class Line {
|
|
|
4937
4696
|
return this.parseByPointAndVector(values[0], values[1]);
|
|
4938
4697
|
}
|
|
4939
4698
|
}
|
|
4940
|
-
else if (values[0] instanceof point_1.Point && values[1] instanceof Line) {
|
|
4941
|
-
if (values[2] === LinePropriety.Parallel || values[2] === null) {
|
|
4942
|
-
return this.parseByPointAndLine(values[0], values[1], LinePropriety.Parallel);
|
|
4943
|
-
}
|
|
4944
|
-
else {
|
|
4945
|
-
return this.parseByPointAndLine(values[0], values[1], LinePropriety.Perpendicular);
|
|
4946
|
-
}
|
|
4947
|
-
}
|
|
4948
4699
|
}
|
|
4949
4700
|
// TODO: Add the ability to create line from a normal vector
|
|
4950
4701
|
console.log('Someting wrong happend while creating the line');
|
|
@@ -5258,13 +5009,13 @@ class Line {
|
|
|
5258
5009
|
exports.Line = Line;
|
|
5259
5010
|
Line.PERPENDICULAR = LinePropriety.Perpendicular;
|
|
5260
5011
|
Line.PARALLEL = LinePropriety.Parallel;
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
/***/ }),
|
|
5264
|
-
|
|
5265
|
-
/***/ 557:
|
|
5266
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5267
|
-
|
|
5012
|
+
|
|
5013
|
+
|
|
5014
|
+
/***/ }),
|
|
5015
|
+
|
|
5016
|
+
/***/ 557:
|
|
5017
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5018
|
+
|
|
5268
5019
|
|
|
5269
5020
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5270
5021
|
exports.Point = void 0;
|
|
@@ -5428,13 +5179,13 @@ Point.pmatrix = (a, b, c) => {
|
|
|
5428
5179
|
return `\\begin{pmatrix} ${a.tex ? a.tex : a} \\\\ ${b.tex ? b.tex : b} \\\\ ${c.tex ? c.tex : c} \\end{pmatrix}`;
|
|
5429
5180
|
}
|
|
5430
5181
|
};
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
/***/ }),
|
|
5434
|
-
|
|
5435
|
-
/***/ 164:
|
|
5436
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5437
|
-
|
|
5182
|
+
|
|
5183
|
+
|
|
5184
|
+
/***/ }),
|
|
5185
|
+
|
|
5186
|
+
/***/ 164:
|
|
5187
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5188
|
+
|
|
5438
5189
|
|
|
5439
5190
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5440
5191
|
exports.Triangle = void 0;
|
|
@@ -5703,13 +5454,13 @@ class Triangle {
|
|
|
5703
5454
|
}
|
|
5704
5455
|
}
|
|
5705
5456
|
exports.Triangle = Triangle;
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
/***/ }),
|
|
5709
|
-
|
|
5710
|
-
/***/ 586:
|
|
5711
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5712
|
-
|
|
5457
|
+
|
|
5458
|
+
|
|
5459
|
+
/***/ }),
|
|
5460
|
+
|
|
5461
|
+
/***/ 586:
|
|
5462
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5463
|
+
|
|
5713
5464
|
|
|
5714
5465
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5715
5466
|
exports.Vector = void 0;
|
|
@@ -5887,13 +5638,13 @@ Vector.scalarProduct = (v1, v2) => {
|
|
|
5887
5638
|
// TODO: Transform to fraction with nthroot.
|
|
5888
5639
|
return v1.x.value * v2.x.value + v1.y.value * v2.y.value;
|
|
5889
5640
|
};
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
/***/ }),
|
|
5893
|
-
|
|
5894
|
-
/***/ 956:
|
|
5895
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5896
|
-
|
|
5641
|
+
|
|
5642
|
+
|
|
5643
|
+
/***/ }),
|
|
5644
|
+
|
|
5645
|
+
/***/ 956:
|
|
5646
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5647
|
+
|
|
5897
5648
|
|
|
5898
5649
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5899
5650
|
exports.Numeric = void 0;
|
|
@@ -5999,13 +5750,13 @@ class Numeric {
|
|
|
5999
5750
|
}
|
|
6000
5751
|
}
|
|
6001
5752
|
exports.Numeric = Numeric;
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
/***/ }),
|
|
6005
|
-
|
|
6006
|
-
/***/ 330:
|
|
6007
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6008
|
-
|
|
5753
|
+
|
|
5754
|
+
|
|
5755
|
+
/***/ }),
|
|
5756
|
+
|
|
5757
|
+
/***/ 330:
|
|
5758
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5759
|
+
|
|
6009
5760
|
|
|
6010
5761
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6011
5762
|
if (k2 === undefined) k2 = k;
|
|
@@ -6067,13 +5818,13 @@ var Random;
|
|
|
6067
5818
|
}
|
|
6068
5819
|
Random.shuffle = shuffle;
|
|
6069
5820
|
})(Random = exports.Random || (exports.Random = {}));
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
/***/ }),
|
|
6073
|
-
|
|
6074
|
-
/***/ 373:
|
|
6075
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
6076
|
-
|
|
5821
|
+
|
|
5822
|
+
|
|
5823
|
+
/***/ }),
|
|
5824
|
+
|
|
5825
|
+
/***/ 373:
|
|
5826
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5827
|
+
|
|
6077
5828
|
|
|
6078
5829
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6079
5830
|
exports.randomCore = void 0;
|
|
@@ -6095,13 +5846,13 @@ class randomCore {
|
|
|
6095
5846
|
}
|
|
6096
5847
|
}
|
|
6097
5848
|
exports.randomCore = randomCore;
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
/***/ }),
|
|
6101
|
-
|
|
6102
|
-
/***/ 754:
|
|
6103
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6104
|
-
|
|
5849
|
+
|
|
5850
|
+
|
|
5851
|
+
/***/ }),
|
|
5852
|
+
|
|
5853
|
+
/***/ 754:
|
|
5854
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5855
|
+
|
|
6105
5856
|
|
|
6106
5857
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6107
5858
|
exports.rndFraction = void 0;
|
|
@@ -6141,13 +5892,13 @@ class rndFraction extends randomCore_1.randomCore {
|
|
|
6141
5892
|
}
|
|
6142
5893
|
}
|
|
6143
5894
|
exports.rndFraction = rndFraction;
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
/***/ }),
|
|
6147
|
-
|
|
6148
|
-
/***/ 140:
|
|
6149
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
6150
|
-
|
|
5895
|
+
|
|
5896
|
+
|
|
5897
|
+
/***/ }),
|
|
5898
|
+
|
|
5899
|
+
/***/ 140:
|
|
5900
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
5901
|
+
|
|
6151
5902
|
|
|
6152
5903
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6153
5904
|
exports.rndHelpers = void 0;
|
|
@@ -6216,13 +5967,13 @@ class rndHelpers {
|
|
|
6216
5967
|
}
|
|
6217
5968
|
}
|
|
6218
5969
|
exports.rndHelpers = rndHelpers;
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
/***/ }),
|
|
6222
|
-
|
|
6223
|
-
/***/ 793:
|
|
6224
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6225
|
-
|
|
5970
|
+
|
|
5971
|
+
|
|
5972
|
+
/***/ }),
|
|
5973
|
+
|
|
5974
|
+
/***/ 793:
|
|
5975
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5976
|
+
|
|
6226
5977
|
|
|
6227
5978
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6228
5979
|
exports.rndMonom = void 0;
|
|
@@ -6275,13 +6026,13 @@ class rndMonom extends randomCore_1.randomCore {
|
|
|
6275
6026
|
}
|
|
6276
6027
|
}
|
|
6277
6028
|
exports.rndMonom = rndMonom;
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
/***/ }),
|
|
6281
|
-
|
|
6282
|
-
/***/ 22:
|
|
6283
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6284
|
-
|
|
6029
|
+
|
|
6030
|
+
|
|
6031
|
+
/***/ }),
|
|
6032
|
+
|
|
6033
|
+
/***/ 22:
|
|
6034
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6035
|
+
|
|
6285
6036
|
|
|
6286
6037
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6287
6038
|
exports.rndPolynom = void 0;
|
|
@@ -6356,22 +6107,22 @@ class rndPolynom extends randomCore_1.randomCore {
|
|
|
6356
6107
|
}
|
|
6357
6108
|
}
|
|
6358
6109
|
exports.rndPolynom = rndPolynom;
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
/***/ }),
|
|
6362
|
-
|
|
6363
|
-
/***/ 230:
|
|
6364
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
6365
|
-
|
|
6110
|
+
|
|
6111
|
+
|
|
6112
|
+
/***/ }),
|
|
6113
|
+
|
|
6114
|
+
/***/ 230:
|
|
6115
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
6116
|
+
|
|
6366
6117
|
|
|
6367
6118
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
/***/ }),
|
|
6371
|
-
|
|
6372
|
-
/***/ 505:
|
|
6373
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
6374
|
-
|
|
6119
|
+
|
|
6120
|
+
|
|
6121
|
+
/***/ }),
|
|
6122
|
+
|
|
6123
|
+
/***/ 505:
|
|
6124
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
6125
|
+
|
|
6375
6126
|
|
|
6376
6127
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6377
6128
|
exports.Shutingyard = exports.ShutingyardMode = exports.ShutingyardType = exports.tokenConstant = void 0;
|
|
@@ -6676,43 +6427,43 @@ class Shutingyard {
|
|
|
6676
6427
|
}
|
|
6677
6428
|
}
|
|
6678
6429
|
exports.Shutingyard = Shutingyard;
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
/***/ })
|
|
6682
|
-
|
|
6683
|
-
/******/ });
|
|
6684
|
-
/************************************************************************/
|
|
6685
|
-
/******/ // The module cache
|
|
6686
|
-
/******/ var __webpack_module_cache__ = {};
|
|
6687
|
-
/******/
|
|
6688
|
-
/******/ // The require function
|
|
6689
|
-
/******/ function __webpack_require__(moduleId) {
|
|
6690
|
-
/******/ // Check if module is in cache
|
|
6691
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
6692
|
-
/******/ if (cachedModule !== undefined) {
|
|
6693
|
-
/******/ return cachedModule.exports;
|
|
6694
|
-
/******/ }
|
|
6695
|
-
/******/ // Create a new module (and put it into the cache)
|
|
6696
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
6697
|
-
/******/ // no module.id needed
|
|
6698
|
-
/******/ // no module.loaded needed
|
|
6699
|
-
/******/ exports: {}
|
|
6700
|
-
/******/ };
|
|
6701
|
-
/******/
|
|
6702
|
-
/******/ // Execute the module function
|
|
6703
|
-
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
6704
|
-
/******/
|
|
6705
|
-
/******/ // Return the exports of the module
|
|
6706
|
-
/******/ return module.exports;
|
|
6707
|
-
/******/ }
|
|
6708
|
-
/******/
|
|
6709
|
-
/************************************************************************/
|
|
6710
|
-
/******/
|
|
6711
|
-
/******/ // startup
|
|
6712
|
-
/******/ // Load entry module and return exports
|
|
6713
|
-
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
6714
|
-
/******/ var __webpack_exports__ = __webpack_require__(607);
|
|
6715
|
-
/******/
|
|
6716
|
-
/******/ })()
|
|
6717
|
-
;
|
|
6430
|
+
|
|
6431
|
+
|
|
6432
|
+
/***/ })
|
|
6433
|
+
|
|
6434
|
+
/******/ });
|
|
6435
|
+
/************************************************************************/
|
|
6436
|
+
/******/ // The module cache
|
|
6437
|
+
/******/ var __webpack_module_cache__ = {};
|
|
6438
|
+
/******/
|
|
6439
|
+
/******/ // The require function
|
|
6440
|
+
/******/ function __webpack_require__(moduleId) {
|
|
6441
|
+
/******/ // Check if module is in cache
|
|
6442
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
6443
|
+
/******/ if (cachedModule !== undefined) {
|
|
6444
|
+
/******/ return cachedModule.exports;
|
|
6445
|
+
/******/ }
|
|
6446
|
+
/******/ // Create a new module (and put it into the cache)
|
|
6447
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
6448
|
+
/******/ // no module.id needed
|
|
6449
|
+
/******/ // no module.loaded needed
|
|
6450
|
+
/******/ exports: {}
|
|
6451
|
+
/******/ };
|
|
6452
|
+
/******/
|
|
6453
|
+
/******/ // Execute the module function
|
|
6454
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
6455
|
+
/******/
|
|
6456
|
+
/******/ // Return the exports of the module
|
|
6457
|
+
/******/ return module.exports;
|
|
6458
|
+
/******/ }
|
|
6459
|
+
/******/
|
|
6460
|
+
/************************************************************************/
|
|
6461
|
+
/******/
|
|
6462
|
+
/******/ // startup
|
|
6463
|
+
/******/ // Load entry module and return exports
|
|
6464
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
6465
|
+
/******/ var __webpack_exports__ = __webpack_require__(607);
|
|
6466
|
+
/******/
|
|
6467
|
+
/******/ })()
|
|
6468
|
+
;
|
|
6718
6469
|
//# sourceMappingURL=pi.js.map
|