pimath 0.0.65 → 0.0.66

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
@@ -3829,21 +3829,23 @@ class RationalStudy extends study_1.Study {
3829
3829
  tex: tex,
3830
3830
  zero: zero,
3831
3831
  limits: `\\lim_{x\\to${zero.tex} }\\ f(x) = \\pm\\infty`,
3832
- deltaX: null
3832
+ deltaX: null,
3833
+ tableOfSign: null
3833
3834
  });
3834
3835
  });
3835
3836
  // Sloped asymptote
3836
3837
  let NDegree = this.fx.numerator.degree(), DDegree = this.fx.denominator.degree();
3837
3838
  if (NDegree.isEqual(DDegree)) {
3838
3839
  let H = this.fx.numerator.monomByDegree().coefficient.clone().divide(this.fx.denominator.monomByDegree().coefficient), Htex = H.tex;
3839
- let { reminder } = reduced.euclidian();
3840
+ let { reminder } = reduced.euclidian(), deltaX = new rational_1.Rational(reminder, reduced.denominator);
3840
3841
  asymptotes.push({
3841
3842
  fx: new polynom_1.Polynom(H),
3842
3843
  type: study_1.ASYMPTOTE.HORIZONTAL,
3843
3844
  tex: `y=${Htex}`,
3844
3845
  zero: null,
3845
3846
  limits: `\\lim_{x\\to\\infty}\\ f(x) = ${Htex}`,
3846
- deltaX: new rational_1.Rational(reminder, reduced.denominator)
3847
+ deltaX,
3848
+ tableOfSign: this._getSigns(deltaX)
3847
3849
  });
3848
3850
  }
3849
3851
  else if (DDegree.greater(NDegree)) {
@@ -3853,19 +3855,21 @@ class RationalStudy extends study_1.Study {
3853
3855
  tex: `y=0`,
3854
3856
  zero: null,
3855
3857
  limits: `\\lim_{x\\to\\infty}\\ f(x) = ${0}`,
3856
- deltaX: null
3858
+ deltaX: null,
3859
+ tableOfSign: null
3857
3860
  });
3858
3861
  }
3859
3862
  else if (NDegree.value - 1 === DDegree.value) {
3860
3863
  // Calculate the slope
3861
- let { quotient, reminder } = reduced.euclidian();
3864
+ let { quotient, reminder } = reduced.euclidian(), deltaX = new rational_1.Rational(reminder, reduced.denominator);
3862
3865
  asymptotes.push({
3863
3866
  fx: quotient.clone(),
3864
3867
  type: study_1.ASYMPTOTE.SLOPE,
3865
3868
  tex: `y=${quotient.tex}`,
3866
3869
  zero: null,
3867
3870
  limits: ``,
3868
- deltaX: new rational_1.Rational(reminder, reduced.denominator)
3871
+ deltaX: new rational_1.Rational(reminder, reduced.denominator),
3872
+ tableOfSign: this._getSigns(deltaX)
3869
3873
  });
3870
3874
  }
3871
3875
  return asymptotes;
@@ -3924,6 +3928,9 @@ class RationalStudy extends study_1.Study {
3924
3928
  _getSigns(fx, zeroes, typeOfTable) {
3925
3929
  // Factorize the rational
3926
3930
  let signs = [], factors = [];
3931
+ if (zeroes === undefined) {
3932
+ zeroes = this._getZeroes(fx);
3933
+ }
3927
3934
  fx.numerator.factors.forEach(factor => {
3928
3935
  signs.push(this.makeOneLineForSigns(factor, zeroes, study_1.ZEROTYPE.ZERO));
3929
3936
  factors.push(factor.clone());