math-exercises 3.0.55 → 3.0.57
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/lib/exercises/math/calcul/arithmetics/index.d.ts +1 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +1 -0
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +87 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +2 -2
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +7 -1
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
- package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/capacityConversion.js +68 -12
- package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
- package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +55 -6
- package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/massConversion.js +72 -16
- package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +72 -12
- package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/signFunction.js +23 -11
- package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +16 -0
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +34 -2
- package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleAreaV2.js +54 -8
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +29 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +25 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
- package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +1 -0
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
- package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +6 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +161 -92
- package/lib/exercises/math/geometry/vectors/index.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/coneVolume.js +68 -6
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +55 -11
- package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +31 -3
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +46 -18
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +114 -63
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +102 -64
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +99 -53
- package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
- package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimit.js +28 -9
- package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
- package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
- package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/math/powers/decimalToScientific.js +55 -11
- package/lib/exercises/math/powers/index.d.ts +1 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +1 -0
- package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +68 -53
- package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +88 -17
- package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
- package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +1 -0
- package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +50 -3
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
- package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.js +8 -0
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
- package/lib/index.d.ts +22 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +0 -5
- package/lib/math/geometry/vector.d.ts +3 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +25 -0
- package/lib/math/numbers/decimals/decimal.d.ts +1 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +2 -0
- package/lib/math/systems/generalSystem.d.ts +6 -1
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +137 -0
- package/lib/math/utils/arithmetic/lcm.d.ts +2 -0
- package/lib/math/utils/arithmetic/lcm.d.ts.map +1 -0
- package/lib/math/utils/arithmetic/lcm.js +5 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -3
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +17 -9
- package/lib/tree/nodes/operators/addNode.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts +2 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +37 -17
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +5 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +3 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { Rational } from "../../../math/numbers/rationals/rational.js";
|
|
|
9
9
|
import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
|
|
10
10
|
import { AddNode, isAddNode } from "./addNode.js";
|
|
11
11
|
import { PowerNode, isPowerNode } from "./powerNode.js";
|
|
12
|
-
import { SubstractNode, isSubstractNode } from "./substractNode.js";
|
|
12
|
+
import { SubstractNode, isSubstractNode, substract } from "./substractNode.js";
|
|
13
13
|
import { parseToMonomNode } from "../polynomials/monomNode.js";
|
|
14
14
|
export function isFractionNode(a) {
|
|
15
15
|
return isOperatorNode(a) && a.id === OperatorIds.fraction;
|
|
@@ -100,7 +100,7 @@ export class FractionNode {
|
|
|
100
100
|
denum = denum / 5;
|
|
101
101
|
return denum === 1;
|
|
102
102
|
}
|
|
103
|
-
toTex() {
|
|
103
|
+
toTex(texOpts) {
|
|
104
104
|
//! this stinks
|
|
105
105
|
//! to tex shouldn't be doing all of this
|
|
106
106
|
//! we need a "canonicalToTex" or a "purifyTex" in order to print correct latex without simplifying mathematically
|
|
@@ -110,17 +110,17 @@ export class FractionNode {
|
|
|
110
110
|
this.leftChild.child.value > 0) ||
|
|
111
111
|
(isNumberNode(this.leftChild) && this.leftChild.value < 0))) {
|
|
112
112
|
return `-\\frac{${this.leftChild
|
|
113
|
-
.toTex()
|
|
114
|
-
.slice(1)}}{${this.rightChild.toTex()}}`;
|
|
113
|
+
.toTex(texOpts)
|
|
114
|
+
.slice(1)}}{${this.rightChild.toTex(texOpts)}}`;
|
|
115
115
|
}
|
|
116
116
|
if (!this.opts?.allowMinusAnywhereInFraction &&
|
|
117
117
|
(isOppositeNode(this.rightChild) ||
|
|
118
118
|
(isNumberNode(this.rightChild) && this.rightChild.value < 0))) {
|
|
119
|
-
return `-\\frac{${this.leftChild.toTex()}}{${this.rightChild
|
|
120
|
-
.toTex()
|
|
119
|
+
return `-\\frac{${this.leftChild.toTex(texOpts)}}{${this.rightChild
|
|
120
|
+
.toTex(texOpts)
|
|
121
121
|
.slice(1)}}`;
|
|
122
122
|
}
|
|
123
|
-
return `\\frac{${this.leftChild.toTex()}}{${this.rightChild.toTex()}}`;
|
|
123
|
+
return `\\frac{${this.leftChild.toTex(texOpts)}}{${this.rightChild.toTex(texOpts)}}`;
|
|
124
124
|
}
|
|
125
125
|
evaluate(vars) {
|
|
126
126
|
return this.leftChild.evaluate(vars) / this.rightChild.evaluate(vars);
|
|
@@ -225,20 +225,14 @@ export class FractionNode {
|
|
|
225
225
|
if (opts?.forceDistributeFractions &&
|
|
226
226
|
isNumberNode(denum) &&
|
|
227
227
|
parsedMonom) {
|
|
228
|
-
return new MultiplyNode(new FractionNode(parsedMonom.a, denum), parsedMonom.
|
|
228
|
+
return new MultiplyNode(new FractionNode(parsedMonom.a, denum), parsedMonom.toTree()).simplify(opts);
|
|
229
229
|
}
|
|
230
230
|
if (isFractionNode(denum) && isFractionNode(num)) {
|
|
231
231
|
return new MultiplyNode(num, new FractionNode(denum.rightChild, denum.leftChild)).simplify(opts);
|
|
232
232
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
isPowerNode(denum) &&
|
|
237
|
-
num.rightChild.isNumeric &&
|
|
238
|
-
denum.rightChild.isNumeric &&
|
|
239
|
-
num.rightChild.evaluate() === denum.rightChild.evaluate()) {
|
|
240
|
-
return new PowerNode(new FractionNode(num.leftChild, denum.leftChild), num.rightChild).simplify(opts);
|
|
241
|
-
}
|
|
233
|
+
const powerSimp = powerSimplify(num, denum, opts);
|
|
234
|
+
if (powerSimp)
|
|
235
|
+
return powerSimp;
|
|
242
236
|
if (num.equals(denum))
|
|
243
237
|
return new NumberNode(1);
|
|
244
238
|
return null;
|
|
@@ -312,3 +306,29 @@ export class FractionNode {
|
|
|
312
306
|
throw new Error("unimplemented derivative");
|
|
313
307
|
}
|
|
314
308
|
}
|
|
309
|
+
const powerSimplify = (num, denum, opts) => {
|
|
310
|
+
//!ya mieux à faire pour gérer tous les cas d'un coup
|
|
311
|
+
//!s'insiprer de multiply
|
|
312
|
+
if (isPowerNode(num) &&
|
|
313
|
+
isPowerNode(denum) &&
|
|
314
|
+
num.leftChild.evaluate() === denum.leftChild.evaluate()) {
|
|
315
|
+
return new PowerNode(num.leftChild, substract(num.rightChild, denum.rightChild)).simplify(opts);
|
|
316
|
+
}
|
|
317
|
+
if (isPowerNode(num) &&
|
|
318
|
+
isNumberNode(denum) &&
|
|
319
|
+
num.leftChild.evaluate() === denum.evaluate()) {
|
|
320
|
+
return new PowerNode(num.leftChild, substract(num.rightChild, 1)).simplify(opts);
|
|
321
|
+
}
|
|
322
|
+
if (isPowerNode(denum) &&
|
|
323
|
+
isNumberNode(num) &&
|
|
324
|
+
num.evaluate() === denum.leftChild.evaluate()) {
|
|
325
|
+
return new PowerNode(num, substract(1, denum.rightChild)).simplify(opts);
|
|
326
|
+
}
|
|
327
|
+
if (isPowerNode(num) &&
|
|
328
|
+
isPowerNode(denum) &&
|
|
329
|
+
num.rightChild.isNumeric &&
|
|
330
|
+
denum.rightChild.isNumeric &&
|
|
331
|
+
num.rightChild.evaluate() === denum.rightChild.evaluate()) {
|
|
332
|
+
return new PowerNode(new FractionNode(num.leftChild, denum.leftChild), num.rightChild).simplify(opts);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/powerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,mBAAmB,C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AC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAcxD;AAED,qBAAa,UAAW,SAAQ,SAAS;gBAC3B,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;CAIrD"}
|
|
@@ -112,6 +112,11 @@ export class PowerNode {
|
|
|
112
112
|
if (isNumberNode(rightSimplified) && rightSimplified.value === 1) {
|
|
113
113
|
return leftSimplified;
|
|
114
114
|
}
|
|
115
|
+
if (opts?.calculatePowers &&
|
|
116
|
+
isNumberNode(leftSimplified) &&
|
|
117
|
+
isNumberNode(rightSimplified)) {
|
|
118
|
+
return new NumberNode(leftSimplified.value ** rightSimplified.value);
|
|
119
|
+
}
|
|
115
120
|
if (isPowerNode(leftSimplified)) {
|
|
116
121
|
return new PowerNode(leftSimplified.leftChild, new MultiplyNode(rightSimplified, leftSimplified.rightChild).simplify(opts)).simplify(opts);
|
|
117
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/sets/intervalNode.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,eAAe,EAAkB,MAAM,uBAAuB,CAAC;AAOxE,OAAO,EAAW,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAa,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;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EAAE,aAAa,CAAC;IASxD,YAAY;IAGZ,aAAa;IAGb,QAAQ,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO;IAanC,UAAU,CAAC,QAAQ,EAAE,YAAY;IAEjC,YAAY,CAAC,QAAQ,EAAE,YAAY;IA0DnC,YAAY;IAIZ,KAAK,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG,iBAAiB;CAkDhE"}
|
|
@@ -252,7 +252,9 @@ export class IntervalNode {
|
|
|
252
252
|
if (ordered[0].includes(ordered[1].a) ||
|
|
253
253
|
Math.abs(thisA - otherA) < 0.0000000001) {
|
|
254
254
|
if (Math.abs(orderedEv[0][1] - orderedEv[1][0]) < 0.0000000001) {
|
|
255
|
-
|
|
255
|
+
if (ordered[0].isRightClosed() && ordered[1].isLeftClosed())
|
|
256
|
+
return new DiscreteSetNode([ordered[1].a]);
|
|
257
|
+
return EmptySet;
|
|
256
258
|
}
|
|
257
259
|
let leftBracket = "[";
|
|
258
260
|
if (Math.abs(thisA - otherA) < 0.0000000001) {
|