pimath 0.0.123 → 0.0.125
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/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30_[Default_Changelist]/shelved.patch +192 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30_[Default_Changelist]1/shelved.patch +0 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30__Default_Changelist_.xml +4 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_10_43_[Default_Changelist]/shelved.patch +2404 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_10_43__Default_Changelist_.xml +4 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01_[Default_Changelist]/shelved.patch +1362 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01__Default_Changelist_.xml +4 -0
- package/dist/pimath.js +53 -14
- package/dist/pimath.js.map +1 -1
- package/dist/pimath.min.js +1 -1
- package/dist/pimath.min.js.map +1 -1
- package/esm/maths/algebra/rational.d.ts +1 -0
- package/esm/maths/algebra/rational.js +12 -1
- package/esm/maths/algebra/rational.js.map +1 -1
- package/esm/maths/geometry/triangle.d.ts +6 -0
- package/esm/maths/geometry/triangle.js +14 -7
- package/esm/maths/geometry/triangle.js.map +1 -1
- package/esm/maths/randomization/random.d.ts +1 -1
- package/esm/maths/randomization/random.js +2 -2
- package/esm/maths/randomization/random.js.map +1 -1
- package/esm/maths/randomization/rndHelpers.d.ts +1 -1
- package/esm/maths/randomization/rndHelpers.js +25 -4
- package/esm/maths/randomization/rndHelpers.js.map +1 -1
- package/package.json +8 -8
- package/src/maths/algebra/rational.ts +13 -1
- package/src/maths/geometry/triangle.ts +24 -8
- package/src/maths/randomization/random.ts +2 -2
- package/src/maths/randomization/rndHelpers.ts +49 -18
- package/tests/algebra/rationnal.test.ts +5 -0
- package/tests/geometry/circle.test.ts +125 -10
- package/tests/numexp.test.ts +15 -2
- package/dev/pimath.js +0 -7935
- package/dev/pimath.js.map +0 -1
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -78
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1367
- package/docs/classes/Logicalset.Logicalset.html +0 -221
- package/docs/classes/Polynom.Rational.html +0 -391
- package/docs/classes/Vector-1.Vector.html +0 -494
- package/docs/classes/Vector.Point.html +0 -341
- package/docs/classes/algebra_equation.Equation.html +0 -796
- package/docs/classes/algebra_linearSystem.LinearSystem.html +0 -408
- package/docs/classes/algebra_monom.Monom.html +0 -967
- package/docs/classes/algebra_polynom.Polynom.html +0 -1281
- package/docs/classes/coefficients_fraction.Fraction.html +0 -939
- package/docs/classes/geometry_circle.Circle.html +0 -476
- package/docs/classes/geometry_line.Line.html +0 -779
- package/docs/classes/geometry_triangle.Triangle.html +0 -429
- package/docs/classes/numeric.Numeric.html +0 -269
- package/docs/classes/shutingyard.Shutingyard.html +0 -259
- package/docs/enums/algebra_equation.PARTICULAR_SOLUTION.html +0 -89
- package/docs/enums/geometry_line.LinePropriety.html +0 -102
- package/docs/enums/shutingyard.ShutingyardMode.html +0 -106
- package/docs/enums/shutingyard.ShutingyardType.html +0 -120
- package/docs/index.html +0 -63
- package/docs/interfaces/algebra_equation.ISolution.html +0 -111
- package/docs/interfaces/algebra_polynom.IEuclidian.html +0 -93
- package/docs/interfaces/geometry_triangle.remarquableLines.html +0 -150
- package/docs/modules/Logicalset.html +0 -69
- package/docs/modules/Polynom.html +0 -69
- package/docs/modules/Vector-1.html +0 -69
- package/docs/modules/Vector.html +0 -69
- package/docs/modules/algebra_equation.html +0 -75
- package/docs/modules/algebra_linearSystem.html +0 -65
- package/docs/modules/algebra_monom.html +0 -70
- package/docs/modules/algebra_polynom.html +0 -75
- package/docs/modules/coefficients_fraction.html +0 -70
- package/docs/modules/geometry_circle.html +0 -65
- package/docs/modules/geometry_line.html +0 -70
- package/docs/modules/geometry_triangle.html +0 -70
- package/docs/modules/numeric.html +0 -65
- package/docs/modules/shutingyard.html +0 -84
- package/docs/types/algebra_monom.literalType.html +0 -66
- package/docs/types/algebra_polynom.PolynomParsingType.html +0 -62
- package/docs/types/coefficients_fraction.FractionParsingType.html +0 -61
- package/docs/types/shutingyard.Token.html +0 -72
- package/docs/types/shutingyard.tokenType.html +0 -77
- package/docs/variables/shutingyard.tokenConstant.html +0 -70
- package/esm/maths/expressions/ExpressionTree.d.ts +0 -17
- package/esm/maths/expressions/ExpressionTree.js +0 -150
- package/esm/maths/expressions/ExpressionTree.js.map +0 -1
- package/esm/maths/expressions/expression.d.ts +0 -27
- package/esm/maths/expressions/expression.js +0 -239
- package/esm/maths/expressions/expression.js.map +0 -1
- package/esm/maths/expressions/expressionFactor.d.ts +0 -36
- package/esm/maths/expressions/expressionFactor.js +0 -156
- package/esm/maths/expressions/expressionFactor.js.map +0 -1
- package/esm/maths/expressions/expressionMember.d.ts +0 -27
- package/esm/maths/expressions/expressionMember.js +0 -199
- package/esm/maths/expressions/expressionMember.js.map +0 -1
- package/esm/maths/expressions/expressionOperators.d.ts +0 -8
- package/esm/maths/expressions/expressionOperators.js +0 -42
- package/esm/maths/expressions/expressionOperators.js.map +0 -1
- package/esm/maths/expressions/expressionParser.d.ts +0 -14
- package/esm/maths/expressions/expressionParser.js +0 -259
- package/esm/maths/expressions/expressionParser.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactor.d.ts +0 -7
- package/esm/maths/expressions/factors/ExpFactor.js +0 -34
- package/esm/maths/expressions/factors/ExpFactor.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorConstant.d.ts +0 -14
- package/esm/maths/expressions/factors/ExpFactorConstant.js +0 -52
- package/esm/maths/expressions/factors/ExpFactorConstant.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorExponential.d.ts +0 -8
- package/esm/maths/expressions/factors/ExpFactorExponential.js +0 -22
- package/esm/maths/expressions/factors/ExpFactorExponential.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorNumber.d.ts +0 -14
- package/esm/maths/expressions/factors/ExpFactorNumber.js +0 -59
- package/esm/maths/expressions/factors/ExpFactorNumber.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorPower.d.ts +0 -13
- package/esm/maths/expressions/factors/ExpFactorPower.js +0 -35
- package/esm/maths/expressions/factors/ExpFactorPower.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorTrigo.d.ts +0 -20
- package/esm/maths/expressions/factors/ExpFactorTrigo.js +0 -48
- package/esm/maths/expressions/factors/ExpFactorTrigo.js.map +0 -1
- package/esm/maths/expressions/factors/ExpFactorVariable.d.ts +0 -13
- package/esm/maths/expressions/factors/ExpFactorVariable.js +0 -36
- package/esm/maths/expressions/factors/ExpFactorVariable.js.map +0 -1
- package/esm/maths/expressions/internals.d.ts +0 -12
- package/esm/maths/expressions/internals.js +0 -29
- package/esm/maths/expressions/internals.js.map +0 -1
- package/esm/maths/expressions/numexp.d.ts +0 -19
- package/esm/maths/expressions/numexp.js +0 -186
- package/esm/maths/expressions/numexp.js.map +0 -1
- package/esm/maths/expressions/polynomexp.bkp.d.ts +0 -33
- package/esm/maths/expressions/polynomexp.bkp.js +0 -184
- package/esm/maths/expressions/polynomexp.bkp.js.map +0 -1
- package/esm/maths/expressions/polynomexp.d.ts +0 -52
- package/esm/maths/expressions/polynomexp.js +0 -246
- package/esm/maths/expressions/polynomexp.js.map +0 -1
package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01__Default_Changelist_.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<changelist name="Uncommitted_changes_before_Checkout_at_09_11_2023_11_01_[Default_Changelist]" date="1699524101881" recycled="false" toDelete="true">
|
|
2
|
+
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01_[Default_Changelist]/shelved.patch" />
|
|
3
|
+
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 09.11.2023 11:01 [Default Changelist]" />
|
|
4
|
+
</changelist>
|
package/dist/pimath.js
CHANGED
|
@@ -3581,7 +3581,15 @@ class Rational {
|
|
|
3581
3581
|
this.reduce = () => {
|
|
3582
3582
|
this._numerator.factorize();
|
|
3583
3583
|
for (let f of this._numerator.factors) {
|
|
3584
|
-
|
|
3584
|
+
if (f.degree().isZero()) {
|
|
3585
|
+
// Do the simplify only if the factor can divide the denominator
|
|
3586
|
+
if (this._denominator.commonMonom().coefficient.clone().divide(f.monomByDegree().coefficient).isNatural()) {
|
|
3587
|
+
this.simplify(f);
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
else {
|
|
3591
|
+
this.simplify(f);
|
|
3592
|
+
}
|
|
3585
3593
|
}
|
|
3586
3594
|
return this;
|
|
3587
3595
|
};
|
|
@@ -3687,6 +3695,9 @@ class Rational {
|
|
|
3687
3695
|
get tex() {
|
|
3688
3696
|
return `\\frac{ ${this._numerator.tex} }{ ${this._denominator.tex} }`;
|
|
3689
3697
|
}
|
|
3698
|
+
get display() {
|
|
3699
|
+
return `(${this._numerator.display})/(${this._denominator.display})`;
|
|
3700
|
+
}
|
|
3690
3701
|
get texFactors() {
|
|
3691
3702
|
return `\\frac{ ${this._numerator.texFactors} }{ ${this._denominator.texFactors} }`;
|
|
3692
3703
|
}
|
|
@@ -6140,6 +6151,7 @@ class Triangle {
|
|
|
6140
6151
|
return new vector_1.Vector(this.getPointByName(ptName1), this.getPointByName(ptName2));
|
|
6141
6152
|
};
|
|
6142
6153
|
this._calculateRemarquableLines = () => {
|
|
6154
|
+
const bA = this._calculateBisectors('A'), bB = this._calculateBisectors('B'), bC = this._calculateBisectors('C');
|
|
6143
6155
|
let remarquables = {
|
|
6144
6156
|
'medians': {
|
|
6145
6157
|
'A': new line_1.Line(this._A, this._middles.BC),
|
|
@@ -6160,9 +6172,15 @@ class Triangle {
|
|
|
6160
6172
|
'intersection': null
|
|
6161
6173
|
},
|
|
6162
6174
|
'bisectors': {
|
|
6163
|
-
'A':
|
|
6164
|
-
'B':
|
|
6165
|
-
'C':
|
|
6175
|
+
'A': bA.internal,
|
|
6176
|
+
'B': bB.internal,
|
|
6177
|
+
'C': bB.internal,
|
|
6178
|
+
'intersection': null
|
|
6179
|
+
},
|
|
6180
|
+
externalBisectors: {
|
|
6181
|
+
'A': bA.external,
|
|
6182
|
+
'B': bB.external,
|
|
6183
|
+
'C': bC.external,
|
|
6166
6184
|
'intersection': null
|
|
6167
6185
|
}
|
|
6168
6186
|
};
|
|
@@ -6191,16 +6209,16 @@ class Triangle {
|
|
|
6191
6209
|
let b1 = new line_1.Line(new equation_1.Equation(d1.equation.left.clone().multiply(d2.n.simplify().norm), d2.equation.left.clone().multiply(d1.n.simplify().norm)).reorder(true).simplify()), b2 = new line_1.Line(new equation_1.Equation(d1.equation.left.clone().multiply(d2.n.simplify().norm), d2.equation.left.clone().multiply(d1.n.simplify().norm).opposed()).reorder(true).simplify());
|
|
6192
6210
|
// Must determine which bisectors is in the triangle
|
|
6193
6211
|
if (pt === 'A') {
|
|
6194
|
-
return b1.hitSegment(this.B, this.C) ? b1 : b2;
|
|
6212
|
+
return b1.hitSegment(this.B, this.C) ? { internal: b1, external: b2 } : { internal: b2, external: b1 };
|
|
6195
6213
|
}
|
|
6196
6214
|
if (pt === 'B') {
|
|
6197
|
-
return b1.hitSegment(this.A, this.C) ? b1 : b2;
|
|
6215
|
+
return b1.hitSegment(this.A, this.C) ? { internal: b1, external: b2 } : { internal: b2, external: b1 };
|
|
6198
6216
|
}
|
|
6199
6217
|
if (pt === 'C') {
|
|
6200
|
-
return b1.hitSegment(this.B, this.A) ? b1 : b2;
|
|
6218
|
+
return b1.hitSegment(this.B, this.A) ? { internal: b1, external: b2 } : { internal: b2, external: b1 };
|
|
6201
6219
|
}
|
|
6202
6220
|
// Default returns the first bisector
|
|
6203
|
-
return b1;
|
|
6221
|
+
return { internal: b1, external: b2 };
|
|
6204
6222
|
};
|
|
6205
6223
|
if (values.length > 0) {
|
|
6206
6224
|
this.parse(...values);
|
|
@@ -6894,8 +6912,8 @@ var Random;
|
|
|
6894
6912
|
return (new rndFraction_1.rndFraction(config)).generate();
|
|
6895
6913
|
}
|
|
6896
6914
|
Random.fraction = fraction;
|
|
6897
|
-
function number(from, to) {
|
|
6898
|
-
return rndHelpers_1.rndHelpers.randomInt(from, to);
|
|
6915
|
+
function number(from, to, exclude) {
|
|
6916
|
+
return rndHelpers_1.rndHelpers.randomInt(from, to, exclude);
|
|
6899
6917
|
}
|
|
6900
6918
|
Random.number = number;
|
|
6901
6919
|
function numberSym(max, allowZero) {
|
|
@@ -7158,11 +7176,32 @@ class rndHelpers {
|
|
|
7158
7176
|
* @param a (number) : From this value to the second value. If the second is ommited, this value is the max value.
|
|
7159
7177
|
* @param b (number) : To this value. If this is ommited.
|
|
7160
7178
|
*/
|
|
7161
|
-
static randomInt(a, b) {
|
|
7179
|
+
static randomInt(a, b, exclude) {
|
|
7162
7180
|
if (b === undefined) {
|
|
7163
|
-
|
|
7181
|
+
if (a >= 0) {
|
|
7182
|
+
return this.randomInt(0, a);
|
|
7183
|
+
}
|
|
7184
|
+
else {
|
|
7185
|
+
return this.randomInt(a, 0);
|
|
7186
|
+
}
|
|
7187
|
+
}
|
|
7188
|
+
// Same start and end values
|
|
7189
|
+
if (a === b) {
|
|
7190
|
+
return a;
|
|
7191
|
+
}
|
|
7192
|
+
// No exclusion
|
|
7193
|
+
if (exclude === undefined) {
|
|
7194
|
+
return Math.floor(Math.random() * (b - a + 1) + a);
|
|
7195
|
+
}
|
|
7196
|
+
// With exclusion
|
|
7197
|
+
if (Math.abs(b - a) <= exclude.length) {
|
|
7198
|
+
throw new Error('The number of excluded values is too high.');
|
|
7199
|
+
}
|
|
7200
|
+
let r = this.randomInt(a, b);
|
|
7201
|
+
while (exclude.includes(r)) {
|
|
7202
|
+
r = this.randomInt(a, b);
|
|
7164
7203
|
}
|
|
7165
|
-
return
|
|
7204
|
+
return r;
|
|
7166
7205
|
}
|
|
7167
7206
|
/**
|
|
7168
7207
|
* Random integer between -max and max value.
|
|
@@ -7199,7 +7238,7 @@ class rndHelpers {
|
|
|
7199
7238
|
if (arr.length === 0) {
|
|
7200
7239
|
return '';
|
|
7201
7240
|
}
|
|
7202
|
-
return this.
|
|
7241
|
+
return arr[this.randomInt(0, arr.length - 1)];
|
|
7203
7242
|
}
|
|
7204
7243
|
static shuffleArray(arr) {
|
|
7205
7244
|
// The Fisher-Yates algorithm
|