math-exercises 3.0.108 → 3.0.110
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/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +5 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts +7 -0
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +197 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +1 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +1 -0
- package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +0 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/formulas/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/formulas/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/formulas/index.js +1 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts +18 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.js +208 -0
- package/lib/exercises/math/calculLitteral/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +1 -0
- package/lib/exercises/math/calculLitteral/writing/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/writing/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/writing/index.js +1 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +33 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +348 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.js +201 -0
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/index.d.ts +1 -0
- package/lib/exercises/math/functions/logarithm/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/index.js +1 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.d.ts +11 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.js +148 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +28 -5
- package/lib/exercises/math/functions/variations/varTableExtremaReading.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +14 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequencePolynomLimit.js +2 -2
- package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +2 -2
- package/lib/exercises/math/limits/sequencePolynomProductLimit.js +4 -4
- package/lib/exercises/math/limits/sequenceRationalFracLimit.js +4 -4
- package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
- package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -1
- package/lib/exercises/math/python/conditionIfElifElse.d.ts +1 -0
- package/lib/exercises/math/python/conditionIfElifElse.d.ts.map +1 -1
- package/lib/exercises/math/python/conditionIfElifElse.js +24 -16
- package/lib/exercises/math/python/forLoop.js +1 -1
- package/lib/exercises/math/python/inOutCalcul.d.ts.map +1 -1
- package/lib/exercises/math/python/inOutCalcul.js +5 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.js +1 -1
- package/lib/exercises/math/python/pythonForLoopInstructionCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +24 -15
- package/lib/exercises/math/python/pythonRangeCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonRangeCompletion.js +7 -5
- package/lib/exercises/math/python/variableAffectation.js +7 -7
- package/lib/exercises/math/python/variableType.d.ts.map +1 -1
- package/lib/exercises/math/python/variableType.js +11 -10
- package/lib/exercises/math/python/whileLoopCount.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts +9 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.js +110 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
- package/lib/index.d.ts +26 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +5 -5
- package/package.json +1 -1
|
@@ -7,32 +7,32 @@ const getPropositions = (n, { answer, coeff, iterations, operation }) => {
|
|
|
7
7
|
const propositions = [];
|
|
8
8
|
addValidProp(propositions, answer, "raw");
|
|
9
9
|
tryToAddWrongProp(propositions, `\`${operation}${coeff}\``, "raw");
|
|
10
|
-
tryToAddWrongProp(propositions, `\`
|
|
10
|
+
tryToAddWrongProp(propositions, `\`a${operation}${iterations}\``, "raw");
|
|
11
11
|
tryToAddWrongProp(propositions, `\`${coeff}\``, "raw");
|
|
12
12
|
return shuffleProps(propositions, n);
|
|
13
13
|
};
|
|
14
14
|
const getAnswer = (identifiers) => {
|
|
15
|
-
return
|
|
15
|
+
return `\`a${identifiers.operation}${identifiers.coeff}\``;
|
|
16
16
|
};
|
|
17
17
|
const getInstruction = (identifiers) => {
|
|
18
18
|
let word = "";
|
|
19
19
|
const { coeff, iterations, operation } = identifiers;
|
|
20
20
|
switch (operation) {
|
|
21
21
|
case "+":
|
|
22
|
-
word =
|
|
22
|
+
word = `lui ajouter $${coeff}$ à $${iterations}$ reprises`;
|
|
23
23
|
break;
|
|
24
24
|
case "-":
|
|
25
|
-
word =
|
|
25
|
+
word = `lui soustraire $${coeff}$ à $${iterations}$ reprises`;
|
|
26
26
|
break;
|
|
27
27
|
case "*":
|
|
28
|
-
word =
|
|
28
|
+
word = `le multiplier à $${iterations}$ reprises par $${coeff}$`;
|
|
29
29
|
break;
|
|
30
30
|
case "/":
|
|
31
31
|
default:
|
|
32
|
-
word =
|
|
32
|
+
word = `le diviser à $${iterations}$ reprises par $${coeff}$`;
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
|
-
return `On considère la fonction en Python suivante. Cette fonction doit permettre, pour un paramètre \`a\` saisi en entrée, de ${word}
|
|
35
|
+
return `On considère la fonction en Python suivante. Cette fonction doit permettre, pour un paramètre \`a\` saisi en entrée, de ${word}, puis de renvoyer le résultat du calcul.
|
|
36
36
|
|
|
37
37
|
Par quoi faut-il remplacer les trois points ?
|
|
38
38
|
|
|
@@ -63,14 +63,23 @@ x = x${fakeOperation}${fakeCoeff}
|
|
|
63
63
|
};
|
|
64
64
|
const getCorrection = (identifiers) => {
|
|
65
65
|
const { coeff, iterations, operation } = identifiers;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
let word = "";
|
|
67
|
+
switch (operation) {
|
|
68
|
+
case "+":
|
|
69
|
+
word = `ajouter $${coeff}$ à \`a\``;
|
|
70
|
+
break;
|
|
71
|
+
case "-":
|
|
72
|
+
word = `soustraire $${coeff}$ à \`a\``;
|
|
73
|
+
break;
|
|
74
|
+
case "*":
|
|
75
|
+
word = `multiplier \`a\` par $${coeff}$`;
|
|
76
|
+
break;
|
|
77
|
+
case "/":
|
|
78
|
+
default:
|
|
79
|
+
word = `diviser \`a\` par $${coeff}$`;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return `On veut ${word} à chaque exécution de la boucle \`for\`. En python, cela se traduit par :
|
|
74
83
|
|
|
75
84
|
\`\`\`
|
|
76
85
|
a=a${operation}${coeff}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythonRangeCompletion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/pythonRangeCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"pythonRangeCompletion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/pythonRangeCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAmGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
|
|
@@ -6,6 +6,8 @@ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
|
6
6
|
const getPropositions = (n, { answer }) => {
|
|
7
7
|
const propositions = [];
|
|
8
8
|
addValidProp(propositions, answer);
|
|
9
|
+
tryToAddWrongProp(propositions, Number(answer) + 1 + "");
|
|
10
|
+
tryToAddWrongProp(propositions, Number(answer) - 1 + "");
|
|
9
11
|
while (propositions.length < n) {
|
|
10
12
|
tryToAddWrongProp(propositions, randint(1, 20).frenchify());
|
|
11
13
|
}
|
|
@@ -19,20 +21,20 @@ const getInstruction = (identifiers) => {
|
|
|
19
21
|
const { coeff, iterations, operation } = identifiers;
|
|
20
22
|
switch (operation) {
|
|
21
23
|
case "+":
|
|
22
|
-
word =
|
|
24
|
+
word = `lui ajouter $${coeff}$ à $${iterations}$ reprises`;
|
|
23
25
|
break;
|
|
24
26
|
case "-":
|
|
25
|
-
word =
|
|
27
|
+
word = `lui soustraire $${coeff}$ à $${iterations}$ reprises`;
|
|
26
28
|
break;
|
|
27
29
|
case "*":
|
|
28
|
-
word =
|
|
30
|
+
word = `le multiplier à $${iterations}$ reprises par $${coeff}$`;
|
|
29
31
|
break;
|
|
30
32
|
case "/":
|
|
31
33
|
default:
|
|
32
|
-
word =
|
|
34
|
+
word = `le diviser à $${iterations}$ reprises par $${coeff}$`;
|
|
33
35
|
break;
|
|
34
36
|
}
|
|
35
|
-
return `On considère la fonction en Python suivante. Cette fonction doit permettre, pour un paramètre \`a\` saisi en entrée, de ${word}
|
|
37
|
+
return `On considère la fonction en Python suivante. Cette fonction doit permettre, pour un paramètre \`a\` saisi en entrée, de ${word}, puis de renvoyer le résultat du calcul.
|
|
36
38
|
|
|
37
39
|
Par quoi faut-il remplacer les trois points ?
|
|
38
40
|
|
|
@@ -32,8 +32,8 @@ const getInstruction = (identifiers) => {
|
|
|
32
32
|
const { variableName, initialVariable, affines } = identifiers;
|
|
33
33
|
const affinePythonStrings = affines
|
|
34
34
|
.map((a) => a.toPython())
|
|
35
|
-
.join(
|
|
36
|
-
return `On exécute le script Python ci-dessous. Quelle est la valeur de \`${variableName}\` à la fin du script ?
|
|
35
|
+
.join(`\n${variableName} = `);
|
|
36
|
+
return `On exécute le script en Python ci-dessous. Quelle est la valeur de \`${variableName}\` à la fin du script ?
|
|
37
37
|
|
|
38
38
|
\`\`\`
|
|
39
39
|
${variableName} = ${initialVariable}
|
|
@@ -53,7 +53,7 @@ const getCorrection = (identifiers) => {
|
|
|
53
53
|
et on affecte cette valeur dans la variable \`${variableName}\`. On a donc :
|
|
54
54
|
|
|
55
55
|
\`\`\`
|
|
56
|
-
${variableName} = ${initialVariable}
|
|
56
|
+
${variableName} = ${initialVariable} # Ici ${variableName} = ${variable}
|
|
57
57
|
${affines
|
|
58
58
|
.map((a) => {
|
|
59
59
|
evVariable = a
|
|
@@ -62,8 +62,8 @@ ${affines
|
|
|
62
62
|
variable = a.calculate(variable);
|
|
63
63
|
return (`${variableName} = ` +
|
|
64
64
|
a.toPython() +
|
|
65
|
-
|
|
66
|
-
.toTex()
|
|
65
|
+
` # Ici ${variableName} = ${evVariable
|
|
66
|
+
.toTex({ forceNoSimplification: true })
|
|
67
67
|
.replace("\\times", "*")
|
|
68
68
|
.replaceAll("\\left", "")
|
|
69
69
|
.replaceAll("\\right", "")} = ${variable}\n`);
|
|
@@ -105,10 +105,10 @@ const getVariableAffectationQuestion = (ops) => {
|
|
|
105
105
|
affines.push(new Affine(1, randint(-4, 5, [0]), variableName));
|
|
106
106
|
}
|
|
107
107
|
else if (type === 2) {
|
|
108
|
-
affines.push(new Affine(randint(-4, 5, [0]), 0, variableName));
|
|
108
|
+
affines.push(new Affine(randint(-4, 5, [0, 1]), 0, variableName));
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
|
-
affines.push(AffineConstructor.random({ min: -4, max: 4 }, { min: -5, max: 5 }, variableName));
|
|
111
|
+
affines.push(AffineConstructor.random({ min: -4, max: 4, excludes: [0, 1] }, { min: -5, max: 5, excludes: [0] }, variableName));
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
const identifiers = { variableName, initialVariable, affines };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variableType.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/variableType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"variableType.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/variableType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAkB9C,CAAC"}
|
|
@@ -7,7 +7,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
7
7
|
addValidProp(propositions, answer, "raw");
|
|
8
8
|
tryToAddWrongProp(propositions, "Nombre entier", "raw");
|
|
9
9
|
tryToAddWrongProp(propositions, "Nombre flottant", "raw");
|
|
10
|
-
tryToAddWrongProp(propositions, "
|
|
10
|
+
tryToAddWrongProp(propositions, "Chaîne de caractères", "raw");
|
|
11
11
|
return shuffleProps(propositions, n);
|
|
12
12
|
};
|
|
13
13
|
const getAnswer = (identifiers) => {
|
|
@@ -19,7 +19,7 @@ const getAnswer = (identifiers) => {
|
|
|
19
19
|
return "Nombre flottant";
|
|
20
20
|
}
|
|
21
21
|
else if (vType === "str") {
|
|
22
|
-
return "
|
|
22
|
+
return "Chaîne de caractères";
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
throw new Error(`Unknown type: ${vType}`);
|
|
@@ -28,15 +28,16 @@ const getAnswer = (identifiers) => {
|
|
|
28
28
|
const getInstruction = (identifiers) => {
|
|
29
29
|
const { v, vType } = identifiers;
|
|
30
30
|
return `On exécute le script en Python ci-dessous :\n
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
|
|
32
|
+
\`\`\`python
|
|
33
|
+
v = ${vType === "str" ? `"${v}"` : v}
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
Quel est le type de la variable \`v\` ?
|
|
36
37
|
`;
|
|
37
38
|
};
|
|
38
39
|
const getHint = (identifiers) => {
|
|
39
|
-
return "En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est
|
|
40
|
+
return "En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est-à-dire avec une virgule) ou une chaîne de caractère (c'est-à-dire un texte).";
|
|
40
41
|
};
|
|
41
42
|
const getCorrection = (identifiers) => {
|
|
42
43
|
const { v, vType } = identifiers;
|
|
@@ -48,9 +49,9 @@ const getCorrection = (identifiers) => {
|
|
|
48
49
|
explanationType = "Nombre flottant";
|
|
49
50
|
}
|
|
50
51
|
else if (vType === "str") {
|
|
51
|
-
explanationType = "
|
|
52
|
+
explanationType = "Chaîne de caractères";
|
|
52
53
|
}
|
|
53
|
-
return `En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est
|
|
54
|
+
return `En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est-à-dire avec une virgule) ou une chaîne de caractère (c'est-à-dire un texte).
|
|
54
55
|
|
|
55
56
|
Ici, la variable \`v\` est de type ${explanationType.toLocaleLowerCase()}.`;
|
|
56
57
|
};
|
|
@@ -2,7 +2,7 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercis
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
4
|
const getInstruction = ({ inputValue, threshold, }) => {
|
|
5
|
-
return `On définit la fonction en Python
|
|
5
|
+
return `On définit la fonction en Python suivante :
|
|
6
6
|
|
|
7
7
|
\`\`\`python
|
|
8
8
|
def boucle(x):
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
n: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const arithmeticFindAntecedent: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=arithmeticFindAntecedent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticFindAntecedent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2HF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAiB1D,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { EqualNode, equationResolutionTex, } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { NumberNode, NumberNodeConstructor, } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
const varName = "n";
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { a, b, n } = identifiers;
|
|
11
|
+
const affineWithN = new Affine(a, b, varName);
|
|
12
|
+
const u = affineWithN.calculate(n);
|
|
13
|
+
const affineWithNTex = affineWithN.toTree().toTex();
|
|
14
|
+
const uTex = u.frenchify();
|
|
15
|
+
return `On donne la suite numérique $u$ définie par :
|
|
16
|
+
|
|
17
|
+
$$
|
|
18
|
+
u_${varName}= ${affineWithNTex}
|
|
19
|
+
$$
|
|
20
|
+
|
|
21
|
+
Calculer la valeur de $ ${varName} $ pour laquelle $ u_${varName} = ${uTex} $.`;
|
|
22
|
+
};
|
|
23
|
+
const getPropositions = (nb_prop, { answer, a, b, n }) => {
|
|
24
|
+
const propositions = [];
|
|
25
|
+
addValidProp(propositions, answer);
|
|
26
|
+
const affineWithN = new Affine(a, b, varName);
|
|
27
|
+
const u = affineWithN.calculate(n);
|
|
28
|
+
tryToAddWrongProp(propositions, new Affine(a, b).solve(0).toTex());
|
|
29
|
+
tryToAddWrongProp(propositions, affineWithN.calculate(u).toTree().toTex());
|
|
30
|
+
tryToAddWrongProp(propositions, new NumberNode(n + 1).toTex());
|
|
31
|
+
if (propositions.length < nb_prop) {
|
|
32
|
+
if (n - 1 >= 0) {
|
|
33
|
+
tryToAddWrongProp(propositions, new NumberNode(n - 1).toTex());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
while (propositions.length < nb_prop) {
|
|
37
|
+
const wrongAnswer = NumberNodeConstructor.random(0, 20);
|
|
38
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
39
|
+
}
|
|
40
|
+
return shuffleProps(propositions, nb_prop);
|
|
41
|
+
};
|
|
42
|
+
const getAnswer = (identifiers) => {
|
|
43
|
+
const { n } = identifiers;
|
|
44
|
+
return n.frenchify();
|
|
45
|
+
};
|
|
46
|
+
const getHint = (identifiers) => {
|
|
47
|
+
// const {affineWithNTex, uTex} = getTailoredTex(identifiers);
|
|
48
|
+
const { a, b, n } = identifiers;
|
|
49
|
+
const affineWithN = new Affine(a, b, varName);
|
|
50
|
+
const u = affineWithN.calculate(n);
|
|
51
|
+
const equationNode = new EqualNode(affineWithN.toTree(), new NumberNode(u));
|
|
52
|
+
const equationTex = equationNode.toTex();
|
|
53
|
+
return `Résous l'équation $${equationTex} $.`;
|
|
54
|
+
};
|
|
55
|
+
/*
|
|
56
|
+
a n + b = k
|
|
57
|
+
n = (k - b) / a
|
|
58
|
+
*/
|
|
59
|
+
const getCorrection = (identifiers) => {
|
|
60
|
+
const { a, b, n } = identifiers;
|
|
61
|
+
const affineWithN = new Affine(a, b, varName);
|
|
62
|
+
const u = affineWithN.calculate(n);
|
|
63
|
+
return `On résout l'équation $u_${varName} = ${u}$ :
|
|
64
|
+
|
|
65
|
+
$$
|
|
66
|
+
${equationResolutionTex(a.toTree(), b.toTree(), (0).toTree(), u.toTree(), varName)}
|
|
67
|
+
$$`;
|
|
68
|
+
};
|
|
69
|
+
const getKeys = (identifiers) => {
|
|
70
|
+
return [];
|
|
71
|
+
};
|
|
72
|
+
const isAnswerValid = (ans, { answer, a, b, n }) => {
|
|
73
|
+
return numberVEA(ans, answer);
|
|
74
|
+
};
|
|
75
|
+
const getArithmeticFindAntecedentQuestion = (ops) => {
|
|
76
|
+
const affine = AffineConstructor.random(undefined, {
|
|
77
|
+
excludes: [0],
|
|
78
|
+
});
|
|
79
|
+
const n = randint(0, 20, []);
|
|
80
|
+
const identifiers = { a: affine.a, b: affine.b, n: n };
|
|
81
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
82
|
+
};
|
|
83
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
84
|
+
return {
|
|
85
|
+
answer: getAnswer(identifiers),
|
|
86
|
+
instruction: getInstruction(identifiers),
|
|
87
|
+
keys: getKeys(identifiers),
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const arithmeticFindAntecedent = {
|
|
95
|
+
id: "arithmeticFindAntecedent",
|
|
96
|
+
label: "Déterminer un antécedent via une suite arithmétique",
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb, opts) => getDistinctQuestions(() => getArithmeticFindAntecedentQuestion(opts), nb),
|
|
99
|
+
qcmTimer: 60,
|
|
100
|
+
freeTimer: 60,
|
|
101
|
+
getPropositions,
|
|
102
|
+
isAnswerValid,
|
|
103
|
+
subject: "Mathématiques",
|
|
104
|
+
getInstruction,
|
|
105
|
+
getHint,
|
|
106
|
+
getCorrection,
|
|
107
|
+
getAnswer,
|
|
108
|
+
getQuestionFromIdentifiers,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -14,4 +14,5 @@ export * from "./arithmeticFindExplictFormulaFirstTermRandom.js";
|
|
|
14
14
|
export * from "./arithmeticFindReasonRandomRange.js";
|
|
15
15
|
export * from "./arithmeticFindRandomTermFromTwoTerms.js";
|
|
16
16
|
export * from "./arithmeticFindTerm.js";
|
|
17
|
+
export * from "./arithmeticFindAntecedent.js";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
|
|
@@ -14,3 +14,4 @@ export * from "./arithmeticFindExplictFormulaFirstTermRandom.js";
|
|
|
14
14
|
export * from "./arithmeticFindReasonRandomRange.js";
|
|
15
15
|
export * from "./arithmeticFindRandomTermFromTwoTerms.js";
|
|
16
16
|
export * from "./arithmeticFindTerm.js";
|
|
17
|
+
export * from "./arithmeticFindAntecedent.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA8KF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAazD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcLength.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/arcLength.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"arcLength.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/arcLength.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iBAAiB,EAAE,GAAG,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AA2GF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicEquationCos.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicEquationCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"basicEquationCos.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicEquationCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicEquationSin.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicEquationSin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"basicEquationSin.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicEquationSin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+FF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicTrigoSystemEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicTrigoSystemEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"basicTrigoSystemEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/basicTrigoSystemEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AA8JF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAiGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -231,6 +231,8 @@ declare const mathExercises: (Exercise<{
|
|
|
231
231
|
}, {
|
|
232
232
|
precisionAsked: number;
|
|
233
233
|
}> | Exercise<{
|
|
234
|
+
factIndex: number;
|
|
235
|
+
}, {}> | Exercise<{
|
|
234
236
|
nb: number;
|
|
235
237
|
rankAsked: number;
|
|
236
238
|
}, {}> | Exercise<{
|
|
@@ -522,6 +524,15 @@ declare const mathExercises: (Exercise<{
|
|
|
522
524
|
sysIds: import("./math/systems/generalSystem.js").GeneralSystemIdentifiers;
|
|
523
525
|
x: number;
|
|
524
526
|
y: number;
|
|
527
|
+
}, {}> | Exercise<{
|
|
528
|
+
formula: {
|
|
529
|
+
title: string;
|
|
530
|
+
func: (variables: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[]) => import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
531
|
+
variables: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
532
|
+
variableNames: string[];
|
|
533
|
+
keys: (import("./types/keyIds.js").KeyId | import("./types/keyProps.js").KeyProps)[];
|
|
534
|
+
};
|
|
535
|
+
values: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
525
536
|
}, {}> | Exercise<{
|
|
526
537
|
word: string;
|
|
527
538
|
}, {}> | Exercise<{
|
|
@@ -719,6 +730,11 @@ declare const mathExercises: (Exercise<{
|
|
|
719
730
|
coin: number;
|
|
720
731
|
racine1: number;
|
|
721
732
|
racine2: number;
|
|
733
|
+
}, {}> | Exercise<{
|
|
734
|
+
a: number;
|
|
735
|
+
coin: number;
|
|
736
|
+
r1: number;
|
|
737
|
+
r2: number;
|
|
722
738
|
}, {}> | Exercise<{
|
|
723
739
|
a: number;
|
|
724
740
|
b: number;
|
|
@@ -1077,6 +1093,11 @@ declare const mathExercises: (Exercise<{
|
|
|
1077
1093
|
isLog10: boolean;
|
|
1078
1094
|
}, {
|
|
1079
1095
|
isLog10: boolean;
|
|
1096
|
+
}> | Exercise<{
|
|
1097
|
+
a: number;
|
|
1098
|
+
b: number;
|
|
1099
|
+
}, {
|
|
1100
|
+
useLog10?: boolean;
|
|
1080
1101
|
}> | Exercise<{
|
|
1081
1102
|
type: string;
|
|
1082
1103
|
fctTex: string;
|
|
@@ -2256,6 +2277,10 @@ declare const mathExercises: (Exercise<{
|
|
|
2256
2277
|
firstTerm: number;
|
|
2257
2278
|
reason: number;
|
|
2258
2279
|
askedRank: number;
|
|
2280
|
+
}, {}> | Exercise<{
|
|
2281
|
+
a: number;
|
|
2282
|
+
b: number;
|
|
2283
|
+
n: number;
|
|
2259
2284
|
}, {}> | Exercise<{
|
|
2260
2285
|
firstValue: number;
|
|
2261
2286
|
reason: number;
|
|
@@ -2525,6 +2550,7 @@ declare const mathExercises: (Exercise<{
|
|
|
2525
2550
|
a: number;
|
|
2526
2551
|
b: number;
|
|
2527
2552
|
opName: string;
|
|
2553
|
+
ineqs: string[];
|
|
2528
2554
|
}, {}> | Exercise<{
|
|
2529
2555
|
coeff: number;
|
|
2530
2556
|
iterations: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,UAAU,YAAW,CAAC;AAEnC;;;;GAIG"}
|
|
@@ -38,6 +38,6 @@ export declare class EqualNode implements AlgebraicNode {
|
|
|
38
38
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): EqualNode;
|
|
39
39
|
isVerified(): boolean;
|
|
40
40
|
}
|
|
41
|
-
export declare const equationResolutionTex: (a: AlgebraicNode, b: AlgebraicNode, c: AlgebraicNode, d: AlgebraicNode) => string | string[];
|
|
41
|
+
export declare const equationResolutionTex: (a: AlgebraicNode, b: AlgebraicNode, c: AlgebraicNode, d: AlgebraicNode, str__var?: string) => string | string[];
|
|
42
42
|
export {};
|
|
43
43
|
//# sourceMappingURL=equalNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equalNode.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAQ/B,eAAO,MAAM,KAAK,MACb,aAAa,GAAG,MAAM,GAAG,MAAM,KAC/B,aAAa,GAAG,MAAM,GAAG,MAAM,cAOnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC;IAClB,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,8BAAsB,oBAAoB;IACxC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,oBAAoB,GAAG,SAAS;CAOrE;AAED,eAAO,MAAM,WAAW,SAAU,aAAa,KAAG,IAAI,IAAI,SACzB,CAAC;AAElC,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AACF,qBAAa,SAAU,YAAW,aAAa;IAC7C,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC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AAG,OAAO;IAGpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM;IAGvE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS;IAMpE,UAAU;CAIX;AAED,eAAO,MAAM,qBAAqB,MAC7B,aAAa,KACb,aAAa,KACb,aAAa,KACb,aAAa,aACN,MAAM,sBA2DjB,CAAC"}
|
|
@@ -198,7 +198,7 @@ export class EqualNode {
|
|
|
198
198
|
return this.leftChild.simplify().equals(this.rightChild.simplify());
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
export const equationResolutionTex = (a, b, c, d) => {
|
|
201
|
+
export const equationResolutionTex = (a, b, c, d, str__var = "x") => {
|
|
202
202
|
//(+-a)x(+-b) = (+-c)x(+-d)
|
|
203
203
|
const steps = [];
|
|
204
204
|
const iteration = (a, b, c, d) => {
|
|
@@ -210,24 +210,24 @@ export const equationResolutionTex = (a, b, c, d) => {
|
|
|
210
210
|
//ax = d
|
|
211
211
|
if (aEv === 1) {
|
|
212
212
|
//x = d
|
|
213
|
-
steps.push(
|
|
213
|
+
steps.push(`${str__var}=${d.toTex()}`);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
217
|
//ax = d
|
|
218
|
-
steps.push(`${multiply(a,
|
|
218
|
+
steps.push(`${multiply(a, str__var).toTex()}=${d.toTex()}`);
|
|
219
219
|
iteration((1).toTree(), (0).toTree(), (0).toTree(), frac(d, a).simplify());
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
steps.push(`${monom(a, 1).toTex()}=${add(monom(c, 1), d).toTex()}`);
|
|
223
|
+
steps.push(`${monom(a, 1, { variable: str__var }).toTex()}=${add(monom(c, 1, { variable: str__var }), d).toTex()}`);
|
|
224
224
|
//ax = c!x + d
|
|
225
225
|
iteration(substract(a, c).simplify(), (0).toTree(), (0).toTree(), d);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
else {
|
|
229
229
|
//ax + b! = cx + d
|
|
230
|
-
steps.push(`${add(multiply(a,
|
|
230
|
+
steps.push(`${add(multiply(a, str__var), b).simplify().toTex()}=${add(multiply(c, str__var), d)
|
|
231
231
|
.simplify()
|
|
232
232
|
.toTex()}`);
|
|
233
233
|
iteration(a, (0).toTree(), c, substract(d, b).simplify());
|