pimath 0.0.92 → 0.0.94

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/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;
@@ -389,13 +389,14 @@ class Equation {
389
389
  };
390
390
  this._solveDegree1 = (letter) => {
391
391
  const m1 = this._polynom.monomByDegree(1, letter).coefficient, m0 = this._polynom.monomByDegree(0, letter).coefficient, v = m0.clone().opposed().divide(m1);
392
- let s;
392
+ let s, d;
393
393
  if (this.isStrictEqual()) {
394
394
  if (m1.value === 0) {
395
395
  // In this case, the coefficient of the x variable is zero.
396
396
  if (m0.value === 0) {
397
397
  this._solutions = [{
398
398
  tex: this._real,
399
+ display: "RR",
399
400
  value: NaN,
400
401
  exact: false
401
402
  }];
@@ -403,6 +404,7 @@ class Equation {
403
404
  else {
404
405
  this._solutions = [{
405
406
  tex: this._varnothing,
407
+ display: "O/",
406
408
  value: NaN,
407
409
  exact: false
408
410
  }];
@@ -411,6 +413,7 @@ class Equation {
411
413
  else {
412
414
  this._solutions = [{
413
415
  tex: v.tex,
416
+ display: v.display,
414
417
  value: v.value,
415
418
  exact: v
416
419
  }];
@@ -421,13 +424,16 @@ class Equation {
421
424
  // In this case, the coefficient of the x variable is zero.
422
425
  if (m0.value === 0 && this.isAlsoEqual()) {
423
426
  s = '\\mathbb{R}';
427
+ d = "RR";
424
428
  }
425
429
  else {
426
430
  if (m0.value > 0) {
427
431
  s = this.isGreater() ? this._real : this._varnothing;
432
+ s = this.isGreater() ? "RR" : "O/";
428
433
  }
429
434
  else {
430
435
  s = !this.isGreater() ? this._real : this._varnothing;
436
+ s = !this.isGreater() ? "RR" : "O/";
431
437
  }
432
438
  }
433
439
  }
@@ -435,13 +441,16 @@ class Equation {
435
441
  // Must handle the case if the m1 monom is negative.
436
442
  if ((this.isGreater() && m1.sign() === 1) || (!this.isGreater() && m1.sign() === -1)) {
437
443
  s = `\\left${this.isAlsoEqual() ? '[' : ']'}${v.tex};+\\infty\\right[`;
444
+ d = `${this.isAlsoEqual() ? '[' : ']'}${v.tex};+oo[`;
438
445
  }
439
446
  else {
440
447
  s = `\\left]-\\infty;${v.tex} \\right${this.isAlsoEqual() ? ']' : '['}`;
448
+ d = `]-oo;${v.tex}${this.isAlsoEqual() ? ']' : '['}`;
441
449
  }
442
450
  }
443
451
  this._solutions = [{
444
452
  tex: s,
453
+ display: d,
445
454
  value: NaN,
446
455
  exact: false
447
456
  }];
@@ -456,14 +465,17 @@ class Equation {
456
465
  realX2 = (-b + Math.sqrt(delta)) / (2 * a);
457
466
  if (delta > 1.0e5) {
458
467
  // The delta is too big to be parsed !
468
+ let v1 = ((-b - Math.sqrt(delta)) / (2 * a)).toFixed(5), v2 = ((-b + Math.sqrt(delta)) / (2 * a)).toFixed(5);
459
469
  this._solutions = [
460
470
  {
461
- tex: ((-b - Math.sqrt(delta)) / (2 * a)).toFixed(5),
471
+ tex: v1,
472
+ display: v1,
462
473
  value: realX1,
463
474
  exact: false
464
475
  },
465
476
  {
466
- tex: ((-b + Math.sqrt(delta)) / (2 * a)).toFixed(5),
477
+ tex: v2,
478
+ display: v2,
467
479
  value: realX2,
468
480
  exact: false
469
481
  }
@@ -481,19 +493,27 @@ class Equation {
481
493
  am = -am;
482
494
  bm = -bm;
483
495
  }
484
- let tex1 = "", tex2 = "";
496
+ let tex1 = "", tex2 = "", display1 = "", display2 = "";
485
497
  tex1 = `${bm !== 0 ? ((-bm) + ' - ') : ''}${nthDelta.tex}`;
486
498
  tex2 = `${bm !== 0 ? ((-bm) + ' + ') : ''}${nthDelta.tex}`;
499
+ display1 = `${bm !== 0 ? ((-bm) + ' - ') : ''}${nthDelta.display}`;
500
+ display2 = `${bm !== 0 ? ((-bm) + ' + ') : ''}${nthDelta.display}`;
487
501
  if (am !== 1) {
488
502
  tex1 = `\\frac{ ${tex1} }{ ${2 * am} }`;
489
503
  tex2 = `\\frac{ ${tex2} }{ ${2 * am} }`;
490
504
  }
491
505
  this._solutions = [
492
506
  {
493
- tex: tex1, value: realX1, exact: false
507
+ tex: tex1,
508
+ display: tex1,
509
+ value: realX1,
510
+ exact: false
494
511
  },
495
512
  {
496
- tex: tex2, value: realX2, exact: false
513
+ tex: tex2,
514
+ display: tex2,
515
+ value: realX2,
516
+ exact: false
497
517
  },
498
518
  ];
499
519
  // if (b !== 0) {
@@ -561,11 +581,13 @@ class Equation {
561
581
  this._solutions = [
562
582
  {
563
583
  tex: S1.frac,
584
+ display: S1.display,
564
585
  value: realX1,
565
586
  exact: S1
566
587
  },
567
588
  {
568
589
  tex: S2.frac,
590
+ display: S2.display,
569
591
  value: realX2,
570
592
  exact: S2
571
593
  }
@@ -577,6 +599,7 @@ class Equation {
577
599
  const sol = new fraction_1.Fraction(-b, 2 * a).reduce();
578
600
  this._solutions = [{
579
601
  tex: sol.frac,
602
+ display: sol.display,
580
603
  value: sol.value,
581
604
  exact: sol
582
605
  }];
@@ -584,6 +607,7 @@ class Equation {
584
607
  else {
585
608
  this._solutions = [{
586
609
  tex: this._varnothing,
610
+ display: "O/",
587
611
  value: NaN,
588
612
  exact: false
589
613
  }];
@@ -596,6 +620,7 @@ class Equation {
596
620
  if ((this.isGreater() && aF.sign() === 1) || (!this.isGreater() && aF.sign() === -1)) {
597
621
  this._solutions = [{
598
622
  tex: `\\left]-\\infty ; ${sX1}\\right${this.isAlsoEqual() ? ']' : '['} \\cup \\left${this.isAlsoEqual() ? '[' : ']'}${sX2};+\\infty\\right[`,
623
+ display: `]-oo;${sX1}${this.isAlsoEqual() ? ']' : '['}uu${this.isAlsoEqual() ? '[' : ']'}${sX2};+oo[`,
599
624
  value: NaN,
600
625
  exact: false
601
626
  }
@@ -604,6 +629,7 @@ class Equation {
604
629
  else {
605
630
  this._solutions = [{
606
631
  tex: `\\left${this.isAlsoEqual() ? '[' : ']'}${sX1} ; ${sX2}\\right${this.isAlsoEqual() ? ']' : '['}`,
632
+ display: `${this.isAlsoEqual() ? '[' : ']'}${sX1};${sX2}${this.isAlsoEqual() ? ']' : '['}`,
607
633
  value: NaN,
608
634
  exact: false
609
635
  }];
@@ -614,6 +640,7 @@ class Equation {
614
640
  if ((this.isGreater() && aF.sign() === 1) || (!this.isGreater() && aF.sign() === -1)) {
615
641
  this._solutions = [{
616
642
  tex: `\\left]-\\infty ; ${this._solutions[0].tex}\\right[ \\cup \\left]${this._solutions[0].tex};+\\infty\\right[`,
643
+ display: `]-oo;${this._solutions[0].tex}[uu]${this._solutions[0].tex};+oo[`,
617
644
  value: NaN,
618
645
  exact: false
619
646
  }
@@ -622,6 +649,7 @@ class Equation {
622
649
  else {
623
650
  this._solutions = [{
624
651
  tex: this._varnothing,
652
+ display: "O/",
625
653
  value: NaN,
626
654
  exact: false
627
655
  }];
@@ -631,6 +659,7 @@ class Equation {
631
659
  if ((this.isGreater() && aF.sign() === 1) || (!this.isGreater() && aF.sign() === -1)) {
632
660
  this._solutions = [{
633
661
  tex: this._real,
662
+ display: "RR",
634
663
  value: NaN,
635
664
  exact: false
636
665
  }];
@@ -644,6 +673,7 @@ class Equation {
644
673
  if (this.isGreater()) {
645
674
  this._solutions = [{
646
675
  tex: aF.sign() === 1 ? this._real : this._varnothing,
676
+ display: aF.sign() === 1 ? "RR" : "O/",
647
677
  value: NaN,
648
678
  exact: false
649
679
  }];
@@ -651,6 +681,7 @@ class Equation {
651
681
  else {
652
682
  this._solutions = [{
653
683
  tex: aF.sign() === -1 ? this._real : this._varnothing,
684
+ display: aF.sign() === -1 ? "RR" : "O/",
654
685
  value: NaN,
655
686
  exact: false
656
687
  }];
@@ -811,13 +842,13 @@ class Equation {
811
842
  }
812
843
  }
813
844
  exports.Equation = Equation;
814
-
815
-
816
- /***/ }),
817
-
818
- /***/ 554:
819
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
820
-
845
+
846
+
847
+ /***/ }),
848
+
849
+ /***/ 554:
850
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
851
+
821
852
 
822
853
  Object.defineProperty(exports, "__esModule", ({ value: true }));
823
854
  exports.LinearSystem = void 0;
@@ -1077,13 +1108,13 @@ class LinearSystem {
1077
1108
  }
1078
1109
  }
1079
1110
  exports.LinearSystem = LinearSystem;
1080
-
1081
-
1082
- /***/ }),
1083
-
1084
- /***/ 236:
1085
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1086
-
1111
+
1112
+
1113
+ /***/ }),
1114
+
1115
+ /***/ 236:
1116
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1117
+
1087
1118
 
1088
1119
  /**
1089
1120
  * Polynom module contains everything necessary to handle polynoms.
@@ -1241,13 +1272,13 @@ class Logicalset {
1241
1272
  }
1242
1273
  }
1243
1274
  exports.Logicalset = Logicalset;
1244
-
1245
-
1246
- /***/ }),
1247
-
1248
- /***/ 937:
1249
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1250
-
1275
+
1276
+
1277
+ /***/ }),
1278
+
1279
+ /***/ 937:
1280
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1281
+
1251
1282
 
1252
1283
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1253
1284
  exports.Monom = void 0;
@@ -2156,13 +2187,13 @@ Monom.xmultiply = (...monoms) => {
2156
2187
  }
2157
2188
  return M;
2158
2189
  };
2159
-
2160
-
2161
- /***/ }),
2162
-
2163
- /***/ 38:
2164
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2165
-
2190
+
2191
+
2192
+ /***/ }),
2193
+
2194
+ /***/ 38:
2195
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2196
+
2166
2197
 
2167
2198
  /**
2168
2199
  * Polynom module contains everything necessary to handle polynoms.*
@@ -3360,13 +3391,13 @@ class Polynom {
3360
3391
  }
3361
3392
  }
3362
3393
  exports.Polynom = Polynom;
3363
-
3364
-
3365
- /***/ }),
3366
-
3367
- /***/ 107:
3368
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3369
-
3394
+
3395
+
3396
+ /***/ }),
3397
+
3398
+ /***/ 107:
3399
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3400
+
3370
3401
 
3371
3402
  /**
3372
3403
  * Rational polynom module contains everything necessary to handle rational polynoms.
@@ -3516,9 +3547,11 @@ class Rational {
3516
3547
  };
3517
3548
  if (numerator instanceof polynom_1.Polynom) {
3518
3549
  this._numerator = numerator.clone();
3519
- } else if (typeof numerator === 'string') {
3550
+ }
3551
+ else if (typeof numerator === 'string') {
3520
3552
  this._numerator = new polynom_1.Polynom(numerator);
3521
- } else {
3553
+ }
3554
+ else {
3522
3555
  this._numerator = new polynom_1.Polynom();
3523
3556
  }
3524
3557
  if (denominator instanceof polynom_1.Polynom) {
@@ -3548,20 +3581,20 @@ class Rational {
3548
3581
  }
3549
3582
  }
3550
3583
  exports.Rational = Rational;
3584
+
3585
+
3586
+ /***/ }),
3587
+
3588
+ /***/ 996:
3589
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3590
+
3551
3591
 
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;
3592
+ /**
3593
+ * Rational polynom module contains everything necessary to handle rational polynoms.
3594
+ * @module Polynom
3595
+ */
3596
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3597
+ exports.Study = exports.TABLE_OF_SIGNS = exports.FUNCTION_EXTREMA = exports.ASYMPTOTE_POSITION = exports.ASYMPTOTE = exports.ZEROTYPE = void 0;
3565
3598
  const fraction_1 = __webpack_require__(506);
3566
3599
  const numexp_1 = __webpack_require__(735);
3567
3600
  var ZEROTYPE;
@@ -3570,32 +3603,32 @@ var ZEROTYPE;
3570
3603
  ZEROTYPE["DEFENCE"] = "d";
3571
3604
  ZEROTYPE["NOTHING"] = "t";
3572
3605
  })(ZEROTYPE = exports.ZEROTYPE || (exports.ZEROTYPE = {}));
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";
3606
+ var ASYMPTOTE;
3607
+ (function (ASYMPTOTE) {
3608
+ ASYMPTOTE["VERTICAL"] = "av";
3609
+ ASYMPTOTE["HORIZONTAL"] = "ah";
3610
+ ASYMPTOTE["SLOPE"] = "ao";
3611
+ ASYMPTOTE["HOLE"] = "hole";
3612
+ })(ASYMPTOTE = exports.ASYMPTOTE || (exports.ASYMPTOTE = {}));
3613
+ var ASYMPTOTE_POSITION;
3614
+ (function (ASYMPTOTE_POSITION) {
3615
+ ASYMPTOTE_POSITION["LT"] = "LT";
3616
+ ASYMPTOTE_POSITION["RT"] = "RT";
3617
+ ASYMPTOTE_POSITION["LB"] = "LB";
3618
+ ASYMPTOTE_POSITION["RB"] = "RB";
3619
+ })(ASYMPTOTE_POSITION = exports.ASYMPTOTE_POSITION || (exports.ASYMPTOTE_POSITION = {}));
3620
+ var FUNCTION_EXTREMA;
3621
+ (function (FUNCTION_EXTREMA) {
3622
+ FUNCTION_EXTREMA["MIN"] = "min";
3623
+ FUNCTION_EXTREMA["MAX"] = "max";
3624
+ FUNCTION_EXTREMA["FLAT"] = "flat";
3625
+ FUNCTION_EXTREMA["NOTHING"] = "";
3626
+ })(FUNCTION_EXTREMA = exports.FUNCTION_EXTREMA || (exports.FUNCTION_EXTREMA = {}));
3627
+ var TABLE_OF_SIGNS;
3628
+ (function (TABLE_OF_SIGNS) {
3629
+ TABLE_OF_SIGNS["SIGNS"] = "signs";
3630
+ TABLE_OF_SIGNS["GROWS"] = "grows";
3631
+ TABLE_OF_SIGNS["VARIATIONS"] = "variations";
3599
3632
  })(TABLE_OF_SIGNS = exports.TABLE_OF_SIGNS || (exports.TABLE_OF_SIGNS = {}));
3600
3633
  /**
3601
3634
  * The study class is a "function study" class that will get:
@@ -3886,13 +3919,13 @@ class Study {
3886
3919
  }
3887
3920
  }
3888
3921
  exports.Study = Study;
3889
-
3890
-
3891
- /***/ }),
3892
-
3893
- /***/ 572:
3894
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3895
-
3922
+
3923
+
3924
+ /***/ }),
3925
+
3926
+ /***/ 572:
3927
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3928
+
3896
3929
 
3897
3930
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3898
3931
  exports.RationalStudy = void 0;
@@ -3924,21 +3957,10 @@ class RationalStudy extends study_1.Study {
3924
3957
  return this._getZeroes(this.fx);
3925
3958
  }
3926
3959
  ;
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;
3960
+ makeSigns() {
3961
+ return this._getSigns(this.fx, this.zeroes);
3940
3962
  }
3941
-
3963
+ ;
3942
3964
  makeAsymptotes() {
3943
3965
  const reduced = this.fx.clone().reduce();
3944
3966
  // Vertical
@@ -3952,7 +3974,8 @@ class RationalStudy extends study_1.Study {
3952
3974
  Ztype = study_1.ASYMPTOTE.HOLE;
3953
3975
  tex = `(${zero.tex};${reduced.evaluate(zero.exact).tex})`;
3954
3976
  }
3955
- } else {
3977
+ }
3978
+ else {
3956
3979
  if (reduced.denominator.evaluate(zero.value).isNotZero()) {
3957
3980
  Ztype = study_1.ASYMPTOTE.HOLE;
3958
3981
  tex = `(${zero.tex};${reduced.evaluate(zero.value).tex})`;
@@ -3960,19 +3983,20 @@ class RationalStudy extends study_1.Study {
3960
3983
  }
3961
3984
  // Get the position before and after the asymptote.
3962
3985
  const delta = 0.000001;
3963
- let before = this.fx.evaluateAsNumeric(zero.value - delta),
3964
- after = this.fx.evaluateAsNumeric(zero.value + delta), position = [], pm = "";
3986
+ let before = this.fx.evaluateAsNumeric(zero.value - delta), after = this.fx.evaluateAsNumeric(zero.value + delta), position = [], pm = "";
3965
3987
  if (after < -10000) {
3966
3988
  position.push(study_1.ASYMPTOTE_POSITION.RB);
3967
3989
  pm += "m";
3968
- } else if (after > 10000) {
3990
+ }
3991
+ else if (after > 10000) {
3969
3992
  position.push(study_1.ASYMPTOTE_POSITION.RT);
3970
3993
  pm += "p";
3971
3994
  }
3972
3995
  if (before < -10000) {
3973
3996
  position.push(study_1.ASYMPTOTE_POSITION.LB);
3974
3997
  pm += "m";
3975
- } else if (before > 10000) {
3998
+ }
3999
+ else if (before > 10000) {
3976
4000
  position.push(study_1.ASYMPTOTE_POSITION.LT);
3977
4001
  pm += "p";
3978
4002
  }
@@ -3980,9 +4004,11 @@ class RationalStudy extends study_1.Study {
3980
4004
  // TODO: handle the case were one side of the asymptote isn't infinity (not possible in rational study?!)
3981
4005
  if (pm === "pp") {
3982
4006
  pm = "+";
3983
- } else if (pm === "mm") {
4007
+ }
4008
+ else if (pm === "mm") {
3984
4009
  pm = "-";
3985
- } else {
4010
+ }
4011
+ else {
3986
4012
  pm = `\\${pm}`;
3987
4013
  }
3988
4014
  asymptotes.push({
@@ -4042,22 +4068,30 @@ class RationalStudy extends study_1.Study {
4042
4068
  return asymptotes;
4043
4069
  }
4044
4070
  ;
4045
-
4071
+ _getHorizontalAsymptoteRelativePositon(deltaX, delta = 1000000) {
4072
+ let position = [], before = deltaX.evaluateAsNumeric(-delta), after = deltaX.evaluateAsNumeric(delta);
4073
+ if (before >= 0) {
4074
+ position.push(study_1.ASYMPTOTE_POSITION.LT);
4075
+ }
4076
+ else {
4077
+ position.push(study_1.ASYMPTOTE_POSITION.LB);
4078
+ }
4079
+ if (after >= 0) {
4080
+ position.push(study_1.ASYMPTOTE_POSITION.RT);
4081
+ }
4082
+ else {
4083
+ position.push(study_1.ASYMPTOTE_POSITION.RB);
4084
+ }
4085
+ return position;
4086
+ }
4046
4087
  makeDerivative() {
4047
- let dx = this.fx.clone().derivative(),
4048
- tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.GROWS);
4088
+ let dx = this.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.GROWS);
4049
4089
  let result = this.makeGrowsResult(tos);
4050
4090
  tos.signs.push(result.growsLine);
4051
4091
  tos.extremes = result.extremes;
4052
4092
  return tos;
4053
4093
  }
4054
4094
  ;
4055
-
4056
- makeSigns() {
4057
- return this._getSigns(this.fx, this.zeroes);
4058
- }
4059
- ;
4060
-
4061
4095
  makeVariation() {
4062
4096
  // Get the zeroes, make signs.
4063
4097
  let dx = this.derivative.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.VARIATIONS);
@@ -4074,6 +4108,7 @@ class RationalStudy extends study_1.Study {
4074
4108
  // add the item
4075
4109
  zeroes.push({
4076
4110
  tex: z.tex,
4111
+ display: z.display,
4077
4112
  value: z.value,
4078
4113
  exact: z.exact,
4079
4114
  extrema: study_1.FUNCTION_EXTREMA.NOTHING,
@@ -4089,6 +4124,7 @@ class RationalStudy extends study_1.Study {
4089
4124
  // Add the item
4090
4125
  zeroes.push({
4091
4126
  tex: z.tex,
4127
+ display: z.display,
4092
4128
  value: z.value,
4093
4129
  exact: z.exact,
4094
4130
  extrema: study_1.FUNCTION_EXTREMA.NOTHING,
@@ -4127,13 +4163,13 @@ class RationalStudy extends study_1.Study {
4127
4163
  }
4128
4164
  }
4129
4165
  exports.RationalStudy = RationalStudy;
4130
-
4131
-
4132
- /***/ }),
4133
-
4134
- /***/ 506:
4135
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4136
-
4166
+
4167
+
4168
+ /***/ }),
4169
+
4170
+ /***/ 506:
4171
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4172
+
4137
4173
 
4138
4174
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4139
4175
  exports.Fraction = void 0;
@@ -4650,13 +4686,13 @@ Fraction.sort = (fractions, reverse) => {
4650
4686
  }
4651
4687
  return sorted;
4652
4688
  };
4653
-
4654
-
4655
- /***/ }),
4656
-
4657
- /***/ 872:
4658
- /***/ ((__unused_webpack_module, exports) => {
4659
-
4689
+
4690
+
4691
+ /***/ }),
4692
+
4693
+ /***/ 872:
4694
+ /***/ ((__unused_webpack_module, exports) => {
4695
+
4660
4696
 
4661
4697
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4662
4698
  exports.NthRoot = void 0;
@@ -4765,18 +4801,41 @@ class NthRoot {
4765
4801
  }
4766
4802
  }
4767
4803
  }
4804
+ get display() {
4805
+ let C;
4806
+ if (this._coefficient === 1) {
4807
+ C = '';
4808
+ }
4809
+ else if (this._coefficient === -1) {
4810
+ C = '-';
4811
+ }
4812
+ else {
4813
+ C = this._coefficient.toString();
4814
+ }
4815
+ if (this._radical === 1) {
4816
+ return `${this._coefficient}`;
4817
+ }
4818
+ else {
4819
+ if (this._nth === 2) {
4820
+ return `${C}sqrt{${this._radical}}`;
4821
+ }
4822
+ else {
4823
+ return `${C}root(${this._nth}){${this._radical}}`;
4824
+ }
4825
+ }
4826
+ }
4768
4827
  get value() {
4769
4828
  return this._coefficient * Math.pow(this._radical, 1 / this._nth);
4770
4829
  }
4771
4830
  }
4772
4831
  exports.NthRoot = NthRoot;
4773
-
4774
-
4775
- /***/ }),
4776
-
4777
- /***/ 735:
4778
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4779
-
4832
+
4833
+
4834
+ /***/ }),
4835
+
4836
+ /***/ 735:
4837
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4838
+
4780
4839
 
