pimath 0.0.90 → 0.0.92

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 (50) hide show
  1. package/.eslintrc.js +23 -23
  2. package/.idea/php.xml +15 -0
  3. package/dist/pi.js +374 -275
  4. package/dist/pi.js.map +1 -1
  5. package/dist/pi.min.js +1 -1
  6. package/dist/pi.min.js.map +1 -1
  7. package/docs/assets/main.js +52 -52
  8. package/docs/classes/Logicalset.Logicalset-1.html +4 -4
  9. package/docs/classes/Polynom.Rational.html +3 -3
  10. package/docs/classes/algebra_equation.Equation.html +25 -25
  11. package/docs/classes/algebra_monom.Monom.html +113 -113
  12. package/docs/classes/algebra_polynom.Polynom.html +29 -29
  13. package/docs/classes/coefficients_fraction.Fraction.html +18 -18
  14. package/docs/classes/coefficients_nthroot.NthRoot.html +2 -2
  15. package/docs/classes/geometry_circle.Circle.html +2 -2
  16. package/docs/classes/geometry_line.Line.html +2 -2
  17. package/docs/classes/geometry_triangle.Triangle.html +16 -16
  18. package/docs/classes/numeric.Numeric.html +13 -13
  19. package/docs/classes/shutingyard.Shutingyard.html +17 -17
  20. package/docs/index.html +10 -10
  21. package/docs/interfaces/algebra_equation.ISolution.html +2 -2
  22. package/esm/maths/algebra/monom.d.ts +8 -2
  23. package/esm/maths/algebra/monom.js +20 -0
  24. package/esm/maths/algebra/monom.js.map +1 -1
  25. package/esm/maths/algebra/polynom.d.ts +8 -4
  26. package/esm/maths/algebra/polynom.js +7 -0
  27. package/esm/maths/algebra/polynom.js.map +1 -1
  28. package/esm/maths/algebra/rational.d.ts +8 -4
  29. package/esm/maths/algebra/rational.js +3 -0
  30. package/esm/maths/algebra/rational.js.map +1 -1
  31. package/esm/maths/algebra/study/rationalStudy.d.ts +11 -1
  32. package/esm/maths/algebra/study/rationalStudy.js +62 -13
  33. package/esm/maths/algebra/study/rationalStudy.js.map +1 -1
  34. package/esm/maths/algebra/study.d.ts +13 -4
  35. package/esm/maths/algebra/study.js +10 -3
  36. package/esm/maths/algebra/study.js.map +1 -1
  37. package/esm/maths/geometry/line.d.ts +5 -0
  38. package/esm/maths/geometry/line.js +15 -0
  39. package/esm/maths/geometry/line.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/maths/algebra/monom.ts +25 -0
  42. package/src/maths/algebra/polynom.ts +9 -0
  43. package/src/maths/algebra/rational.ts +4 -0
  44. package/src/maths/algebra/study/rationalStudy.ts +68 -9
  45. package/src/maths/algebra/study.ts +11 -2
  46. package/src/maths/geometry/line.ts +18 -0
  47. package/tests/algebra/equation.test.ts +6 -0
  48. package/tests/algebra/study.test.ts +8 -10
  49. package/dev/pi.js +0 -7589
  50. package/dev/pi.js.map +0 -1
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;
@@ -52,13 +52,13 @@ 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
64
  exports.Equation = exports.PARTICULAR_SOLUTION = void 0;
@@ -811,13 +811,13 @@ class Equation {
811
811
  }
812
812
  }
813
813
  exports.Equation = Equation;
814
-
815
-
816
- /***/ }),
817
-
818
- /***/ 554:
819
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
820
-
814
+
815
+
816
+ /***/ }),
817
+
818
+ /***/ 554:
819
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
820
+
821
821
 
822
822
  Object.defineProperty(exports, "__esModule", ({ value: true }));
823
823
  exports.LinearSystem = void 0;
@@ -1077,13 +1077,13 @@ class LinearSystem {
1077
1077
  }
1078
1078
  }
1079
1079
  exports.LinearSystem = LinearSystem;
1080
-
1081
-
1082
- /***/ }),
1083
-
1084
- /***/ 236:
1085
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1086
-
1080
+
1081
+
1082
+ /***/ }),
1083
+
1084
+ /***/ 236:
1085
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1086
+
1087
1087
 
1088
1088
  /**
1089
1089
  * Polynom module contains everything necessary to handle polynoms.
@@ -1241,13 +1241,13 @@ class Logicalset {
1241
1241
  }
1242
1242
  }
1243
1243
  exports.Logicalset = Logicalset;
1244
-
1245
-
1246
- /***/ }),
1247
-
1248
- /***/ 937:
1249
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1250
-
1244
+
1245
+
1246
+ /***/ }),
1247
+
1248
+ /***/ 937:
1249
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1250
+
1251
1251
 
