pimath 0.0.68 → 0.0.71

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 (70) hide show
  1. package/dist/pi.js +8 -2
  2. package/dist/pi.js.map +1 -1
  3. package/dist/pi.min.js +1 -1
  4. package/dist/pi.min.js.map +1 -1
  5. package/esm/maths/algebra/equation.js +1 -1
  6. package/esm/maths/algebra/equation.js.map +1 -1
  7. package/esm/maths/algebra/polynom.js +1 -1
  8. package/esm/maths/algebra/polynom.js.map +1 -1
  9. package/esm/maths/coefficients/fraction.d.ts +1 -0
  10. package/esm/maths/coefficients/fraction.js +3 -0
  11. package/esm/maths/coefficients/fraction.js.map +1 -1
  12. package/esm/maths/expressions/expression.d.ts +6 -0
  13. package/esm/maths/expressions/expression.js +79 -1
  14. package/esm/maths/expressions/expression.js.map +1 -1
  15. package/esm/maths/expressions/expressionFactor.d.ts +8 -1
  16. package/esm/maths/expressions/expressionFactor.js +51 -4
  17. package/esm/maths/expressions/expressionFactor.js.map +1 -1
  18. package/esm/maths/expressions/expressionMember.d.ts +12 -1
  19. package/esm/maths/expressions/expressionMember.js +128 -19
  20. package/esm/maths/expressions/expressionMember.js.map +1 -1
  21. package/esm/maths/expressions/expressionParser.d.ts +2 -0
  22. package/esm/maths/expressions/expressionParser.js +74 -34
  23. package/esm/maths/expressions/expressionParser.js.map +1 -1
  24. package/esm/maths/expressions/factors/ExpFactor.d.ts +2 -2
  25. package/esm/maths/expressions/factors/ExpFactor.js +15 -3
  26. package/esm/maths/expressions/factors/ExpFactor.js.map +1 -1
  27. package/esm/maths/expressions/factors/ExpFactorConstant.d.ts +1 -0
  28. package/esm/maths/expressions/factors/ExpFactorConstant.js +3 -0
  29. package/esm/maths/expressions/factors/ExpFactorConstant.js.map +1 -1
  30. package/esm/maths/expressions/factors/ExpFactorExponential.d.ts +1 -0
  31. package/esm/maths/expressions/factors/ExpFactorExponential.js +4 -0
  32. package/esm/maths/expressions/factors/ExpFactorExponential.js.map +1 -1
  33. package/esm/maths/expressions/factors/ExpFactorNumber.d.ts +3 -2
  34. package/esm/maths/expressions/factors/ExpFactorNumber.js +23 -0
  35. package/esm/maths/expressions/factors/ExpFactorNumber.js.map +1 -1
  36. package/esm/maths/expressions/factors/ExpFactorPower.d.ts +5 -1
  37. package/esm/maths/expressions/factors/ExpFactorPower.js +15 -2
  38. package/esm/maths/expressions/factors/ExpFactorPower.js.map +1 -1
  39. package/esm/maths/expressions/factors/ExpFactorTrigo.d.ts +1 -0
  40. package/esm/maths/expressions/factors/ExpFactorTrigo.js +8 -0
  41. package/esm/maths/expressions/factors/ExpFactorTrigo.js.map +1 -1
  42. package/esm/maths/expressions/factors/ExpFactorVariable.d.ts +1 -0
  43. package/esm/maths/expressions/factors/ExpFactorVariable.js +3 -0
  44. package/esm/maths/expressions/factors/ExpFactorVariable.js.map +1 -1
  45. package/esm/maths/expressions/polynomexp.bkp.js +0 -1
  46. package/esm/maths/expressions/polynomexp.bkp.js.map +1 -1
  47. package/esm/maths/shutingyard.js +3 -0
  48. package/esm/maths/shutingyard.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/maths/algebra/equation.ts +1 -1
  51. package/src/maths/algebra/polynom.ts +1 -1
  52. package/src/maths/coefficients/fraction.ts +4 -0
  53. package/src/maths/expressions/expression.ts +115 -20
  54. package/src/maths/expressions/expressionFactor.ts +59 -7
  55. package/src/maths/expressions/expressionMember.ts +141 -22
  56. package/src/maths/expressions/expressionParser.ts +79 -33
  57. package/src/maths/expressions/factors/ExpFactor.ts +19 -6
  58. package/src/maths/expressions/factors/ExpFactorConstant.ts +4 -0
  59. package/src/maths/expressions/factors/ExpFactorExponential.ts +7 -0
  60. package/src/maths/expressions/factors/ExpFactorNumber.ts +32 -4
  61. package/src/maths/expressions/factors/ExpFactorPower.ts +21 -3
  62. package/src/maths/expressions/factors/ExpFactorTrigo.ts +10 -1
  63. package/src/maths/expressions/factors/ExpFactorVariable.ts +5 -0
  64. package/src/maths/expressions/polynomexp.bkp.ts +0 -1
  65. package/src/maths/shutingyard.ts +4 -1
  66. package/tests/expressions/expressions.test.ts +24 -3
  67. package/tests/geometry/circle.test.ts +6 -0
  68. package/esm/maths/expressions/factors/ExpFactorSin.d.ts +0 -7
  69. package/esm/maths/expressions/factors/ExpFactorSin.js +0 -22
  70. package/esm/maths/expressions/factors/ExpFactorSin.js.map +0 -1
package/dist/pi.js CHANGED
@@ -437,7 +437,7 @@ class Equation {
437
437
  s = `\\left${this.isAlsoEqual() ? '[' : ']'}${v.tex};+\\infty\\right[`;
438
438
  }
439
439
  else {
440
- s = `\\left]-\\infty;${v.tex} \\right\\${this.isAlsoEqual() ? ']' : '['}`;
440
+ s = `\\left]-\\infty;${v.tex} \\right${this.isAlsoEqual() ? ']' : '['}`;
441
441
  }
442
442
  }
443
443
  this._solutions = [{
@@ -2191,7 +2191,7 @@ class Polynom {
2191
2191
  }
2192
2192
  else if (element.token === '^') {
2193
2193
  if (b.degree().isStrictlyPositive()) {
2194
- console.error('Cannot elevate a polynom with another polynom !');
2194
+ console.error('Cannot elevate a polynom with another polynom !', a.tex, b.tex);
2195
2195
  }
2196
2196
  else {
2197
2197
  if (b.monoms[0].coefficient.isRelative()) {
@@ -4381,6 +4381,9 @@ class Fraction {
4381
4381
  return this.value.toFixed(3);
4382
4382
  }
4383
4383
  }
4384
+ get texWithSign() {
4385
+ return this.isPositive() ? `+${this.tex}` : this.tex;
4386
+ }
4384
4387
  get display() {
4385
4388
  if (this.isExact()) {
4386
4389
  if (this._denominator === 1) {
@@ -7002,6 +7005,9 @@ class Shutingyard {
7002
7005
  return [token, start + token.length, tokenType];
7003
7006
  }
7004
7007
  normalize(expr) {
7008
+ if (expr.length === 1) {
7009
+ return expr;
7010
+ }
7005
7011
  // Get the list of function token.
7006
7012
  let fnToken = [], kToken = [];
7007
7013
  for (let token in this._tokenConfig) {