4781
4840
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4782
4841
  exports.NumExp = void 0;
@@ -4947,13 +5006,13 @@ class NumExp {
4947
5006
  }
4948
5007
  }
4949
5008
  exports.NumExp = NumExp;
4950
-
4951
-
4952
- /***/ }),
4953
-
4954
- /***/ 75:
4955
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4956
-
5009
+
5010
+
5011
+ /***/ }),
5012
+
5013
+ /***/ 75:
5014
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5015
+
4957
5016
 
4958
5017
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4959
5018
  exports.PolynomExpProduct = exports.PolynomExpFactor = void 0;
@@ -5170,7 +5229,7 @@ class PolynomExpProduct {
5170
5229
  return this._integrateWithInternalDerivative(this._factors[1], this._factors[0], letter);
5171
5230
  }
5172
5231
  }
5173
-
5232
+ return;
5174
5233
  }
5175
5234
  applyMathFunction(mathFn) {
5176
5235
  this._fn = mathFn;
@@ -5195,17 +5254,17 @@ class PolynomExpProduct {
5195
5254
  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)));
5196
5255
  }
5197
5256
  }
5198
-
5257
+ return;
5199
5258
  }
5200
5259
  }
5201
5260
  exports.PolynomExpProduct = PolynomExpProduct;