1252
1252
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1253
1253
  exports.Monom = void 0;
@@ -1700,6 +1700,26 @@ class Monom {
1700
1700
  }
1701
1701
  return r;
1702
1702
  };
1703
+ this.evaluateAsNumeric = (values) => {
1704
+ let r = this.coefficient.value;
1705
+ if (typeof values === 'number') {
1706
+ let tmpValues = {};
1707
+ tmpValues[this.variables[0]] = values;
1708
+ return this.evaluateAsNumeric(tmpValues);
1709
+ }
1710
+ if (typeof values === 'object') {
1711
+ if (this.variables.length === 0) {
1712
+ return this.coefficient.value;
1713
+ }
1714
+ for (let L in this._literal) {
1715
+ if (values[L] === undefined) {
1716
+ return 0;
1717
+ }
1718
+ r *= values[L] ** (this._literal[L].value);
1719
+ }
1720
+ }
1721
+ return r;
1722
+ };
1703
1723
  /**
1704
1724
  * Derivative the monom
1705
1725
  * @param letter
@@ -2136,13 +2156,13 @@ Monom.xmultiply = (...monoms) => {
2136
2156
  }
2137
2157
  return M;
2138
2158
  };
2139
-
2140
-
2141
- /***/ }),
2142
-
2143
- /***/ 38:
2144
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2145
-
2159
+
2160
+
2161
+ /***/ }),
2162
+
2163
+ /***/ 38:
2164
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2165
+
2146
2166
 
2147
2167
  /**
2148
2168
  * Polynom module contains everything necessary to handle polynoms.*
@@ -2680,6 +2700,13 @@ class Polynom {
2680
2700
  });
2681
2701
  return r;
2682
2702
  };
2703
+ this.evaluateAsNumeric = (values) => {
2704
+ let r = 0;
2705
+ this._monoms.forEach(monom => {
2706
+ r += monom.evaluateAsNumeric(values);
2707
+ });
2708
+ return r;
2709
+ };
2683
2710
  this.derivative = (letter) => {
2684
2711
  let dP = new Polynom();
2685
2712
  for (let m of this._monoms) {
@@ -3333,13 +3360,13 @@ class Polynom {
3333
3360
  }
3334
3361
  }
3335
3362
  exports.Polynom = Polynom;
3336
-
3337
-
3338
- /***/ }),
3339
-
3340
- /***/ 107:
3341
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3342
-
3363
+
3364
+
3365
+ /***/ }),
3366
+
3367
+ /***/ 107:
3368
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3369
+
3343
3370
 
3344
3371
  /**
3345
3372
  * Rational polynom module contains everything necessary to handle rational polynoms.
@@ -3481,16 +3508,17 @@ class Rational {
3481
3508
  let N = this._numerator.evaluate(values), D = this._denominator.evaluate(values);
3482
3509
  return N.divide(D);
3483
3510
  };
3511
+ this.evaluateAsNumeric = (values) => {
3512
+ return this._numerator.evaluateAsNumeric(values) / this._denominator.evaluateAsNumeric(values);
3513
+ };
3484
3514
  this.study = () => {
3485
3515
  return new rationalStudy_1.RationalStudy(this);
3486
3516
  };
3487
3517
  if (numerator instanceof polynom_1.Polynom) {
3488
3518
  this._numerator = numerator.clone();
3489
- }
3490
- else if (typeof numerator === 'string') {
3519
+ } else if (typeof numerator === 'string') {
3491
3520
  this._numerator = new polynom_1.Polynom(numerator);
3492
- }
3493
- else {
3521
+ } else {
3494
3522
  this._numerator = new polynom_1.Polynom();
3495
3523
  }
3496
3524
  if (denominator instanceof polynom_1.Polynom) {
@@ -3520,20 +3548,20 @@ class Rational {
3520
3548
  }
3521
3549
  }
3522
3550
  exports.Rational = Rational;
3523
-
3524
-
3525
- /***/ }),
3526
-
3527
- /***/ 996:
3528
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3529
-
3530
3551
 
3531
- /**
3532
- * Rational polynom module contains everything necessary to handle rational polynoms.
3533
- * @module Polynom
3534
- */
3535
- Object.defineProperty(exports, "__esModule", ({ value: true }));
3536
- exports.Study = exports.TABLE_OF_SIGNS = exports.FUNCTION_EXTREMA = exports.ASYMPTOTE = exports.ZEROTYPE = void 0;
3552
+
3553
+ /***/ }),
3554
+
3555
+ /***/ 996:
3556
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3557
+
3558
+
3559
+ /**
3560
+ * Rational polynom module contains everything necessary to handle rational polynoms.
3561
+ * @module Polynom
3562
+ */
3563
+ Object.defineProperty(exports, "__esModule", ({value: true}));
3564
+ exports.Study = exports.TABLE_OF_SIGNS = exports.FUNCTION_EXTREMA = exports.ASYMPTOTE_POSITION = exports.ASYMPTOTE = exports.ZEROTYPE = void 0;
3537
3565
  const fraction_1 = __webpack_require__(506);
