pimath 0.0.69 → 0.0.72
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/.idea/misc.xml +0 -5
- package/dist/pi.js +18 -1
- 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/polynom.js +1 -1
- package/esm/maths/algebra/polynom.js.map +1 -1
- package/esm/maths/coefficients/fraction.d.ts +2 -0
- package/esm/maths/coefficients/fraction.js +14 -0
- package/esm/maths/coefficients/fraction.js.map +1 -1
- package/esm/maths/expressions/expression.d.ts +6 -0
- package/esm/maths/expressions/expression.js +79 -1
- package/esm/maths/expressions/expression.js.map +1 -1
- package/esm/maths/expressions/expressionFactor.d.ts +8 -1
- package/esm/maths/expressions/expressionFactor.js +51 -4
- package/esm/maths/expressions/expressionFactor.js.map +1 -1
- package/esm/maths/expressions/expressionMember.d.ts +12 -1
- package/esm/maths/expressions/expressionMember.js +128 -19
- package/esm/maths/expressions/expressionMember.js.map +1 -1
- package/esm/maths/expressions/expressionParser.d.ts +2 -0
- package/esm/maths/expressions/expressionParser.js +74 -34
- package/esm/maths/expressions/expressionParser.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactor.d.ts +2 -2
- package/esm/maths/expressions/factors/ExpFactor.js +15 -3
- package/esm/maths/expressions/factors/ExpFactor.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorConstant.d.ts +1 -0
- package/esm/maths/expressions/factors/ExpFactorConstant.js +3 -0
- package/esm/maths/expressions/factors/ExpFactorConstant.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorExponential.d.ts +1 -0
- package/esm/maths/expressions/factors/ExpFactorExponential.js +4 -0
- package/esm/maths/expressions/factors/ExpFactorExponential.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorNumber.d.ts +3 -2
- package/esm/maths/expressions/factors/ExpFactorNumber.js +23 -0
- package/esm/maths/expressions/factors/ExpFactorNumber.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorPower.d.ts +5 -1
- package/esm/maths/expressions/factors/ExpFactorPower.js +15 -2
- package/esm/maths/expressions/factors/ExpFactorPower.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorTrigo.d.ts +1 -0
- package/esm/maths/expressions/factors/ExpFactorTrigo.js +8 -0
- package/esm/maths/expressions/factors/ExpFactorTrigo.js.map +1 -1
- package/esm/maths/expressions/factors/ExpFactorVariable.d.ts +1 -0
- package/esm/maths/expressions/factors/ExpFactorVariable.js +3 -0
- package/esm/maths/expressions/factors/ExpFactorVariable.js.map +1 -1
- package/esm/maths/expressions/polynomexp.bkp.js +0 -1
- package/esm/maths/expressions/polynomexp.bkp.js.map +1 -1
- package/esm/maths/shutingyard.js +3 -0
- package/esm/maths/shutingyard.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/algebra/polynom.ts +1 -1
- package/src/maths/coefficients/fraction.ts +17 -0
- package/src/maths/expressions/expression.ts +115 -20
- package/src/maths/expressions/expressionFactor.ts +59 -7
- package/src/maths/expressions/expressionMember.ts +141 -22
- package/src/maths/expressions/expressionParser.ts +79 -33
- package/src/maths/expressions/factors/ExpFactor.ts +19 -6
- package/src/maths/expressions/factors/ExpFactorConstant.ts +4 -0
- package/src/maths/expressions/factors/ExpFactorExponential.ts +7 -0
- package/src/maths/expressions/factors/ExpFactorNumber.ts +32 -4
- package/src/maths/expressions/factors/ExpFactorPower.ts +21 -3
- package/src/maths/expressions/factors/ExpFactorTrigo.ts +10 -1
- package/src/maths/expressions/factors/ExpFactorVariable.ts +5 -0
- package/src/maths/expressions/polynomexp.bkp.ts +0 -1
- package/src/maths/shutingyard.ts +4 -1
- package/tests/coefficients/fraction.test.ts +11 -0
- package/tests/expressions/expressions.test.ts +24 -3
- package/tests/geometry/circle.test.ts +6 -0
- package/esm/maths/expressions/factors/ExpFactorSin.d.ts +0 -7
- package/esm/maths/expressions/factors/ExpFactorSin.js +0 -22
- package/esm/maths/expressions/factors/ExpFactorSin.js.map +0 -1
package/.idea/misc.xml
CHANGED
package/dist/pi.js
CHANGED
|
@@ -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()) {
|
|
@@ -4120,6 +4120,17 @@ class Fraction {
|
|
|
4120
4120
|
this._denominator = this._denominator * Q.denominator;
|
|
4121
4121
|
return this.reduce();
|
|
4122
4122
|
};
|
|
4123
|
+
this.xMultiply = (...values) => {
|
|
4124
|
+
// Parse the value.
|
|
4125
|
+
// If it's a fraction, return a clone of it
|
|
4126
|
+
// If it's an integer, return the fraction F/1
|
|
4127
|
+
for (let value of values) {
|
|
4128
|
+
let F = new Fraction(value);
|
|
4129
|
+
this._numerator = this._numerator * F.numerator;
|
|
4130
|
+
this._denominator = this._denominator * F.denominator;
|
|
4131
|
+
}
|
|
4132
|
+
return this;
|
|
4133
|
+
};
|
|
4123
4134
|
this.divide = (F) => {
|
|
4124
4135
|
let Q = new Fraction(F);
|
|
4125
4136
|
if (Q.numerator === 0) {
|
|
@@ -4381,6 +4392,9 @@ class Fraction {
|
|
|
4381
4392
|
return this.value.toFixed(3);
|
|
4382
4393
|
}
|
|
4383
4394
|
}
|
|
4395
|
+
get texWithSign() {
|
|
4396
|
+
return this.isPositive() ? `+${this.tex}` : this.tex;
|
|
4397
|
+
}
|
|
4384
4398
|
get display() {
|
|
4385
4399
|
if (this.isExact()) {
|
|
4386
4400
|
if (this._denominator === 1) {
|
|
@@ -7002,6 +7016,9 @@ class Shutingyard {
|
|
|
7002
7016
|
return [token, start + token.length, tokenType];
|
|
7003
7017
|
}
|
|
7004
7018
|
normalize(expr) {
|
|
7019
|
+
if (expr.length === 1) {
|
|
7020
|
+
return expr;
|
|
7021
|
+
}
|
|
7005
7022
|
// Get the list of function token.
|
|
7006
7023
|
let fnToken = [], kToken = [];
|
|
7007
7024
|
for (let token in this._tokenConfig) {
|