5202
-
5203
-
5204
- /***/ }),
5205
-
5206
- /***/ 699:
5207
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5208
-
5261
+
5262
+
5263
+ /***/ }),
5264
+
5265
+ /***/ 699:
5266
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5267
+
5209
5268
 
5210
5269
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5211
5270
  exports.Circle = void 0;
@@ -5529,13 +5588,13 @@ class Circle {
5529
5588
  }
5530
5589
  }
5531
5590
  exports.Circle = Circle;
5532
-
5533
-
5534
- /***/ }),
5535
-
5536
- /***/ 9:
5537
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5538
-
5591
+
5592
+
5593
+ /***/ }),
5594
+
5595
+ /***/ 9:
5596
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5597
+
5539
5598
 
5540
5599
  /**
5541
5600
  * This class works for 2d line in a plane.
@@ -5779,14 +5838,14 @@ class Line {
5779
5838
  if (equ instanceof equation_1.Equation) {
5780
5839
  return equ.right.evaluate({ x: F });
5781
5840
  }
5782
-
5841
+ return;
5783
5842
  };
5784
5843
  this.getValueAtY = (value) => {
5785
5844
  const equ = this.equation.clone().isolate('x'), F = new fraction_1.Fraction(value);
5786
5845
  if (equ instanceof equation_1.Equation) {
5787
5846
  return equ.right.evaluate({ y: F });
5788
5847
  }
5789
-
5848
+ return;
5790
5849
  };
5791
5850
  this._exists = false;
5792
5851
  if (values.length > 0) {
@@ -5955,13 +6014,13 @@ class Line {
5955
6014
  exports.Line = Line;
5956
6015
  Line.PERPENDICULAR = LinePropriety.Perpendicular;
5957
6016
  Line.PARALLEL = LinePropriety.Parallel;
5958
-
5959
-
5960
- /***/ }),
5961
-
5962
- /***/ 557:
5963
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5964
-
6017
+
6018
+
6019
+ /***/ }),
6020
+
6021
+ /***/ 557:
6022
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6023
+
5965
6024
 