3538
3566
  const numexp_1 = __webpack_require__(735);
3539
3567
  var ZEROTYPE;
@@ -3542,25 +3570,32 @@ var ZEROTYPE;
3542
3570
  ZEROTYPE["DEFENCE"] = "d";
3543
3571
  ZEROTYPE["NOTHING"] = "t";
3544
3572
  })(ZEROTYPE = exports.ZEROTYPE || (exports.ZEROTYPE = {}));
3545
- var ASYMPTOTE;
3546
- (function (ASYMPTOTE) {
3547
- ASYMPTOTE["VERTICAL"] = "av";
3548
- ASYMPTOTE["HORIZONTAL"] = "ah";
3549
- ASYMPTOTE["SLOPE"] = "ao";
3550
- ASYMPTOTE["HOLE"] = "hole";
3551
- })(ASYMPTOTE = exports.ASYMPTOTE || (exports.ASYMPTOTE = {}));
3552
- var FUNCTION_EXTREMA;
3553
- (function (FUNCTION_EXTREMA) {
3554
- FUNCTION_EXTREMA["MIN"] = "min";
3555
- FUNCTION_EXTREMA["MAX"] = "max";
3556
- FUNCTION_EXTREMA["FLAT"] = "flat";
3557
- FUNCTION_EXTREMA["NOTHING"] = "";
3558
- })(FUNCTION_EXTREMA = exports.FUNCTION_EXTREMA || (exports.FUNCTION_EXTREMA = {}));
3559
- var TABLE_OF_SIGNS;
3560
- (function (TABLE_OF_SIGNS) {
3561
- TABLE_OF_SIGNS["SIGNS"] = "signs";
3562
- TABLE_OF_SIGNS["GROWS"] = "grows";
3563
- TABLE_OF_SIGNS["VARIATIONS"] = "variatins";
3573
+ var ASYMPTOTE;
3574
+ (function (ASYMPTOTE) {
3575
+ ASYMPTOTE["VERTICAL"] = "av";
3576
+ ASYMPTOTE["HORIZONTAL"] = "ah";
3577
+ ASYMPTOTE["SLOPE"] = "ao";
3578
+ ASYMPTOTE["HOLE"] = "hole";
3579
+ })(ASYMPTOTE = exports.ASYMPTOTE || (exports.ASYMPTOTE = {}));
3580
+ var ASYMPTOTE_POSITION;
3581
+ (function (ASYMPTOTE_POSITION) {
3582
+ ASYMPTOTE_POSITION["LT"] = "LT";
3583
+ ASYMPTOTE_POSITION["RT"] = "RT";
3584
+ ASYMPTOTE_POSITION["LB"] = "LB";
3585
+ ASYMPTOTE_POSITION["RB"] = "RB";
3586
+ })(ASYMPTOTE_POSITION = exports.ASYMPTOTE_POSITION || (exports.ASYMPTOTE_POSITION = {}));
3587
+ var FUNCTION_EXTREMA;
3588
+ (function (FUNCTION_EXTREMA) {
3589
+ FUNCTION_EXTREMA["MIN"] = "min";
3590
+ FUNCTION_EXTREMA["MAX"] = "max";
3591
+ FUNCTION_EXTREMA["FLAT"] = "flat";
3592
+ FUNCTION_EXTREMA["NOTHING"] = "";
3593
+ })(FUNCTION_EXTREMA = exports.FUNCTION_EXTREMA || (exports.FUNCTION_EXTREMA = {}));
3594
+ var TABLE_OF_SIGNS;
3595
+ (function (TABLE_OF_SIGNS) {
3596
+ TABLE_OF_SIGNS["SIGNS"] = "signs";
3597
+ TABLE_OF_SIGNS["GROWS"] = "grows";
3598
+ TABLE_OF_SIGNS["VARIATIONS"] = "variations";
3564
3599
  })(TABLE_OF_SIGNS = exports.TABLE_OF_SIGNS || (exports.TABLE_OF_SIGNS = {}));
3565
3600
  /**
3566
3601
  * The study class is a "function study" class that will get:
@@ -3851,13 +3886,13 @@ class Study {
3851
3886
  }
3852
3887
  }
3853
3888
  exports.Study = Study;
3854
-
3855
-
3856
- /***/ }),
3857
-
3858
- /***/ 572:
3859
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3860
-
3889
+
3890
+
3891
+ /***/ }),
3892
+
3893
+ /***/ 572:
3894
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3895
+
3861
3896
 
