math-exercises 3.0.190 → 3.0.192
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/dataRepresentations/barChart/barChartInterpreting.d.ts +53 -0
- package/lib/exercises/math/dataRepresentations/barChart/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChart/barChartInterpreting.js +543 -0
- package/lib/exercises/math/dataRepresentations/barChart/barChartReading.d.ts +94 -0
- package/lib/exercises/math/dataRepresentations/barChart/barChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChart/barChartReading.js +280 -0
- package/lib/exercises/math/dataRepresentations/barChart/index.d.ts +3 -0
- package/lib/exercises/math/dataRepresentations/barChart/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChart/index.js +2 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.js +223 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.js +133 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.d.ts +11 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.js +198 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.d.ts +13 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.js +192 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/index.d.ts +5 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlot/index.js +4 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +4 -7
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +4 -11
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +6 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
- package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.js +222 -0
- package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.js +187 -0
- package/lib/exercises/math/dataRepresentations/tables/index.d.ts +4 -0
- package/lib/exercises/math/dataRepresentations/tables/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/tables/index.js +3 -0
- package/lib/exercises/math/dataRepresentations/tables/tableReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/tables/tableReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/tables/tableReading.js +109 -0
- package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.d.ts +8 -0
- package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.js +145 -0
- package/lib/exercises/math/derivation/applications/index.d.ts +1 -0
- package/lib/exercises/math/derivation/applications/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/applications/index.js +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +4 -1
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +5 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/index.js +5 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +7 -2
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +131 -61
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
- package/lib/index.d.ts +53 -25
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -3
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +5 -3
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
4
|
+
import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
10
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
11
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
12
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
13
|
+
import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
|
|
14
|
+
import { NodeRewriter } from "../../../../tree/utilities/nodeRewriter.js";
|
|
15
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
16
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
17
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
18
|
+
const opts = optsIn ?? optsDefault;
|
|
19
|
+
const firstRank = opts.firstTermRankOne ? 1 : 0;
|
|
20
|
+
const { firstValue, reason } = identifiers;
|
|
21
|
+
return `$(u_n)$ est une suite géométrique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $q = ${reason}$.
|
|
22
|
+
|
|
23
|
+
Donner la relation de récurrence de $(u_n)$.`;
|
|
24
|
+
};
|
|
25
|
+
const getAnswerNode = (identifiers) => {
|
|
26
|
+
const { reason } = identifiers;
|
|
27
|
+
const nodeFormula = multiply(new VariableNode("u_{n}"), reason);
|
|
28
|
+
const equalNode = new EqualNode(new VariableNode("u_{n+1}"), nodeFormula);
|
|
29
|
+
return equalNode;
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
return getAnswerNode(identifiers).toTex();
|
|
33
|
+
};
|
|
34
|
+
const getHint = () => {
|
|
35
|
+
return `Quelle est la formule qui relie deux termes consécutifs d'une suite géométrique ?
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
u_{n+1} = ...
|
|
39
|
+
$$
|
|
40
|
+
|
|
41
|
+
`;
|
|
42
|
+
};
|
|
43
|
+
const getCorrection = (identifiers) => {
|
|
44
|
+
const { reason } = identifiers;
|
|
45
|
+
const answer = getAnswer(identifiers);
|
|
46
|
+
return `La relation de récurrence d'une suite géométrique de raison $q$ est :
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
u_{n+1} = u_{n} \\ \\times \\ q
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
Ici, puisque $q = ${reason}$, on a :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
${answer}
|
|
56
|
+
$$`;
|
|
57
|
+
};
|
|
58
|
+
const getPropositions = (n, { answer, reason, firstValue }, optsIn) => {
|
|
59
|
+
const opts = optsIn ?? optsDefault;
|
|
60
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
61
|
+
const propositions = [];
|
|
62
|
+
addValidProp(propositions, answer);
|
|
63
|
+
//student: no lhs
|
|
64
|
+
{
|
|
65
|
+
const texWrong = answer.replace("u_{n+1}=", "");
|
|
66
|
+
tryToAddWrongProp(propositions, texWrong);
|
|
67
|
+
}
|
|
68
|
+
//student: geometric -> arithmetic
|
|
69
|
+
{
|
|
70
|
+
const nodeFormula = add(new VariableNode("u_{n}"), reason);
|
|
71
|
+
const texWrong = "u_{n+1}=" + nodeFormula.toTex();
|
|
72
|
+
tryToAddWrongProp(propositions, texWrong);
|
|
73
|
+
//student: no lhs
|
|
74
|
+
{
|
|
75
|
+
tryToAddWrongProp(propositions, nodeFormula.toTex());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//student: recurrence formula -> explicit formula
|
|
79
|
+
{
|
|
80
|
+
const nodeFormula = multiply(firstValue, power(reason, substract("n".toTree(), firstRank).simplify()));
|
|
81
|
+
const equalNode = new EqualNode("u_n".toTree(), nodeFormula);
|
|
82
|
+
tryToAddWrongProp(propositions, equalNode.toTex());
|
|
83
|
+
if (probaFlip(0.1)) {
|
|
84
|
+
const equalNode = new EqualNode("u_{n+1}".toTree(), nodeFormula);
|
|
85
|
+
tryToAddWrongProp(propositions, equalNode.toTex());
|
|
86
|
+
}
|
|
87
|
+
//student: no lhs
|
|
88
|
+
{
|
|
89
|
+
tryToAddWrongProp(propositions, nodeFormula.toTex());
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (probaFlip(0.9)) {
|
|
93
|
+
//student: swap(initial, reason)
|
|
94
|
+
{
|
|
95
|
+
const nodeFormula = multiply(firstValue, power(reason, new VariableNode("n")));
|
|
96
|
+
const texWrong = "u_n=" + nodeFormula.toTex();
|
|
97
|
+
tryToAddWrongProp(propositions, texWrong);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
//student: u_n = u_n * q
|
|
102
|
+
{
|
|
103
|
+
const texWrong = answer.replace("u_{n+1}", "u_{n}");
|
|
104
|
+
tryToAddWrongProp(propositions, texWrong);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return shuffleProps(propositions, n);
|
|
108
|
+
};
|
|
109
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
110
|
+
try {
|
|
111
|
+
//TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
|
|
112
|
+
if (!ans.includes("=")) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
// const nodeAns = parseAlgebraic(ans);
|
|
116
|
+
const nodeAns = (() => {
|
|
117
|
+
const [lhs, rhs] = ans.split("=");
|
|
118
|
+
const lhsRefined = lhs.replace("u_{n+1}", "v");
|
|
119
|
+
const nodeLhs = lhsRefined.toTree();
|
|
120
|
+
const rhsRefined = rhs.replace("u_n", "u").replace("u_{n}", "u");
|
|
121
|
+
const nodeRhs = parseAlgebraic(rhsRefined);
|
|
122
|
+
return new EqualNode(nodeLhs, nodeRhs);
|
|
123
|
+
})();
|
|
124
|
+
const nodeAnswer = (() => {
|
|
125
|
+
const nodeAnswer = getAnswerNode(identifiers);
|
|
126
|
+
const nodeAnswerRefined = nodeBySubstitutingVar(nodeBySubstitutingVar(nodeAnswer, new VariableNode("v"), new VariableNode("u_{n+1}")), new VariableNode("u"), new VariableNode("u_{n}"));
|
|
127
|
+
return nodeAnswerRefined;
|
|
128
|
+
})();
|
|
129
|
+
const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
|
|
130
|
+
const isValidRhs = () => {
|
|
131
|
+
const nodeAnsRhs = nodeAns.rightChild;
|
|
132
|
+
const nodeAnswerRhs = nodeAnswer.rightChild;
|
|
133
|
+
const isEquivalentFound = () => {
|
|
134
|
+
const nodeAns = nodeAnsRhs;
|
|
135
|
+
const nodeAnswer = nodeAnswerRhs;
|
|
136
|
+
const arrNodeAnswerEquivalent = NodeRewriter.getArrNodeEquivalent(nodeAnswer);
|
|
137
|
+
return arrNodeAnswerEquivalent.some((nodeAnswerRefined) => {
|
|
138
|
+
const isEqual = NodeComparator.isEqualViaFrac(nodeAns, nodeAnswerRefined);
|
|
139
|
+
return isEqual;
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
return isEquivalentFound();
|
|
143
|
+
};
|
|
144
|
+
return isValidLhs() && isValidRhs();
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
handleVEAError(e);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const getGeometricFindRecurrenceFormulaQuestion = () => {
|
|
152
|
+
const firstValue = randint(-10, 10, [0]);
|
|
153
|
+
const reason = randint(-10, 10, [0, 1, firstValue]);
|
|
154
|
+
const identifiers = { reason, firstValue };
|
|
155
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
156
|
+
};
|
|
157
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
158
|
+
const question = {
|
|
159
|
+
instruction: getInstruction(identifiers),
|
|
160
|
+
answer: getAnswer(identifiers),
|
|
161
|
+
keys: ["un", "unplus1", "equal", "n"],
|
|
162
|
+
answerFormat: "tex",
|
|
163
|
+
identifiers,
|
|
164
|
+
hint: getHint(identifiers),
|
|
165
|
+
correction: getCorrection(identifiers),
|
|
166
|
+
};
|
|
167
|
+
return question;
|
|
168
|
+
};
|
|
169
|
+
const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
|
|
170
|
+
const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne);
|
|
171
|
+
const options = [generatorOptionFirstTermRankOne];
|
|
172
|
+
export const geometricFindRecurrenceFormula = {
|
|
173
|
+
id: "geometricFindRecurrenceFormula",
|
|
174
|
+
connector: "=",
|
|
175
|
+
label: "Déterminer la relation de récurrence d'une suite géométrique à partir de la raison et de $u_0$",
|
|
176
|
+
isSingleStep: false,
|
|
177
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindRecurrenceFormulaQuestion(opts), nb),
|
|
178
|
+
options,
|
|
179
|
+
qcmTimer: 60,
|
|
180
|
+
freeTimer: 60,
|
|
181
|
+
getPropositions,
|
|
182
|
+
isAnswerValid,
|
|
183
|
+
subject: "Mathématiques",
|
|
184
|
+
hasHintAndCorrection: true,
|
|
185
|
+
getQuestionFromIdentifiers,
|
|
186
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { OptionFirstTermRankOne } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { NodeIdentifiers } from "../../../../../tree/nodes/nodeConstructor.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
nodeIdsInitial: NodeIdentifiers;
|
|
6
|
+
nodeIdsReason: NodeIdentifiers;
|
|
7
|
+
firstRank: number;
|
|
8
|
+
};
|
|
9
|
+
type Options = OptionFirstTermRankOne & {
|
|
10
|
+
typeSignReason: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const geometricPlaceFirstPoints: Exercise<Identifiers, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=geometricPlaceFirstPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricPlaceFirstPoints.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAQ3D,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,CAAC;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0LF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAkBrE,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBpE,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { toolBarConstructor } from "../../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
4
|
+
import { greenMain } from "../../../../../geogebra/colors.js";
|
|
5
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
6
|
+
import { ggbPointToCoords } from "../../../../../geogebra/parsers/ggbPointToCoords.js";
|
|
7
|
+
import { parseGGBPoints } from "../../../../../geogebra/parsers/parseGGBPoints.js";
|
|
8
|
+
import { Point } from "../../../../../math/geometry/point.js";
|
|
9
|
+
import { NodeConstructor, } from "../../../../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
13
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
15
|
+
import { probaFlip } from "../../../../../utils/alea/probaFlip.js";
|
|
16
|
+
import { random } from "../../../../../utils/alea/random.js";
|
|
17
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
18
|
+
const nbPoints = 4;
|
|
19
|
+
const getInstruction = (identifiers) => {
|
|
20
|
+
const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
|
|
21
|
+
const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
22
|
+
return `On considère une suite géométrique $u$ de premier rang $u_{${firstRank}}=${nodeInitial.toTex()}$ et de raison $${nodeReason.toTex()}$.
|
|
23
|
+
Dans le repère ci-dessous, placer les points représentant les $${nbPoints}$ premiers termes de de $u$.`;
|
|
24
|
+
};
|
|
25
|
+
const getAnswerStuff = (identifiers) => {
|
|
26
|
+
const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
|
|
27
|
+
const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
28
|
+
const arrNodeTerm = [...Array(nbPoints).keys()].map((i) => multiply(nodeInitial, power(nodeReason, i))
|
|
29
|
+
.simplify({
|
|
30
|
+
towardsDistribute: true,
|
|
31
|
+
calculatePowers: true,
|
|
32
|
+
distributePowersOnFrac: true,
|
|
33
|
+
})
|
|
34
|
+
.simplify({ towardsDistribute: false }));
|
|
35
|
+
const arrPoint = arrNodeTerm.map((nodeTerm, i) => {
|
|
36
|
+
const nodeX = (firstRank + i).toTree();
|
|
37
|
+
return new Point(`P${firstRank + i}`, nodeX, nodeTerm);
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
arrPoint,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const getHint = () => {
|
|
44
|
+
return `Une suite est représentée par un nuage de point. L'abscisse de chaque point est le rang du terme, et l'ordonnée est le terme en lui-même.`;
|
|
45
|
+
};
|
|
46
|
+
const getCorrection = (identifiers) => {
|
|
47
|
+
const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
|
|
48
|
+
const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
49
|
+
const { arrPoint } = getAnswerStuff(identifiers);
|
|
50
|
+
return `Une suite est représentée par un nuage de point. L'abscisse de chaque point est le rang du terme, et l'ordonnée est le terme en lui-même.
|
|
51
|
+
|
|
52
|
+
La formule générale de la suite $u$ est :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
u_{n} = ${nodeInitial.toTex()} \\ \\times \\ (${nodeReason.toTex()})^{${substract(new VariableNode("n"), firstRank)
|
|
56
|
+
.simplify({ towardsDistribute: true })
|
|
57
|
+
.toTex()}}
|
|
58
|
+
$$
|
|
59
|
+
|
|
60
|
+
Les points du nuage sont donc ici les suivants :
|
|
61
|
+
|
|
62
|
+
${alignTex(arrPoint.map((point, i) => {
|
|
63
|
+
const rank = firstRank + i;
|
|
64
|
+
return [`(${rank};u_{${rank}})`, "=", point.toCoords()];
|
|
65
|
+
}))}
|
|
66
|
+
|
|
67
|
+
En pratique, on place le premier point. Puis, pour placer le point suivant :
|
|
68
|
+
- pour l'abscisse : on se décale d'une unité sur l'axe des abscisses
|
|
69
|
+
- pour l'ordonnée : on multiplie l'ordonnée du point précédent par la raison (attention au changement de signe si la raison est négative)
|
|
70
|
+
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
73
|
+
const getGGBAnswer = (identifiers) => {
|
|
74
|
+
const { arrPoint } = getAnswerStuff(identifiers);
|
|
75
|
+
return [
|
|
76
|
+
...arrPoint.flatMap((point) => point.toGGBCommand({ color: `${greenMain}`, showLabel: false })),
|
|
77
|
+
];
|
|
78
|
+
};
|
|
79
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
80
|
+
const { arrPoint } = getAnswerStuff(identifiers);
|
|
81
|
+
const values = arrPoint.map((point) => point.y.evaluate());
|
|
82
|
+
const ggb = new GeogebraConstructor({
|
|
83
|
+
commands: [],
|
|
84
|
+
customToolBar: toolBarConstructor({
|
|
85
|
+
point: true,
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
const yMin = Math.min(...values);
|
|
89
|
+
const yMax = Math.max(...values);
|
|
90
|
+
return ggb.getOptions({
|
|
91
|
+
coords: [-1, 6, Math.min(yMin, 0) - 1, Math.max(yMax, 1) + 1],
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
const isGGBAnswerValid = (ans, { ggbAnswer: _ggbAnswer, ...identifiers }) => {
|
|
95
|
+
const points = parseGGBPoints(ans)
|
|
96
|
+
.map((p) => ggbPointToCoords(p))
|
|
97
|
+
.sort((a, b) => a.x - b.x);
|
|
98
|
+
const validPoints = getAnswerStuff(identifiers).arrPoint;
|
|
99
|
+
return points.every((p, i) => Math.abs(p.x - validPoints[i].x.evaluate()) < 0.4 &&
|
|
100
|
+
Math.abs(p.y - validPoints[i].y.evaluate()) < 0.4);
|
|
101
|
+
};
|
|
102
|
+
const getPlaceFirstSequencePointsQuestion = (optsIn) => {
|
|
103
|
+
const opts = optsIn ?? optsDefault;
|
|
104
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
105
|
+
const typeSignReason = opts?.typeSignReason
|
|
106
|
+
? random(opts.typeSignReason)
|
|
107
|
+
: random(optsDefault.typeSignReason);
|
|
108
|
+
const [nodeInitialAbs, nodeReasonAbs] = random([
|
|
109
|
+
//increasing
|
|
110
|
+
[(1).toTree(), (2).toTree()],
|
|
111
|
+
[(1).toTree(), frac(3, 2)],
|
|
112
|
+
[(1).toTree(), frac(4, 3)],
|
|
113
|
+
// [(1).toTree(), frac(5, 3)],
|
|
114
|
+
[frac(1, 2), (2).toTree()],
|
|
115
|
+
[frac(1, 2), frac(3, 2)],
|
|
116
|
+
[frac(1, 3), (3).toTree()],
|
|
117
|
+
[(2).toTree(), frac(3, 2)],
|
|
118
|
+
[(2).toTree(), frac(4, 3)],
|
|
119
|
+
//decreasing
|
|
120
|
+
[(8).toTree(), frac(1, 2)],
|
|
121
|
+
[(9).toTree(), frac(1, 3)],
|
|
122
|
+
[(9).toTree(), frac(2, 3)],
|
|
123
|
+
[(8).toTree(), frac(3, 4)],
|
|
124
|
+
// [(10).toTree(), frac(3, 5)],
|
|
125
|
+
]);
|
|
126
|
+
const nodeInitial = (() => {
|
|
127
|
+
const sign = probaFlip(0.7) ? +1 : -1;
|
|
128
|
+
return multiply(sign, nodeInitialAbs).simplify({
|
|
129
|
+
towardsDistribute: true,
|
|
130
|
+
});
|
|
131
|
+
})();
|
|
132
|
+
const nodeReason = (() => {
|
|
133
|
+
const sign = typeSignReason === "positive" ? +1 : -1;
|
|
134
|
+
return multiply(sign, nodeReasonAbs).simplify({
|
|
135
|
+
towardsDistribute: true,
|
|
136
|
+
});
|
|
137
|
+
})();
|
|
138
|
+
const identifiers = {
|
|
139
|
+
firstRank,
|
|
140
|
+
nodeIdsInitial: nodeInitial.toIdentifiers(),
|
|
141
|
+
nodeIdsReason: nodeReason.toIdentifiers(),
|
|
142
|
+
};
|
|
143
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
144
|
+
};
|
|
145
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
146
|
+
return {
|
|
147
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
148
|
+
instruction: getInstruction(identifiers),
|
|
149
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
150
|
+
identifiers,
|
|
151
|
+
hint: getHint(identifiers),
|
|
152
|
+
correction: getCorrection(identifiers),
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
|
|
156
|
+
const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne, {
|
|
157
|
+
typeSignReason: ["positive"],
|
|
158
|
+
});
|
|
159
|
+
const options = [
|
|
160
|
+
generatorOptionFirstTermRankOne,
|
|
161
|
+
{
|
|
162
|
+
id: "typeSignReason",
|
|
163
|
+
label: "Signe de la raison",
|
|
164
|
+
target: GeneratorOptionTarget.generation,
|
|
165
|
+
type: GeneratorOptionType.multiselect,
|
|
166
|
+
values: ["positive", "négative"],
|
|
167
|
+
defaultValue: optsDefault.typeSignReason,
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
export const geometricPlaceFirstPoints = {
|
|
171
|
+
id: "geometricPlaceFirstPoints",
|
|
172
|
+
label: "Placer les premiers termes d'une suite géométrique dans un repère",
|
|
173
|
+
isSingleStep: true,
|
|
174
|
+
generator: (nb, opts) =>
|
|
175
|
+
// getDistinctQuestions(() => getPlaceFirstSequencePointsQuestion(opts), nb),
|
|
176
|
+
[...Array(nb).keys()].map(() => getPlaceFirstSequencePointsQuestion(opts)),
|
|
177
|
+
ggbTimer: 60,
|
|
178
|
+
isGGBAnswerValid,
|
|
179
|
+
subject: "Mathématiques",
|
|
180
|
+
getHint,
|
|
181
|
+
getCorrection,
|
|
182
|
+
hasHintAndCorrection: true,
|
|
183
|
+
getInstruction,
|
|
184
|
+
getGGBAnswer,
|
|
185
|
+
getStudentGGBOptions,
|
|
186
|
+
answerType: "GGB",
|
|
187
|
+
getQuestionFromIdentifiers,
|
|
188
|
+
options,
|
|
189
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./geometricPlaceFirstPoints.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -1257,6 +1257,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1257
1257
|
}, {
|
|
1258
1258
|
method: string;
|
|
1259
1259
|
}> | Exercise<{
|
|
1260
|
+
coeffs: number[];
|
|
1261
|
+
isAskingX: boolean;
|
|
1262
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1260
1263
|
a: number;
|
|
1261
1264
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1262
1265
|
a: number;
|
|
@@ -1947,6 +1950,27 @@ declare const mathExercises: (Exercise<{
|
|
|
1947
1950
|
a: number;
|
|
1948
1951
|
k: number;
|
|
1949
1952
|
}[];
|
|
1953
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1954
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1955
|
+
xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1956
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1957
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1958
|
+
xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1959
|
+
yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1960
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1961
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1962
|
+
xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1963
|
+
yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1964
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1965
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1966
|
+
xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1967
|
+
yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1968
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1969
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1970
|
+
xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1971
|
+
yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1972
|
+
zIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1973
|
+
tIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1950
1974
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1951
1975
|
affine1Ids: import("./math/polynomials/generalAffine.js").GeneralAffineIdentifiers;
|
|
1952
1976
|
affine2Ids: import("./math/polynomials/generalAffine.js").GeneralAffineIdentifiers;
|
|
@@ -4364,32 +4388,9 @@ declare const mathExercises: (Exercise<{
|
|
|
4364
4388
|
values: number[][];
|
|
4365
4389
|
caseAsked: number;
|
|
4366
4390
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4367
|
-
|
|
4368
|
-
data: number[];
|
|
4369
|
-
itemAsked: number;
|
|
4370
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4371
|
-
isAskingX: boolean;
|
|
4372
|
-
xValue?: number;
|
|
4373
|
-
yValue?: number;
|
|
4374
|
-
a: number;
|
|
4375
|
-
b: number;
|
|
4376
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4377
|
-
points: number[][];
|
|
4378
|
-
labels: string[];
|
|
4379
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4380
|
-
quartiles: number[];
|
|
4381
|
-
arrQuartileIndex: (0 | 1 | 2 | 3 | 4)[];
|
|
4382
|
-
typeQ: "below" | "between" | "above";
|
|
4383
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4384
|
-
quartileIndex: 0 | 1 | 2 | 3 | 4;
|
|
4385
|
-
quartiles: number[];
|
|
4391
|
+
coeffs: (number | undefined)[][];
|
|
4386
4392
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4387
|
-
|
|
4388
|
-
isLess: boolean;
|
|
4389
|
-
arrDistrib: {
|
|
4390
|
-
name: string;
|
|
4391
|
-
indicators: number[];
|
|
4392
|
-
}[];
|
|
4393
|
+
coeffs: (number | undefined)[][];
|
|
4393
4394
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4394
4395
|
barChart: {
|
|
4395
4396
|
description: string;
|
|
@@ -4429,6 +4430,19 @@ declare const mathExercises: (Exercise<{
|
|
|
4429
4430
|
}, {
|
|
4430
4431
|
displayType: string;
|
|
4431
4432
|
}> | Exercise<{
|
|
4433
|
+
labels: string[];
|
|
4434
|
+
data: number[];
|
|
4435
|
+
itemAsked: number;
|
|
4436
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4437
|
+
isAskingX: boolean;
|
|
4438
|
+
xValue?: number;
|
|
4439
|
+
yValue?: number;
|
|
4440
|
+
a: number;
|
|
4441
|
+
b: number;
|
|
4442
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4443
|
+
points: number[][];
|
|
4444
|
+
labels: string[];
|
|
4445
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4432
4446
|
indexSituation: number;
|
|
4433
4447
|
bigNumber: number;
|
|
4434
4448
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
@@ -4441,6 +4455,20 @@ declare const mathExercises: (Exercise<{
|
|
|
4441
4455
|
evolutionType: string;
|
|
4442
4456
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4443
4457
|
quartiles: number[];
|
|
4458
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4459
|
+
quartileIndex: 0 | 1 | 2 | 3 | 4;
|
|
4460
|
+
quartiles: number[];
|
|
4461
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4462
|
+
quartiles: number[];
|
|
4463
|
+
arrQuartileIndex: (0 | 1 | 2 | 3 | 4)[];
|
|
4464
|
+
typeQ: "below" | "between" | "above";
|
|
4465
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4466
|
+
indexTopic: number;
|
|
4467
|
+
isLess: boolean;
|
|
4468
|
+
arrDistrib: {
|
|
4469
|
+
name: string;
|
|
4470
|
+
indicators: number[];
|
|
4471
|
+
}[];
|
|
4444
4472
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
4445
4473
|
indexSituation: number;
|
|
4446
4474
|
maxOrScam: 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;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"m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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -16,6 +16,9 @@ export type SimplifyOptions = {
|
|
|
16
16
|
forceSeparateSqrts?: boolean;
|
|
17
17
|
forceAddFractions?: boolean;
|
|
18
18
|
noAddOrder?: boolean;
|
|
19
|
+
forbidPowerMultiply?: boolean;
|
|
20
|
+
forbidPowerDivision?: boolean;
|
|
21
|
+
forbidPowerPower?: boolean;
|
|
19
22
|
};
|
|
20
23
|
export type EvaluateOptions = {
|
|
21
24
|
degreeMode?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,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AAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAiBpB,YAAY,IAAI,MAAM;IAItB,aAAa,IAAI,uBAAuB;IAQxC,UAAU;IAGV,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,mBAAmB;IAOnB,SAAS;IAoBT,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IA8BrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,GAAG,UAAQ,GAAG,aAAa;IA+M5D,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAOpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAOxD,mBAAmB;IAQnB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;CAQ5C"}
|
|
@@ -259,9 +259,11 @@ export class FractionNode {
|
|
|
259
259
|
if (isFractionNode(denum) && isFractionNode(num)) {
|
|
260
260
|
return new MultiplyNode(num, new FractionNode(denum.rightChild, denum.leftChild)).simplify(opts);
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
if (!opts?.forbidPowerDivision) {
|
|
263
|
+
const powerSimp = powerSimplify(num, denum, opts);
|
|
264
|
+
if (powerSimp)
|
|
265
|
+
return powerSimp;
|
|
266
|
+
}
|
|
265
267
|
if (num.equals(denum))
|
|
266
268
|
return new NumberNode(1);
|
|
267
269
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.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AAE;IAG5C,aAAa;;;;;;;;;IAYb,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOtC,IAAI;IAGJ,cAAc;IACd,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,GAAG,UAAQ,GAAG,aAAa;IAkK5D,mBAAmB,CAAC,IAAI,CAAC,EAAE,eAAe;IAM1C,mBAAmB;IAOnB,MAAM,CAAC,IAAI,EAAE,aAAa;IAU1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAQxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAMxD"}
|
|
@@ -348,9 +348,11 @@ export class MultiplyNode {
|
|
|
348
348
|
const fracSimplified = fractionSimplify(a, b, opts, log);
|
|
349
349
|
if (fracSimplified)
|
|
350
350
|
return fracSimplified;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
if (!opts?.forbidPowerMultiply) {
|
|
352
|
+
const powerSimplified = powerSimplify(a, b, opts, log);
|
|
353
|
+
if (powerSimplified)
|
|
354
|
+
return powerSimplified;
|
|
355
|
+
}
|
|
354
356
|
if (opts?.towardsDistribute && (isAddNode(a) || isSubstractNode(a))) {
|
|
355
357
|
return add(multiply(a.leftChild, b), multiply(a.rightChild, b)).simplify(opts, log);
|
|
356
358
|
}
|
|
@@ -131,7 +131,7 @@ export class PowerNode {
|
|
|
131
131
|
isNumberNode(rightSimplified)) {
|
|
132
132
|
return new NumberNode(round(leftSimplified.value ** rightSimplified.value, 8));
|
|
133
133
|
}
|
|
134
|
-
if (isPowerNode(leftSimplified)) {
|
|
134
|
+
if (!opts?.forbidPowerPower && isPowerNode(leftSimplified)) {
|
|
135
135
|
return new PowerNode(leftSimplified.leftChild, new MultiplyNode(rightSimplified, leftSimplified.rightChild).simplify(opts)).simplify(opts);
|
|
136
136
|
}
|
|
137
137
|
if (isSqrtNode(leftSimplified) &&
|