5966
6025
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5967
6026
  exports.Point = void 0;
@@ -6125,13 +6184,13 @@ Point.pmatrix = (a, b, c) => {
6125
6184
  return `\\begin{pmatrix} ${a.tex ? a.tex : a} \\\\ ${b.tex ? b.tex : b} \\\\ ${c.tex ? c.tex : c} \\end{pmatrix}`;
6126
6185
  }
6127
6186
  };
6128
-
6129
-
6130
- /***/ }),
6131
-
6132
- /***/ 164:
6133
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6134
-
6187
+
6188
+
6189
+ /***/ }),
6190
+
6191
+ /***/ 164:
6192
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6193
+
6135
6194
 
6136
6195
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6137
6196
  exports.Triangle = void 0;
@@ -6400,13 +6459,13 @@ class Triangle {
6400
6459
  }
6401
6460
  }
6402
6461
  exports.Triangle = Triangle;
6403
-
6404
-
6405
- /***/ }),
6406
-
6407
- /***/ 586:
6408
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6409
-
6462
+
6463
+
6464
+ /***/ }),
6465
+
6466
+ /***/ 586:
6467
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6468
+
6410
6469
 
6411
6470
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6412
6471
  exports.Vector = void 0;
@@ -6584,13 +6643,13 @@ Vector.scalarProduct = (v1, v2) => {
6584
6643
  // TODO: Transform to fraction with nthroot.
6585
6644
  return v1.x.value * v2.x.value + v1.y.value * v2.y.value;
6586
6645
  };