3862
3897
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3863
3898
  exports.RationalStudy = void 0;
@@ -3889,39 +3924,76 @@ class RationalStudy extends study_1.Study {
3889
3924
  return this._getZeroes(this.fx);
3890
3925
  }
3891
3926
  ;
3892
- makeSigns() {
3893
- let tos = this._getSigns(this.fx, this.zeroes);
3894
- return tos;
3927
+ _getHorizontalAsymptoteRelativePositon(deltaX, delta = 1000000) {
3928
+ let position = [], before = deltaX.evaluateAsNumeric(-delta), after = deltaX.evaluateAsNumeric(delta);
3929
+ if (before >= 0) {
3930
+ position.push(study_1.ASYMPTOTE_POSITION.LT);
3931
+ } else {
3932
+ position.push(study_1.ASYMPTOTE_POSITION.LB);
3933
+ }
3934
+ if (after >= 0) {
3935
+ position.push(study_1.ASYMPTOTE_POSITION.RT);
3936
+ } else {
3937
+ position.push(study_1.ASYMPTOTE_POSITION.RB);
3938
+ }
3939
+ return position;
3895
3940
  }
3896
- ;
3941
+
3897
3942
  makeAsymptotes() {
3898
3943
  const reduced = this.fx.clone().reduce();
3899
3944
  // Vertical
3900
3945
  let asymptotes = [];
3901
3946
  this.zeroes.filter(x => x.type === study_1.ZEROTYPE.DEFENCE).forEach(zero => {
3902
3947
  // Check if it's a hole or an asymptote
3903
- // TODO: Check for a hole ! Means calculate the limits !
3904
3948
  let Ztype = study_1.ASYMPTOTE.VERTICAL, tex = `x=${zero.tex}`;
3949
+ // Check if it's a hole: the reduced polynom should not be null
3905
3950
  if (zero.exact instanceof fraction_1.Fraction) {
3906
3951
  if (reduced.denominator.evaluate(zero.exact).isNotZero()) {
3907
3952
  Ztype = study_1.ASYMPTOTE.HOLE;
3908
3953
  tex = `(${zero.tex};${reduced.evaluate(zero.exact).tex})`;
3909
3954
  }
3910
- }
3911
- else {
3955
+ } else {
3912
3956
  if (reduced.denominator.evaluate(zero.value).isNotZero()) {
3913
3957
  Ztype = study_1.ASYMPTOTE.HOLE;
3914
3958
  tex = `(${zero.tex};${reduced.evaluate(zero.value).tex})`;
3915
3959
  }
3916
3960
  }
3961
+ // Get the position before and after the asymptote.
3962
+ const delta = 0.000001;
3963
+ let before = this.fx.evaluateAsNumeric(zero.value - delta),
3964
+ after = this.fx.evaluateAsNumeric(zero.value + delta), position = [], pm = "";
3965
+ if (after < -10000) {
3966
+ position.push(study_1.ASYMPTOTE_POSITION.RB);
3967
+ pm += "m";
3968
+ } else if (after > 10000) {
3969
+ position.push(study_1.ASYMPTOTE_POSITION.RT);
3970
+ pm += "p";
3971
+ }
3972
+ if (before < -10000) {
3973
+ position.push(study_1.ASYMPTOTE_POSITION.LB);
3974
+ pm += "m";
3975
+ } else if (before > 10000) {
3976
+ position.push(study_1.ASYMPTOTE_POSITION.LT);
3977
+ pm += "p";
3978
+ }
3979
+ // Left and right are to infinity
3980
+ // TODO: handle the case were one side of the asymptote isn't infinity (not possible in rational study?!)
3981
+ if (pm === "pp") {
3982
+ pm = "+";
3983
+ } else if (pm === "mm") {
3984
+ pm = "-";
3985
+ } else {
3986
+ pm = `\\${pm}`;
3987
+ }
3917
3988
  asymptotes.push({
3918
3989
  fx: null,
3919
3990
  type: Ztype,
3920
3991
  tex: tex,
3921
3992
  zero: zero,
3922
- limits: `\\lim_{x\\to${zero.tex} }\\ f(x) = \\pm\\infty`,
3993
+ limits: `\\lim_{x\\to${zero.tex} }\\ f(x) = ${pm}\\infty`,
3923
3994
  deltaX: null,
3924
- tableOfSign: null
3995
+ tableOfSign: null,
3996
+ position
3925
3997
  });
3926
3998
  });
3927
3999
  // Sloped asymptote
@@ -3929,6 +4001,7 @@ class RationalStudy extends study_1.Study {
3929
4001
  if (NDegree.isEqual(DDegree)) {
3930
4002
  let H = this.fx.numerator.monomByDegree().coefficient.clone().divide(this.fx.denominator.monomByDegree().coefficient), Htex = H.tex;
3931
4003
  let { reminder } = reduced.euclidian(), deltaX = new rational_1.Rational(reminder, reduced.denominator);
4004
+ // Determine the position above or below on the left / right of the asymptote.
3932
4005
  asymptotes.push({
3933
4006
  fx: new polynom_1.Polynom(H),
3934
4007
  type: study_1.ASYMPTOTE.HORIZONTAL,
@@ -3936,7 +4009,8 @@ class RationalStudy extends study_1.Study {
3936
4009
  zero: null,
3937
4010
  limits: `\\lim_{x\\to\\infty}\\ f(x) = ${Htex}`,
3938
4011
  deltaX,
3939
- tableOfSign: this._getSigns(deltaX)
4012
+ tableOfSign: this._getSigns(deltaX),
4013
+ position: this._getHorizontalAsymptoteRelativePositon(deltaX)
3940
4014
  });
3941
4015
  }
3942
4016
  else if (DDegree.greater(NDegree)) {
@@ -3947,7 +4021,8 @@ class RationalStudy extends study_1.Study {
3947
4021
  zero: null,
3948
4022
  limits: `\\lim_{x\\to\\infty}\\ f(x) = ${0}`,
3949
4023
  deltaX: null,
3950
- tableOfSign: null
4024
+ tableOfSign: null,
4025
+ position: this._getHorizontalAsymptoteRelativePositon(this.fx)
3951
4026
  });
3952
4027
  }
3953
4028
  else if (NDegree.value - 1 === DDegree.value) {
@@ -3960,20 +4035,29 @@ class RationalStudy extends study_1.Study {
3960
4035
  zero: null,
3961
4036
  limits: ``,
3962
4037
  deltaX: new rational_1.Rational(reminder, reduced.denominator),
3963
- tableOfSign: this._getSigns(deltaX)
4038
+ tableOfSign: this._getSigns(deltaX),
4039
+ position: this._getHorizontalAsymptoteRelativePositon(deltaX)
3964
4040
  });
3965
4041
  }
3966
4042
  return asymptotes;
3967
4043
  }
3968
4044
  ;
4045
+
3969
4046
  makeDerivative() {
3970
- let dx = this.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.GROWS);
4047
+ let dx = this.fx.clone().derivative(),
4048
+ tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.GROWS);
3971
4049
  let result = this.makeGrowsResult(tos);
