pimath 0.0.63 → 0.0.64
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 +20 -14
- package/dist/pi.js.map +1 -1
- package/dist/pi.min.js +1 -1
- package/dist/pi.min.js.map +1 -1
- package/esm/maths/algebra/rational.d.ts +0 -1
- package/esm/maths/algebra/rational.js +1 -2
- package/esm/maths/algebra/study/rationalStudy.d.ts +1 -7
- package/esm/maths/algebra/study/rationalStudy.js +6 -6
- package/esm/maths/algebra/study/rationalStudy.js.map +1 -1
- package/esm/maths/algebra/study.d.ts +11 -16
- package/esm/maths/algebra/study.js +17 -8
- package/esm/maths/algebra/study.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/algebra/study/rationalStudy.ts +6 -9
- package/src/maths/algebra/study.ts +17 -8
- package/tests/algebra/study.test.ts +1 -1
package/dist/pi.js
CHANGED
|
@@ -3493,6 +3493,9 @@ class Study {
|
|
|
3493
3493
|
this._asymptotes = this.makeAsymptotes();
|
|
3494
3494
|
this._derivative = this.makeDerivative();
|
|
3495
3495
|
this._variations = this.makeVariation();
|
|
3496
|
+
this._signs.tex = this.texSigns;
|
|
3497
|
+
this._derivative.tex = this.texGrows;
|
|
3498
|
+
this._variations.tex = this.texVariations;
|
|
3496
3499
|
};
|
|
3497
3500
|
this.indexOfZero = (zeroes, zero) => {
|
|
3498
3501
|
for (let i = 0; i < zeroes.length; i++) {
|
|
@@ -3559,7 +3562,7 @@ class Study {
|
|
|
3559
3562
|
}
|
|
3560
3563
|
return resultLine;
|
|
3561
3564
|
};
|
|
3562
|
-
this.makeGrowsResult = (
|
|
3565
|
+
this.makeGrowsResult = (tos) => {
|
|
3563
3566
|
// Use the last line (=> resultLine) to grab the necessary information
|
|
3564
3567
|
let signsAsArray = Object.values(tos.signs), resultLine = signsAsArray[signsAsArray.length - 1], growsLine = [], extremes = {}, zeroes = tos.zeroes;
|
|
3565
3568
|
// Get the extremes
|
|
@@ -3570,7 +3573,7 @@ class Study {
|
|
|
3570
3573
|
// It's a zero. Get the coordinates
|
|
3571
3574
|
let x, y, zero = zeroes[i].exact, pt, xTex, yTex, pointType;
|
|
3572
3575
|
if (zero instanceof fraction_1.Fraction) {
|
|
3573
|
-
let value = zero, evalY = fx.evaluate(value);
|
|
3576
|
+
let value = zero, evalY = this.fx.evaluate(value);
|
|
3574
3577
|
x = zero.value;
|
|
3575
3578
|
y = evalY.value;
|
|
3576
3579
|
xTex = zero.tex;
|
|
@@ -3578,7 +3581,7 @@ class Study {
|
|
|
3578
3581
|
}
|
|
3579
3582
|
else {
|
|
3580
3583
|
x = zeroes[i].value;
|
|
3581
|
-
y = fx.evaluate(zeroes[i].value).value;
|
|
3584
|
+
y = this.fx.evaluate(zeroes[i].value).value;
|
|
3582
3585
|
xTex = x.toFixed(2);
|
|
3583
3586
|
yTex = y.toFixed(2);
|
|
3584
3587
|
}
|
|
@@ -3616,7 +3619,7 @@ class Study {
|
|
|
3616
3619
|
growsLine.push(`${resultLine[resultLine.length - 2]}/`);
|
|
3617
3620
|
return { growsLine, extremes };
|
|
3618
3621
|
};
|
|
3619
|
-
this.makeVariationsResult = (
|
|
3622
|
+
this.makeVariationsResult = (tos) => {
|
|
3620
3623
|
// TODO: make variations result is not yet implemented.
|
|
3621
3624
|
let extremes = {}, varsLine = [];
|
|
3622
3625
|
return { varsLine, extremes };
|
|
@@ -3669,7 +3672,7 @@ class Study {
|
|
|
3669
3672
|
get derivative() {
|
|
3670
3673
|
return this._derivative;
|
|
3671
3674
|
}
|
|
3672
|
-
get
|
|
3675
|
+
get texSigns() {
|
|
3673
3676
|
return this._makeTexFromTableOfSigns(this._signs);
|
|
3674
3677
|
}
|
|
3675
3678
|
get texGrows() {
|
|
@@ -3689,7 +3692,8 @@ class Study {
|
|
|
3689
3692
|
factors: [],
|
|
3690
3693
|
zeroes: [],
|
|
3691
3694
|
signs: [],
|
|
3692
|
-
extremes: {}
|
|
3695
|
+
extremes: {},
|
|
3696
|
+
tex: ''
|
|
3693
3697
|
};
|
|
3694
3698
|
}
|
|
3695
3699
|
;
|
|
@@ -3703,7 +3707,8 @@ class Study {
|
|
|
3703
3707
|
factors: [],
|
|
3704
3708
|
zeroes: [],
|
|
3705
3709
|
signs: [],
|
|
3706
|
-
extremes: {}
|
|
3710
|
+
extremes: {},
|
|
3711
|
+
tex: ''
|
|
3707
3712
|
};
|
|
3708
3713
|
}
|
|
3709
3714
|
makeVariation() {
|
|
@@ -3713,7 +3718,8 @@ class Study {
|
|
|
3713
3718
|
factors: [],
|
|
3714
3719
|
zeroes: [],
|
|
3715
3720
|
signs: [],
|
|
3716
|
-
extremes: {}
|
|
3721
|
+
extremes: {},
|
|
3722
|
+
tex: ''
|
|
3717
3723
|
};
|
|
3718
3724
|
}
|
|
3719
3725
|
}
|
|
@@ -3748,7 +3754,6 @@ const rational_1 = __webpack_require__(107);
|
|
|
3748
3754
|
const fraction_1 = __webpack_require__(506);
|
|
3749
3755
|
class RationalStudy extends study_1.Study {
|
|
3750
3756
|
constructor(fx) {
|
|
3751
|
-
console.log('RATIONAL STUDY');
|
|
3752
3757
|
super(fx);
|
|
3753
3758
|
return this;
|
|
3754
3759
|
}
|
|
@@ -3758,7 +3763,8 @@ class RationalStudy extends study_1.Study {
|
|
|
3758
3763
|
}
|
|
3759
3764
|
;
|
|
3760
3765
|
makeSigns() {
|
|
3761
|
-
|
|
3766
|
+
let tos = this._getSigns(this.fx, this.zeroes);
|
|
3767
|
+
return tos;
|
|
3762
3768
|
}
|
|
3763
3769
|
;
|
|
3764
3770
|
makeAsymptotes() {
|
|
@@ -3828,17 +3834,16 @@ class RationalStudy extends study_1.Study {
|
|
|
3828
3834
|
makeDerivative() {
|
|
3829
3835
|
let dx = this.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.GROWS);
|
|
3830
3836
|
console.log(tos.factors.length, tos.signs.length);
|
|
3831
|
-
let result = this.makeGrowsResult(
|
|
3837
|
+
let result = this.makeGrowsResult(tos);
|
|
3832
3838
|
tos.signs.push(result.growsLine);
|
|
3833
3839
|
tos.extremes = result.extremes;
|
|
3834
|
-
console.log(tos.signs.length);
|
|
3835
3840
|
return tos;
|
|
3836
3841
|
}
|
|
3837
3842
|
;
|
|
3838
3843
|
makeVariation() {
|
|
3839
3844
|
// Get the zeroes, make signs.
|
|
3840
3845
|
let dx = this.derivative.fx.clone().derivative(), tos = this._getSigns(dx, this._getZeroes(dx), study_1.TABLE_OF_SIGNS.VARIATIONS);
|
|
3841
|
-
let result = this.makeVariationsResult(
|
|
3846
|
+
let result = this.makeVariationsResult(tos);
|
|
3842
3847
|
tos.signs.push(result.varsLine);
|
|
3843
3848
|
tos.extremes = result.extremes;
|
|
3844
3849
|
return tos;
|
|
@@ -3895,7 +3900,8 @@ class RationalStudy extends study_1.Study {
|
|
|
3895
3900
|
factors,
|
|
3896
3901
|
zeroes,
|
|
3897
3902
|
signs,
|
|
3898
|
-
extremes: {}
|
|
3903
|
+
extremes: {},
|
|
3904
|
+
tex: ''
|
|
3899
3905
|
};
|
|
3900
3906
|
}
|
|
3901
3907
|
}
|