6587
-
6588
-
6589
- /***/ }),
6590
-
6591
- /***/ 956:
6592
- /***/ ((__unused_webpack_module, exports) => {
6593
-
6646
+
6647
+
6648
+ /***/ }),
6649
+
6650
+ /***/ 956:
6651
+ /***/ ((__unused_webpack_module, exports) => {
6652
+
6594
6653
 
6595
6654
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6596
6655
  exports.Numeric = void 0;
@@ -6751,13 +6810,13 @@ class Numeric {
6751
6810
  }
6752
6811
  }
6753
6812
  exports.Numeric = Numeric;
6754
-
6755
-
6756
- /***/ }),
6757
-
6758
- /***/ 330:
6759
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6760
-
6813
+
6814
+
6815
+ /***/ }),
6816
+
6817
+ /***/ 330:
6818
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6819
+
6761
6820
 
6762
6821
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6763
6822
  if (k2 === undefined) k2 = k;
@@ -6823,13 +6882,13 @@ var Random;
6823
6882
  }
6824
6883
  Random.shuffle = shuffle;
6825
6884
  })(Random = exports.Random || (exports.Random = {}));
6826
-
6827
-
6828
- /***/ }),
6829
-
6830
- /***/ 373:
6831
- /***/ ((__unused_webpack_module, exports) => {
6832
-
6885
+
6886
+
6887
+ /***/ }),
6888
+
6889
+ /***/ 373:
6890
+ /***/ ((__unused_webpack_module, exports) => {
6891
+
6833
6892
 
6834
6893
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6835
6894
  exports.randomCore = void 0;
@@ -6851,13 +6910,13 @@ class randomCore {
6851
6910
  }
6852
6911
  }
6853
6912
  exports.randomCore = randomCore;
6854
-
6855
-
6856
- /***/ }),
6857
-
6858
- /***/ 754:
6859
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6860
-
6913
+
6914
+
6915
+ /***/ }),
6916
+
6917
+ /***/ 754:
6918
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6919
+
6861
6920
 