3972
4050
  tos.signs.push(result.growsLine);
3973
4051
  tos.extremes = result.extremes;
3974
4052
  return tos;
3975
4053
  }
3976
4054
  ;
4055
+
4056
+ makeSigns() {
4057
+ return this._getSigns(this.fx, this.zeroes);
4058
+ }
4059
+ ;
4060
+
3977
4061
  makeVariation() {
3978
4062
  // Get the zeroes, make signs.
3979
4063
  let dx = this.derivative.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.VARIATIONS);
@@ -4043,13 +4127,13 @@ class RationalStudy extends study_1.Study {
4043
4127
  }
4044
4128
  }
4045
4129
  exports.RationalStudy = RationalStudy;
4046
-
4047
-
4048
- /***/ }),
4049
-
4050
- /***/ 506:
4051
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4052
-
4130
+
4131
+
4132
+ /***/ }),
4133
+
4134
+ /***/ 506:
4135
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4136
+
4053
4137
 
4054
4138
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4055
4139
  exports.Fraction = void 0;
@@ -4566,13 +4650,13 @@ Fraction.sort = (fractions, reverse) => {
4566
4650
  }
4567
4651
  return sorted;
4568
4652
  };
4569
-
4570
-
4571
- /***/ }),
4572
-
4573
- /***/ 872:
4574
- /***/ ((__unused_webpack_module, exports) => {
4575
-
4653
+
4654
+
4655
+ /***/ }),
4656
+
4657
+ /***/ 872:
4658
+ /***/ ((__unused_webpack_module, exports) => {
4659
+
4576
4660
 
4577
4661
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4578
4662
  exports.NthRoot = void 0;
@@ -4686,13 +4770,13 @@ class NthRoot {
4686
4770
  }
4687
4771
  }
4688
4772
  exports.NthRoot = NthRoot;
4689
-
4690
-
4691
- /***/ }),
4692
-
4693
- /***/ 735:
4694
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4695
-
4773
+
4774
+
4775
+ /***/ }),
4776
+
4777
+ /***/ 735:
4778
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4779
+
4696
4780
 