6862
6921
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6863
6922
  exports.rndFraction = void 0;
@@ -6901,13 +6960,13 @@ class rndFraction extends randomCore_1.randomCore {
6901
6960
  }
6902
6961
  }
6903
6962
  exports.rndFraction = rndFraction;
6904
-
6905
-
6906
- /***/ }),
6907
-
6908
- /***/ 140:
6909
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6910
-
6963
+
6964
+
6965
+ /***/ }),
6966
+
6967
+ /***/ 140:
6968
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6969
+
6911
6970
 
6912
6971
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6913
6972
  exports.rndHelpers = void 0;
@@ -6984,13 +7043,13 @@ class rndHelpers {
6984
7043
  }
6985
7044
  }
6986
7045
  exports.rndHelpers = rndHelpers;
6987
-
6988
-
6989
- /***/ }),
6990
-
6991
- /***/ 793:
6992
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6993
-
7046
+
7047
+
7048
+ /***/ }),
7049
+
7050
+ /***/ 793:
7051
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7052
+
6994
7053
 
6995
7054
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6996
7055
  exports.rndMonom = void 0;
@@ -7043,13 +7102,13 @@ class rndMonom extends randomCore_1.randomCore {
7043
7102
  }
7044
7103
  }
7045
7104
  exports.rndMonom = rndMonom;