4697
4781
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4698
4782
  exports.NumExp = void 0;
@@ -4863,13 +4947,13 @@ class NumExp {
4863
4947
  }
4864
4948
  }
4865
4949
  exports.NumExp = NumExp;
4866
-
4867
-
4868
- /***/ }),
4869
-
4870
- /***/ 75:
4871
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4872
-
4950
+
4951
+
4952
+ /***/ }),
4953
+
4954
+ /***/ 75:
4955
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4956
+
4873
4957
 
4874
4958
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4875
4959
  exports.PolynomExpProduct = exports.PolynomExpFactor = void 0;
@@ -5086,7 +5170,7 @@ class PolynomExpProduct {
5086
5170
  return this._integrateWithInternalDerivative(this._factors[1], this._factors[0], letter);
5087
5171
  }
5088
5172
  }
5089
- return;
5173
+
5090
5174
  }
5091
5175
  applyMathFunction(mathFn) {
5092
5176
  this._fn = mathFn;
@@ -5111,17 +5195,17 @@ class PolynomExpProduct {
5111
5195
  return new PolynomExpProduct(new PolynomExpFactor(P.degree.clone().add(1).invert(), 1), new PolynomExpFactor(quotient, 1), new PolynomExpFactor(P.polynom.clone(), P.degree.clone().add(1)));
5112
5196
  }
5113
5197
  }
5114
- return;
5198
+
5115
5199
  }
5116
5200
  }
5117
5201
  exports.PolynomExpProduct = PolynomExpProduct;
5118
-
5119
-
5120
- /***/ }),
5121
-
5122
- /***/ 699:
5123
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5124
-
5202
+
5203
+
5204
+ /***/ }),
5205
+
5206
+ /***/ 699:
5207
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5208
+
5125
5209
 
5126
5210
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5127
5211
  exports.Circle = void 0;
@@ -5445,13 +5529,13 @@ class Circle {
5445
5529
  }
5446
5530
  }
5447
5531
  exports.Circle = Circle;
5448
-
5449
-
5450
- /***/ }),
5451
-
5452
- /***/ 9:
5453
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5454
-
5532
+
5533
+
5534
+ /***/ }),
5535
+
5536
+ /***/ 9:
5537
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5538
+
5455
5539
 
5456
5540
  /**
5457
5541
  * This class works for 2d line in a plane.
@@ -5695,14 +5779,14 @@ class Line {
5695
5779
  if (equ instanceof equation_1.Equation) {
5696
5780
  return equ.right.evaluate({ x: F });
5697
5781
  }
5698
- return;
5782
+
5699
5783
  };
5700
5784
  this.getValueAtY = (value) => {
5701
5785
  const equ = this.equation.clone().isolate('x'), F = new fraction_1.Fraction(value);
5702
5786
  if (equ instanceof equation_1.Equation) {
5703
5787
  return equ.right.evaluate({ y: F });
5704
5788
  }
5705
- return;
5789
+
5706
5790
  };
5707
5791
  this._exists = false;
5708
5792
  if (values.length > 0) {
@@ -5734,6 +5818,21 @@ class Line {
5734
5818
  parametric: `${point_1.Point.pmatrix('x', 'y')} = ${point_1.Point.pmatrix(this._OA.x, this._OA.y)} + k\\cdot ${point_1.Point.pmatrix(this._d.x, this._d.y)}`
5735
5819
  };
5736
5820
  }
5821
+ get display() {
5822
+ // canonical => ax + by + c = 0
5823
+ // mxh => y = -a/b x - c/b
5824
+ // parametric => (xy) = OA + k*d // not relevant in display mode.
5825
+ let canonical = this.equation;
5826
+ // Make sur the first item is positive.
5827
+ if (this._a.isNegative()) {
5828
+ canonical.multiply(-1);
5829
+ }
5830
+ return {
5831
+ canonical: canonical.display,
5832
+ mxh: this.slope.isInfinity() ? 'x=' + this.OA.x.display : 'y=' + new polynom_1.Polynom().parse('x', this.slope, this.height).display,
5833
+ parametric: ""
5834
+ };
5835
+ }
5737
5836
  get a() {
5738
5837
  return this._a;
5739
5838
  }
@@ -5856,13 +5955,13 @@ class Line {
5856
5955
  exports.Line = Line;
5857
5956
  Line.PERPENDICULAR = LinePropriety.Perpendicular;
5858
5957
  Line.PARALLEL = LinePropriety.Parallel;
5859
-
5860
-
5861
- /***/ }),
5862
-
5863
- /***/ 557:
5864
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5865
-
5958
+
5959
+
5960
+ /***/ }),
5961
+
5962
+ /***/ 557:
5963
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5964
+
5866
5965
 
5867
5966
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5868
5967
  exports.Point = void 0;
@@ -6026,13 +6125,13 @@ Point.pmatrix = (a, b, c) => {
6026
6125
  return `\\begin{pmatrix} ${a.tex ? a.tex : a} \\\\ ${b.tex ? b.tex : b} \\\\ ${c.tex ? c.tex : c} \\end{pmatrix}`;
6027
6126
  }
6028
6127
  };
6029
-
6030
-
6031
- /***/ }),
6032
-
6033
- /***/ 164:
6034
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6035
-
6128
+
6129
+
6130
+ /***/ }),
6131
+
6132
+ /***/ 164:
6133
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6134
+
6036
6135
 
6037
6136
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6038
6137
  exports.Triangle = void 0;
@@ -6301,13 +6400,13 @@ class Triangle {
6301
6400
  }
6302
6401
  }
6303
6402
  exports.Triangle = Triangle;
6304
-
6305
-
6306
- /***/ }),
6307
-
6308
- /***/ 586:
6309
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6310
-
6403
+
6404
+
6405
+ /***/ }),
6406
+
6407
+ /***/ 586:
6408
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6409
+
6311
6410
 
6312
6411
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6313
6412
  exports.Vector = void 0;
@@ -6485,13 +6584,13 @@ Vector.scalarProduct = (v1, v2) => {
6485
6584
  // TODO: Transform to fraction with nthroot.
6486
6585
  return v1.x.value * v2.x.value + v1.y.value * v2.y.value;
6487
6586
  };
6488
-
6489
-
6490
- /***/ }),
6491
-
6492
- /***/ 956:
6493
- /***/ ((__unused_webpack_module, exports) => {
6494
-
6587
+
6588
+
6589
+ /***/ }),
6590
+
6591
+ /***/ 956:
6592
+ /***/ ((__unused_webpack_module, exports) => {
6593
+
6495
6594
 
6496
6595
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6497
6596
  exports.Numeric = void 0;
@@ -6652,13 +6751,13 @@ class Numeric {
6652
6751
  }
6653
6752
  }
6654
6753
  exports.Numeric = Numeric;
6655
-
6656
-
6657
- /***/ }),
6658
-
6659
- /***/ 330:
6660
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6661
-
6754
+
6755
+
6756
+ /***/ }),
6757
+
6758
+ /***/ 330:
6759
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6760
+
6662
6761
 
6663
6762
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6664
6763
  if (k2 === undefined) k2 = k;
@@ -6724,13 +6823,13 @@ var Random;
6724
6823
  }
6725
6824
  Random.shuffle = shuffle;
6726
6825
  })(Random = exports.Random || (exports.Random = {}));
6727
-
6728
-
6729
- /***/ }),
6730
-
6731
- /***/ 373:
6732
- /***/ ((__unused_webpack_module, exports) => {
6733
-
6826
+
6827
+
6828
+ /***/ }),
6829
+
6830
+ /***/ 373:
6831
+ /***/ ((__unused_webpack_module, exports) => {
6832
+
6734
6833
 
6735
6834
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6736
6835
  exports.randomCore = void 0;
@@ -6752,13 +6851,13 @@ class randomCore {
6752
6851
  }
6753
6852
  }
6754
6853
  exports.randomCore = randomCore;
6755
-
6756
-
6757
- /***/ }),
6758
-
6759
- /***/ 754:
6760
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6761
-
6854
+
6855
+
6856
+ /***/ }),
6857
+
6858
+ /***/ 754:
6859
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6860
+
6762
6861
 
6763
6862
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6764
6863
  exports.rndFraction = void 0;
@@ -6802,13 +6901,13 @@ class rndFraction extends randomCore_1.randomCore {
6802
6901
  }
6803
6902
  }
6804
6903
  exports.rndFraction = rndFraction;
6805
-
6806
-
6807
- /***/ }),
6808
-
6809
- /***/ 140:
6810
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6811
-
6904
+
6905
+
6906
+ /***/ }),
6907
+
6908
+ /***/ 140:
6909
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6910
+
6812
6911
 
6813
6912
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6814
6913
  exports.rndHelpers = void 0;
@@ -6885,13 +6984,13 @@ class rndHelpers {
6885
6984
  }
6886
6985
  }
6887
6986
  exports.rndHelpers = rndHelpers;
6888
-
6889
-
6890
- /***/ }),
6891
-
6892
- /***/ 793:
6893
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6894
-
6987
+
6988
+
6989
+ /***/ }),
6990
+
6991
+ /***/ 793:
6992
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6993
+
6895
6994
 
6896
6995
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6897
6996
  exports.rndMonom = void 0;