7046
-
7047
-
7048
- /***/ }),
7049
-
7050
- /***/ 22:
7051
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7052
-
7105
+
7106
+
7107
+ /***/ }),
7108
+
7109
+ /***/ 22:
7110
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7111
+
7053
7112
 
7054
7113
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7055
7114
  exports.rndPolynom = void 0;
@@ -7124,22 +7183,22 @@ class rndPolynom extends randomCore_1.randomCore {
7124
7183
  }
7125
7184
  }
7126
7185
  exports.rndPolynom = rndPolynom;
7127
-
7128
-
7129
- /***/ }),
7130
-
7131
- /***/ 230:
7132
- /***/ ((__unused_webpack_module, exports) => {
7133
-
7186
+
7187
+
7188
+ /***/ }),
7189
+
7190
+ /***/ 230:
7191
+ /***/ ((__unused_webpack_module, exports) => {
7192
+
7134
7193
 
7135
7194
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7136
-
7137
-
7138
- /***/ }),
7139
-
7140
- /***/ 505:
7141
- /***/ ((__unused_webpack_module, exports) => {
7142
-
7195
+
7196
+
7197
+ /***/ }),
7198
+
7199
+ /***/ 505:
7200
+ /***/ ((__unused_webpack_module, exports) => {
7201
+
7143
7202
 
7144
7203
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7145
7204
  exports.Shutingyard = exports.ShutingyardMode = exports.ShutingyardType = exports.tokenConstant = void 0;
@@ -7566,43 +7625,43 @@ class Shutingyard {
7566
7625
  }
7567
7626
  }
7568
7627
  exports.Shutingyard = Shutingyard;
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
- ;
7628
+
7629
+
7630
+ /***/ })
7631
+
7632
+ /******/ });
7633
+ /************************************************************************/
7634
+ /******/ // The module cache
7635
+ /******/ var __webpack_module_cache__ = {};
7636
+ /******/
7637
+ /******/ // The require function
7638
+ /******/ function __webpack_require__(moduleId) {
7639
+ /******/ // Check if module is in cache
7640
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
7641
+ /******/ if (cachedModule !== undefined) {
7642
+ /******/ return cachedModule.exports;
7643
+ /******/ }
7644
+ /******/ // Create a new module (and put it into the cache)
7645
+ /******/ var module = __webpack_module_cache__[moduleId] = {
7646
+ /******/ // no module.id needed
7647
+ /******/ // no module.loaded needed
7648
+ /******/ exports: {}
7649
+ /******/ };
7650
+ /******/
7651
+ /******/ // Execute the module function
7652
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
7653
+ /******/
7654
+ /******/ // Return the exports of the module
7655
+ /******/ return module.exports;
7656
+ /******/ }
7657
+ /******/
7658
+ /************************************************************************/
7659
+ /******/
7660
+ /******/ // startup
7661
+ /******/ // Load entry module and return exports
7662
+ /******/ // This entry module is referenced by other modules so it can't be inlined
7663
+ /******/ var __webpack_exports__ = __webpack_require__(607);
7664
+ /******/
7665
+ /******/ })()
7666
+ ;
7608
7667
  //# sourceMappingURL=pi.js.map