@@ -6944,13 +7043,13 @@ class rndMonom extends randomCore_1.randomCore {
6944
7043
  }
6945
7044
  }
6946
7045
  exports.rndMonom = rndMonom;
6947
-
6948
-
6949
- /***/ }),
6950
-
6951
- /***/ 22:
6952
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6953
-
7046
+
7047
+
7048
+ /***/ }),
7049
+
7050
+ /***/ 22:
7051
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7052
+
6954
7053
 
6955
7054
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6956
7055
  exports.rndPolynom = void 0;
@@ -7025,22 +7124,22 @@ class rndPolynom extends randomCore_1.randomCore {
7025
7124
  }
7026
7125
  }
7027
7126
  exports.rndPolynom = rndPolynom;
7028
-
7029
-
7030
- /***/ }),
7031
-
7032
- /***/ 230:
7033
- /***/ ((__unused_webpack_module, exports) => {
7034
-
7127
+
7128
+
7129
+ /***/ }),
7130
+
7131
+ /***/ 230:
7132
+ /***/ ((__unused_webpack_module, exports) => {
7133
+
7035
7134
 
7036
7135
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7037
-
7038
-
7039
- /***/ }),
7040
-
7041
- /***/ 505:
7042
- /***/ ((__unused_webpack_module, exports) => {
7043
-
7136
+
7137
+
7138
+ /***/ }),
7139
+
7140
+ /***/ 505:
7141
+ /***/ ((__unused_webpack_module, exports) => {
7142
+
7044
7143
 
7045
7144
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7046
7145
  exports.Shutingyard = exports.ShutingyardMode = exports.ShutingyardType = exports.tokenConstant = void 0;
@@ -7467,43 +7566,43 @@ class Shutingyard {
7467
7566
  }
7468
7567
  }
7469
7568
  exports.Shutingyard = Shutingyard;
7470
-
7471
-
7472
- /***/ })
7473
-
7474
- /******/ });
7475
- /************************************************************************/
7476
- /******/ // The module cache
7477
- /******/ var __webpack_module_cache__ = {};
7478
- /******/
7479
- /******/ // The require function
7480
- /******/ function __webpack_require__(moduleId) {
7481
- /******/ // Check if module is in cache
7482
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
7483
- /******/ if (cachedModule !== undefined) {
7484
- /******/ return cachedModule.exports;
7485
- /******/ }
7486
- /******/ // Create a new module (and put it into the cache)
7487
- /******/ var module = __webpack_module_cache__[moduleId] = {
7488
- /******/ // no module.id needed
7489
- /******/ // no module.loaded needed
7490
- /******/ exports: {}
7491
- /******/ };
7492
- /******/
7493
- /******/ // Execute the module function
7494
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
7495
- /******/
7496
- /******/ // Return the exports of the module
7497
- /******/ return module.exports;
7498
- /******/ }
7499
- /******/
7500
- /************************************************************************/
7501
- /******/
7502
- /******/ // startup
7503
- /******/ // Load entry module and return exports
7504
- /******/ // This entry module is referenced by other modules so it can't be inlined
7505
- /******/ var __webpack_exports__ = __webpack_require__(607);
7506
- /******/
7507
- /******/ })()
7508
- ;
7569
+
7570
+
7571
+ /***/ })
7572
+
7573
+ /******/ });
7574
+ /************************************************************************/
7575
+ /******/ // The module cache
7576
+ /******/ var __webpack_module_cache__ = {};
7577
+ /******/
7578
+ /******/ // The require function
7579
+ /******/ function __webpack_require__(moduleId) {
7580
+ /******/ // Check if module is in cache
7581
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
7582
+ /******/ if (cachedModule !== undefined) {
7583
+ /******/ return cachedModule.exports;
7584
+ /******/ }
7585
+ /******/ // Create a new module (and put it into the cache)
7586
+ /******/ var module = __webpack_module_cache__[moduleId] = {
7587
+ /******/ // no module.id needed
7588
+ /******/ // no module.loaded needed
7589
+ /******/ exports: {}
7590
+ /******/ };
7591
+ /******/
7592
+ /******/ // Execute the module function
7593
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
7594
+ /******/
7595
+ /******/ // Return the exports of the module
7596
+ /******/ return module.exports;
7597
+ /******/ }
7598
+ /******/
7599
+ /************************************************************************/
7600
+ /******/
7601
+ /******/ // startup
7602
+ /******/ // Load entry module and return exports
7603
+ /******/ // This entry module is referenced by other modules so it can't be inlined
7604
+ /******/ var __webpack_exports__ = __webpack_require__(607);
7605
+ /******/
7606
+ /******/ })()
7607
+ ;
7509
7608
  //# sourceMappingURL=pi.js.map