math-exercises 3.0.178 → 3.0.180
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/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
- package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/index.js +4 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/index.js +4 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -2
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
- package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
- package/lib/exercises/vea/polynomialVEA.js +17 -0
- package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
- package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/valueTableVEA.js +12 -0
- package/lib/index.d.ts +27 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -1
- package/lib/tree/utilities/nodeUtils.d.ts +6 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
- package/lib/tree/utilities/nodeUtils.js +24 -0
- package/lib/utils/strings/prependArticle.d.ts +2 -0
- package/lib/utils/strings/prependArticle.d.ts.map +1 -0
- package/lib/utils/strings/prependArticle.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { createNodeFPolynomialFromCoeffs, createNodeFPolynomialFromRoots, getAnswerStuffSolveSecondDegreePolynomial, getArrNodeCoeffOfPolynomialNode, getTexSolveSecondDegreeEquation, } from "../../../../math/utils/polynomial/polynomialUtils.js";
|
|
5
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { round } from "../../../../math/utils/round.js";
|
|
8
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.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 { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
14
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
const { nodeIdsF } = identifiers;
|
|
17
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
|
|
18
|
+
return `On note $h(x)$ la hauteur d'une balle de tennis en fonction de son abscisse.
|
|
19
|
+
|
|
20
|
+
On a :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
h(x) = ${nodeF.toTex()}
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
Déterminer pour quelle abscisse elle atteint sa hauteur maximale (donner la valeur arrondie à $2$ décimales).`;
|
|
27
|
+
};
|
|
28
|
+
const getAnswerStuff = (identifiers) => {
|
|
29
|
+
const { nodeIdsF } = identifiers;
|
|
30
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
|
|
31
|
+
const nodeDerivative = nodeF.derivative();
|
|
32
|
+
return getAnswerStuffSolveSecondDegreePolynomial(nodeDerivative);
|
|
33
|
+
};
|
|
34
|
+
const getAnswerNode = (identifiers) => {
|
|
35
|
+
const { arrNodeX } = getAnswerStuff(identifiers);
|
|
36
|
+
const arrNodeXRounded = arrNodeX.map((node) => round(node.evaluate(), 2).toTree());
|
|
37
|
+
const [nodeXRounded] = arrNodeXRounded;
|
|
38
|
+
return nodeXRounded;
|
|
39
|
+
};
|
|
40
|
+
const getAnswer = (identifiers) => {
|
|
41
|
+
return getAnswerNode(identifiers).toTex();
|
|
42
|
+
};
|
|
43
|
+
const getHint = () => {
|
|
44
|
+
return `La fonction $h$ est une fonction de la forme $x \\mapsto ax^2+bx+c$ avec $a < 0$.
|
|
45
|
+
C'est une trajectoire parabolique.
|
|
46
|
+
Le maximum est atteint à l'abscisse $x_M$ telle que $h'(x_M) = 0$.`;
|
|
47
|
+
};
|
|
48
|
+
const getCorrection = (identifiers) => {
|
|
49
|
+
const { nodeIdsF } = identifiers;
|
|
50
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
|
|
51
|
+
const nodeDerivative = nodeF.derivative();
|
|
52
|
+
return `$h(x)$ est de la forme $ax^2+bx+c$ avec $a < 0$.
|
|
53
|
+
|
|
54
|
+
C'est une trajectoire parabolique.
|
|
55
|
+
Le maximum est atteint à l'abscisse $x_M$ telle que $h'(x_M) = 0$.
|
|
56
|
+
|
|
57
|
+
$h$ est continue et dérivable. On calcule :
|
|
58
|
+
|
|
59
|
+
$$
|
|
60
|
+
h'(x) = ${nodeDerivative.simplify().toTex()}
|
|
61
|
+
$$
|
|
62
|
+
|
|
63
|
+
On résout $h'(x)=0$ :
|
|
64
|
+
|
|
65
|
+
${getTexSolveSecondDegreeEquation(nodeDerivative)}
|
|
66
|
+
|
|
67
|
+
Le maximum est atteint à l'abscisse $${getAnswer(identifiers)}$.
|
|
68
|
+
|
|
69
|
+
`;
|
|
70
|
+
};
|
|
71
|
+
const getPropositions = (n, { answer }) => {
|
|
72
|
+
const propositions = [];
|
|
73
|
+
addValidProp(propositions, answer);
|
|
74
|
+
propWhile(propositions, n, () => {
|
|
75
|
+
const identifierWrong = createRandomIdentifiers();
|
|
76
|
+
tryToAddWrongProp(propositions, getAnswer(identifierWrong));
|
|
77
|
+
});
|
|
78
|
+
return shuffle(propositions);
|
|
79
|
+
};
|
|
80
|
+
const getKeys = () => {
|
|
81
|
+
return [];
|
|
82
|
+
};
|
|
83
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
84
|
+
try {
|
|
85
|
+
return numberVEA(ans, answer);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return handleVEAError(err);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const createRandomIdentifiers = () => {
|
|
92
|
+
//roots
|
|
93
|
+
const span = randint(12, 16) * 2; //distance between roots
|
|
94
|
+
const a = randint(-10, -1);
|
|
95
|
+
const b = a + span;
|
|
96
|
+
const arrNodeX = [a, b].map((v) => v.toTree());
|
|
97
|
+
//height
|
|
98
|
+
const nodeHeight = randfloat(1.5, 5, 2);
|
|
99
|
+
const nodeU = opposite(frac(multiply(4, nodeHeight), power(span, 2)));
|
|
100
|
+
const nodeF = createNodeFPolynomialFromRoots(nodeU, arrNodeX);
|
|
101
|
+
//rounding
|
|
102
|
+
const arrNodeCoeffRounded = getArrNodeCoeffOfPolynomialNode(nodeF).map((node) => round(node.evaluate(), 2).toTree());
|
|
103
|
+
const nodeFRoundedExpanded = createNodeFPolynomialFromCoeffs(arrNodeCoeffRounded);
|
|
104
|
+
return {
|
|
105
|
+
nodeIdsF: nodeFRoundedExpanded.toIdentifiers(),
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
const getProblemProjectileHeightFindAbscissaQuestion = () => {
|
|
109
|
+
const identifiers = createRandomIdentifiers();
|
|
110
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
111
|
+
};
|
|
112
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
113
|
+
return {
|
|
114
|
+
answer: getAnswer(identifiers),
|
|
115
|
+
instruction: getInstruction(identifiers),
|
|
116
|
+
keys: getKeys(identifiers),
|
|
117
|
+
answerFormat: "tex",
|
|
118
|
+
identifiers,
|
|
119
|
+
hint: getHint(identifiers),
|
|
120
|
+
correction: getCorrection(identifiers),
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export const problemProjectileHeightFindAbscissa = {
|
|
124
|
+
id: "problemProjectileHeightFindAbscissa",
|
|
125
|
+
connector: "=",
|
|
126
|
+
label: "Déterminer pour quelle abscisse une balle de tennis atteint sa hauteur maximale",
|
|
127
|
+
isSingleStep: true,
|
|
128
|
+
generator: (nb) => getDistinctQuestions(() => getProblemProjectileHeightFindAbscissaQuestion(), nb),
|
|
129
|
+
subject: "Mathématiques",
|
|
130
|
+
getInstruction,
|
|
131
|
+
getHint,
|
|
132
|
+
getCorrection,
|
|
133
|
+
isAnswerValid,
|
|
134
|
+
getPropositions,
|
|
135
|
+
getQuestionFromIdentifiers,
|
|
136
|
+
hasHintAndCorrection: true,
|
|
137
|
+
};
|
package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nodeIdsSlope: NodeIdentifiers;
|
|
5
|
+
nodeIdsF: NodeIdentifiers;
|
|
6
|
+
nodeIdsAbscissa: NodeIdentifiers[];
|
|
7
|
+
};
|
|
8
|
+
export declare const derivativeEquationSolvingByManipulatingLineY: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=derivativeEquationSolvingByManipulatingLineY.d.ts.map
|
package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivativeEquationSolvingByManipulatingLineY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAqE7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,eAAe,EAAE,eAAe,EAAE,CAAC;CACpC,CAAC;AA0gBF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAmB5E,CAAC"}
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { SetVEA } from "../../../../exercises/vea/setVEA.js";
|
|
4
|
+
import { blueMain, greenMain, orange, red } from "../../../../geogebra/colors.js";
|
|
5
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
6
|
+
import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
7
|
+
import { createIntegratedPolynomialNode, createNodeFPolynomialFromRoots, getArrNodeCoeffOfPolynomialNode, } from "../../../../math/utils/polynomial/polynomialUtils.js";
|
|
8
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
9
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
10
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
11
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
12
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
13
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
14
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
16
|
+
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
17
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
18
|
+
import { randomMany } from "../../../../utils/alea/random.js";
|
|
19
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
20
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
21
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
22
|
+
function getCoordsFrame(nodeF, xMin, xMax) {
|
|
23
|
+
const stepX = 0.05;
|
|
24
|
+
const arrX = [...Array(Math.floor((xMax - xMin) / stepX)).keys()].map((i) => xMin + i * stepX);
|
|
25
|
+
const yForXMin = nodeF.evaluate({ x: xMin });
|
|
26
|
+
const { yMin, yMax } = arrX.slice(1).reduce((acc, x) => {
|
|
27
|
+
const { yMin, yMax } = acc;
|
|
28
|
+
const y = nodeF.evaluate({ x });
|
|
29
|
+
if (y < yMin) {
|
|
30
|
+
acc.yMin = y;
|
|
31
|
+
}
|
|
32
|
+
else if (y > yMax) {
|
|
33
|
+
acc.yMax = y;
|
|
34
|
+
}
|
|
35
|
+
return acc;
|
|
36
|
+
}, { yMin: yForXMin, yMax: yForXMin });
|
|
37
|
+
return {
|
|
38
|
+
xMin,
|
|
39
|
+
xMax,
|
|
40
|
+
yMin,
|
|
41
|
+
yMax,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function getNodeYIntercept(nodeF, nodeXAsked, nodeDerivative = nodeF.derivative()) {
|
|
45
|
+
const nodeValueImage = nodeBySubstitutingVar(nodeF, nodeXAsked, "x".toTree()).simplify();
|
|
46
|
+
const nodeValueDerivative = nodeBySubstitutingVar(nodeDerivative, nodeXAsked, "x".toTree()).simplify();
|
|
47
|
+
const nodeX = "x".toTree();
|
|
48
|
+
const nodeT = add(multiply(nodeValueDerivative, substract(nodeX, nodeXAsked)), nodeValueImage);
|
|
49
|
+
const [nodeYIntercept] = getArrNodeCoeffOfPolynomialNode(nodeT);
|
|
50
|
+
return nodeYIntercept;
|
|
51
|
+
}
|
|
52
|
+
const getInstruction = (identifiers) => {
|
|
53
|
+
const { nodeIdsSlope } = identifiers;
|
|
54
|
+
const nodeSlope = NodeConstructor.fromIdentifiers(nodeIdsSlope);
|
|
55
|
+
return `Ci-dessous est tracée la courbe $\\mathcal C_f$ de la fonction $f$.
|
|
56
|
+
|
|
57
|
+
En manipulant le point $A$,
|
|
58
|
+
on peut faire glisser la droite de coefficient directeur $${nodeSlope.toTex()}$ et d'ordonnée à l'origine $a$.
|
|
59
|
+
|
|
60
|
+
Résoudre l'équation $f'(x) = ${nodeSlope.toTex()}$ sur l'intervalle visible.`;
|
|
61
|
+
};
|
|
62
|
+
const getAnswerNode = (identifiers) => {
|
|
63
|
+
const { nodeIdsAbscissa } = identifiers;
|
|
64
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
65
|
+
const nodeSet = new DiscreteSetNode(arrNodeX);
|
|
66
|
+
return nodeSet;
|
|
67
|
+
};
|
|
68
|
+
const getAnswer = (identifiers) => {
|
|
69
|
+
return `S=${getAnswerNode(identifiers).toTex()}`;
|
|
70
|
+
};
|
|
71
|
+
const getHint = () => {
|
|
72
|
+
return `Le nombre dérivé de $f$ en $x$, aussi noté $f'(x)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $x$.
|
|
73
|
+
|
|
74
|
+
Résoudre l'équation $f'(x) = k$,
|
|
75
|
+
c'est trouver toutes les abscisses $x$
|
|
76
|
+
pour lesquelles le coefficient directeur la tangente à la courbe représentative de $f$ vaut $k$.`;
|
|
77
|
+
};
|
|
78
|
+
const getCorrection = (identifiers) => {
|
|
79
|
+
const { nodeIdsAbscissa, nodeIdsSlope } = identifiers;
|
|
80
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
81
|
+
const nodeSlope = NodeConstructor.fromIdentifiers(nodeIdsSlope);
|
|
82
|
+
return `Le nombre dérivé de $f$ en $x$, aussi noté $f'(x)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $x$.
|
|
83
|
+
|
|
84
|
+
En manipulant le point $A$, on observe que :
|
|
85
|
+
|
|
86
|
+
${alignTex(arrNodeX.map((nodeX) => {
|
|
87
|
+
return [`f'(${nodeX.toTex()})`, "=", `${nodeSlope.toTex()}`];
|
|
88
|
+
}))}
|
|
89
|
+
|
|
90
|
+
La solution de l'équation est donc :
|
|
91
|
+
|
|
92
|
+
$$
|
|
93
|
+
${getAnswer(identifiers)}
|
|
94
|
+
$$`;
|
|
95
|
+
};
|
|
96
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
97
|
+
const { nodeIdsAbscissa, nodeIdsSlope, nodeIdsF } = identifiers;
|
|
98
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
99
|
+
const [nodeSlope, nodeF] = [nodeIdsSlope, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
100
|
+
const slope = nodeSlope.evaluate();
|
|
101
|
+
const arrX = arrNodeX.map((node) => node.evaluate());
|
|
102
|
+
const commands = [
|
|
103
|
+
`f(x) = ${nodeF.toMathString()}`,
|
|
104
|
+
`SetColor(f, "${blueMain}")`,
|
|
105
|
+
`SetCaption(f, "$\\mathcal C_f$")`,
|
|
106
|
+
`ShowLabel(f, true)`,
|
|
107
|
+
//solution
|
|
108
|
+
...arrX.flatMap((x, i) => {
|
|
109
|
+
const image = nodeF.evaluate({
|
|
110
|
+
x,
|
|
111
|
+
});
|
|
112
|
+
return [
|
|
113
|
+
//tangent
|
|
114
|
+
`t${i}(x) = ${image} + (x-${x}) (${slope})`,
|
|
115
|
+
`SetColor(t${i}, "${orange}")`,
|
|
116
|
+
//curve point
|
|
117
|
+
`B${i} = (${x},${image})`,
|
|
118
|
+
`SetPointStyle(B${i}, 1)`,
|
|
119
|
+
//arrow
|
|
120
|
+
`v${i} = Vector(B${i}, Point({${x},0}))`,
|
|
121
|
+
`SetColor(v${i}, "${greenMain}")`,
|
|
122
|
+
//point
|
|
123
|
+
`C${i} = (${x},0)`,
|
|
124
|
+
`SetPointStyle(C${i}, 1)`,
|
|
125
|
+
`SetColor(C${i}, "${greenMain}")`,
|
|
126
|
+
`SetCaption(C${i}, "$${x.frenchify()}$")`,
|
|
127
|
+
`ShowLabel(C${i}, true)`,
|
|
128
|
+
];
|
|
129
|
+
}),
|
|
130
|
+
];
|
|
131
|
+
const xMin = Math.min(...arrX) - 2;
|
|
132
|
+
const xMax = Math.max(...arrX) + 2;
|
|
133
|
+
const { yMin, yMax } = getCoordsFrame(nodeF, xMin, xMax);
|
|
134
|
+
const ggb = new GeogebraConstructor({
|
|
135
|
+
commands,
|
|
136
|
+
});
|
|
137
|
+
return ggb.getOptions({
|
|
138
|
+
coords: ggb.getAdaptedCoords({
|
|
139
|
+
xMin,
|
|
140
|
+
xMax,
|
|
141
|
+
yMin: Math.min(yMin, -2),
|
|
142
|
+
yMax,
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
const getGGBOptions = (identifiers) => {
|
|
147
|
+
const { nodeIdsAbscissa, nodeIdsSlope, nodeIdsF } = identifiers;
|
|
148
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
149
|
+
const [nodeSlope, nodeF] = [nodeIdsSlope, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
150
|
+
const slope = nodeSlope.evaluate();
|
|
151
|
+
const arrX = arrNodeX.map((node) => node.evaluate());
|
|
152
|
+
const nodeDerivative = nodeF.derivative();
|
|
153
|
+
const arrNodeYIntercept = arrNodeX.map((nodeXAsked) => getNodeYIntercept(nodeF, nodeXAsked, nodeDerivative));
|
|
154
|
+
const xMin = Math.min(...arrX) - 2;
|
|
155
|
+
const xMax = Math.max(...arrX) + 2;
|
|
156
|
+
const { yMin, yMax } = getCoordsFrame(nodeF, xMin, xMax);
|
|
157
|
+
const [minSlider, maxSlider] = [-50, 50];
|
|
158
|
+
const stepSlider = 0.01;
|
|
159
|
+
const valueSliderInitial = randfloat(yMin, yMax, 1, [
|
|
160
|
+
...arrNodeYIntercept.map((nodeY) => nodeY.evaluate()),
|
|
161
|
+
]);
|
|
162
|
+
const commands = [
|
|
163
|
+
`f(x) = ${nodeF.toMathString()}`,
|
|
164
|
+
`SetColor(f, "${blueMain}")`,
|
|
165
|
+
`SetCaption(f, "$\\mathcal C_f$")`,
|
|
166
|
+
`ShowLabel(f, true)`,
|
|
167
|
+
`SetColor(f, "${blueMain}")`,
|
|
168
|
+
//slider
|
|
169
|
+
`a = Slider(${minSlider}, ${maxSlider}, ${stepSlider})`,
|
|
170
|
+
`SetValue(a, ${valueSliderInitial})`,
|
|
171
|
+
`SetVisibleInView(a, 1, false)`,
|
|
172
|
+
//moving point
|
|
173
|
+
`A = (0,a)`,
|
|
174
|
+
"SetPointStyle(A, 0)",
|
|
175
|
+
"SetPointSize(A,5)",
|
|
176
|
+
`ShowLabel(A,true)`,
|
|
177
|
+
//tangent
|
|
178
|
+
`t(x) = a + (${slope})x `,
|
|
179
|
+
`SetColor(t, "${red}")`,
|
|
180
|
+
];
|
|
181
|
+
const ggb = new GeogebraConstructor({
|
|
182
|
+
commands,
|
|
183
|
+
});
|
|
184
|
+
return ggb.getOptions({
|
|
185
|
+
coords: ggb.getAdaptedCoords({
|
|
186
|
+
xMin,
|
|
187
|
+
xMax,
|
|
188
|
+
yMin: Math.min(yMin, -2),
|
|
189
|
+
yMax,
|
|
190
|
+
}),
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
const getPropositions = (n, { answer, ..._identifiers }) => {
|
|
194
|
+
const propositions = [];
|
|
195
|
+
addValidProp(propositions, answer);
|
|
196
|
+
propWhile(propositions, n, () => {
|
|
197
|
+
const identifiersWrong = createRandomIdentifiers();
|
|
198
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
199
|
+
});
|
|
200
|
+
return shuffle(propositions);
|
|
201
|
+
};
|
|
202
|
+
const isAnswerValid = (ans, { answer, ...identifiers }, _optsIn) => {
|
|
203
|
+
const answerNode = getAnswerNode(identifiers);
|
|
204
|
+
const arrNodeAnswer = answerNode.elements;
|
|
205
|
+
const parsed = discreteSetParser(ans);
|
|
206
|
+
if (!parsed) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
const arrAns = parsed.elements;
|
|
210
|
+
return SetVEA.isArrayOfNodesValid(arrAns, arrNodeAnswer);
|
|
211
|
+
};
|
|
212
|
+
const createRandomIdentifiers = () => {
|
|
213
|
+
const nbX = randint(2, 4);
|
|
214
|
+
const arrX = (() => {
|
|
215
|
+
function createRandomArrX() {
|
|
216
|
+
const poolX = [...Array(11).keys()].map((i) => i - 5);
|
|
217
|
+
return randomMany(poolX, nbX).toSorted((v1, v2) => v1 - v2);
|
|
218
|
+
}
|
|
219
|
+
let arrX = [];
|
|
220
|
+
let isValid = false;
|
|
221
|
+
let counter = -1;
|
|
222
|
+
while (!isValid && counter < 100) {
|
|
223
|
+
counter++;
|
|
224
|
+
const arrXCandidate = createRandomArrX();
|
|
225
|
+
const isSeparatedNicely = () => zip(arrXCandidate.slice(0, -1), arrXCandidate.slice(1))
|
|
226
|
+
.map(([x1, x2]) => x2 - x1)
|
|
227
|
+
.find((elt) => elt === 1) === undefined;
|
|
228
|
+
isValid = isSeparatedNicely();
|
|
229
|
+
if (isValid) {
|
|
230
|
+
arrX = arrXCandidate;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (!isValid) {
|
|
234
|
+
switch (nbX) {
|
|
235
|
+
case 0:
|
|
236
|
+
return [-3];
|
|
237
|
+
case 1:
|
|
238
|
+
return [-2, 3];
|
|
239
|
+
case 2:
|
|
240
|
+
return [-4, 2, 5];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return arrX;
|
|
244
|
+
})();
|
|
245
|
+
const arrNodeX = arrX.map((x) => x.toTree());
|
|
246
|
+
//f'(x) = a(x-x1)...(x-xn) + k
|
|
247
|
+
//=> f'(x1) = ... = f'(xn) = k
|
|
248
|
+
const nodeA = frac(coinFlip() ? -1 : +1, 5 * nbX);
|
|
249
|
+
const maxSlopeAbs = 1.5;
|
|
250
|
+
const nodeK = randfloat(-maxSlopeAbs, maxSlopeAbs, 1, [0]).toTree();
|
|
251
|
+
const nodeDerivative = add(createNodeFPolynomialFromRoots(nodeA, arrNodeX), nodeK);
|
|
252
|
+
const nodeC = randint(-3, 3).toTree();
|
|
253
|
+
const nodeF = createIntegratedPolynomialNode(nodeDerivative, nodeC);
|
|
254
|
+
const identifiers = {
|
|
255
|
+
nodeIdsSlope: nodeK.toIdentifiers(),
|
|
256
|
+
nodeIdsF: nodeF.toIdentifiers(),
|
|
257
|
+
nodeIdsAbscissa: arrNodeX.map((node) => node.toIdentifiers()),
|
|
258
|
+
};
|
|
259
|
+
return identifiers;
|
|
260
|
+
};
|
|
261
|
+
const getDerivativeEquationSolvingByManipulatingLineYQuestion = (opts) => {
|
|
262
|
+
let identifiers;
|
|
263
|
+
let isValid = false;
|
|
264
|
+
let counter = -1;
|
|
265
|
+
while (!isValid && counter < 100) {
|
|
266
|
+
counter++;
|
|
267
|
+
const identifiersCandidate = createRandomIdentifiers();
|
|
268
|
+
const isReadable = (identifiers) => {
|
|
269
|
+
const { nodeIdsAbscissa, nodeIdsF } = identifiers;
|
|
270
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
271
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
|
|
272
|
+
const arrX = arrNodeX.map((node) => node.evaluate());
|
|
273
|
+
const xMin = Math.min(...arrX) - 2;
|
|
274
|
+
const xMax = Math.max(...arrX) + 2;
|
|
275
|
+
const { yMin, yMax } = getCoordsFrame(nodeF, xMin, xMax);
|
|
276
|
+
return frac(yMax - yMin, xMax - xMin).evaluate() <= 0.888;
|
|
277
|
+
};
|
|
278
|
+
const isDerivativeOk = (identifiers) => {
|
|
279
|
+
const { nodeIdsAbscissa, nodeIdsSlope, nodeIdsF } = identifiers;
|
|
280
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
281
|
+
const [nodeSlope, nodeF] = [nodeIdsSlope, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
282
|
+
const nodeDerivative = nodeF.derivative().simplify();
|
|
283
|
+
return arrNodeX.every((nodeX) => nodeDerivative.evaluate({ x: nodeX.evaluate() }) ===
|
|
284
|
+
nodeSlope.evaluate());
|
|
285
|
+
};
|
|
286
|
+
const isYInterceptsOk = (identifiers) => {
|
|
287
|
+
const { nodeIdsAbscissa, nodeIdsSlope, nodeIdsF } = identifiers;
|
|
288
|
+
const arrNodeX = nodeIdsAbscissa.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
289
|
+
const [nodeSlope, nodeF] = [nodeIdsSlope, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
290
|
+
const slope = nodeSlope.evaluate();
|
|
291
|
+
const nodeDerivative = nodeF.derivative().simplify();
|
|
292
|
+
const arrNodeYIntercept = arrNodeX.map((nodeX) => getNodeYIntercept(nodeF, nodeX, nodeDerivative));
|
|
293
|
+
const arrYInterceptSorted = arrNodeYIntercept
|
|
294
|
+
.map((node) => node.evaluate())
|
|
295
|
+
.toSorted((y1, y2) => y1 - y2);
|
|
296
|
+
const isReachableYIntercepts = () => {
|
|
297
|
+
const arrX = arrNodeX.map((node) => node.evaluate());
|
|
298
|
+
const xMin = Math.min(...arrX) - 1;
|
|
299
|
+
const xMax = Math.max(...arrX) + 1;
|
|
300
|
+
const { yMin, yMax } = getCoordsFrame(nodeF, xMin, xMax);
|
|
301
|
+
return arrYInterceptSorted.every((yIntercept) => yMin < yIntercept && yIntercept < yMax);
|
|
302
|
+
};
|
|
303
|
+
const isDistinctYIntercepts = () => {
|
|
304
|
+
return zip(arrYInterceptSorted.slice(0, -1), arrYInterceptSorted.slice(1)).every(([y1, y2]) => y2 - y1 > 0.666 * Math.abs(slope));
|
|
305
|
+
};
|
|
306
|
+
return isReachableYIntercepts() && isDistinctYIntercepts();
|
|
307
|
+
};
|
|
308
|
+
isValid =
|
|
309
|
+
isReadable(identifiersCandidate) &&
|
|
310
|
+
isDerivativeOk(identifiersCandidate) &&
|
|
311
|
+
isYInterceptsOk(identifiersCandidate);
|
|
312
|
+
if (isValid) {
|
|
313
|
+
identifiers = identifiersCandidate;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (!isValid) {
|
|
317
|
+
//copié-collé depuis le dashboard::viewer
|
|
318
|
+
const identifiersDefault = {
|
|
319
|
+
nodeIdsSlope: {
|
|
320
|
+
id: 7,
|
|
321
|
+
value: -0.2,
|
|
322
|
+
},
|
|
323
|
+
nodeIdsF: {
|
|
324
|
+
id: 3,
|
|
325
|
+
leftChild: {
|
|
326
|
+
id: 0,
|
|
327
|
+
leftChild: {
|
|
328
|
+
id: 2,
|
|
329
|
+
leftChild: {
|
|
330
|
+
id: 7,
|
|
331
|
+
value: 2025,
|
|
332
|
+
},
|
|
333
|
+
rightChild: {
|
|
334
|
+
id: 5,
|
|
335
|
+
leftChild: {
|
|
336
|
+
id: 10,
|
|
337
|
+
name: "x",
|
|
338
|
+
},
|
|
339
|
+
rightChild: {
|
|
340
|
+
id: 7,
|
|
341
|
+
value: 4,
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
rightChild: {
|
|
346
|
+
id: 2,
|
|
347
|
+
leftChild: {
|
|
348
|
+
id: 7,
|
|
349
|
+
value: 60,
|
|
350
|
+
},
|
|
351
|
+
rightChild: {
|
|
352
|
+
id: 0,
|
|
353
|
+
leftChild: {
|
|
354
|
+
id: 2,
|
|
355
|
+
leftChild: {
|
|
356
|
+
id: 7,
|
|
357
|
+
value: -225,
|
|
358
|
+
},
|
|
359
|
+
rightChild: {
|
|
360
|
+
id: 5,
|
|
361
|
+
leftChild: {
|
|
362
|
+
id: 10,
|
|
363
|
+
name: "x",
|
|
364
|
+
},
|
|
365
|
+
rightChild: {
|
|
366
|
+
id: 7,
|
|
367
|
+
value: 3,
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
rightChild: {
|
|
372
|
+
id: 2,
|
|
373
|
+
leftChild: {
|
|
374
|
+
id: 7,
|
|
375
|
+
value: 9,
|
|
376
|
+
},
|
|
377
|
+
rightChild: {
|
|
378
|
+
id: 0,
|
|
379
|
+
leftChild: {
|
|
380
|
+
id: 2,
|
|
381
|
+
leftChild: {
|
|
382
|
+
id: 7,
|
|
383
|
+
value: -30,
|
|
384
|
+
},
|
|
385
|
+
rightChild: {
|
|
386
|
+
id: 5,
|
|
387
|
+
leftChild: {
|
|
388
|
+
id: 10,
|
|
389
|
+
name: "x",
|
|
390
|
+
},
|
|
391
|
+
rightChild: {
|
|
392
|
+
id: 7,
|
|
393
|
+
value: 2,
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
rightChild: {
|
|
398
|
+
id: 2,
|
|
399
|
+
leftChild: {
|
|
400
|
+
id: 7,
|
|
401
|
+
value: 15,
|
|
402
|
+
},
|
|
403
|
+
rightChild: {
|
|
404
|
+
id: 0,
|
|
405
|
+
leftChild: {
|
|
406
|
+
id: 2,
|
|
407
|
+
leftChild: {
|
|
408
|
+
id: 7,
|
|
409
|
+
value: 17,
|
|
410
|
+
},
|
|
411
|
+
rightChild: {
|
|
412
|
+
id: 10,
|
|
413
|
+
name: "x",
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
rightChild: {
|
|
417
|
+
id: 7,
|
|
418
|
+
value: -30,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
rightChild: {
|
|
428
|
+
id: 7,
|
|
429
|
+
value: 121500,
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
nodeIdsAbscissa: [
|
|
433
|
+
{
|
|
434
|
+
id: 7,
|
|
435
|
+
value: -2,
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: 7,
|
|
439
|
+
value: 2,
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
id: 7,
|
|
443
|
+
value: 5,
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
};
|
|
447
|
+
identifiers = identifiersDefault;
|
|
448
|
+
}
|
|
449
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
450
|
+
};
|
|
451
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
452
|
+
return {
|
|
453
|
+
instruction: getInstruction(identifiers, opts),
|
|
454
|
+
answer: getAnswer(identifiers),
|
|
455
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
456
|
+
answerFormat: "tex",
|
|
457
|
+
keys: ["S", "equal", "lbrace", "semicolon", "rbrace"],
|
|
458
|
+
hint: getHint(identifiers, opts),
|
|
459
|
+
correction: getCorrection(identifiers, opts),
|
|
460
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
|
|
461
|
+
identifiers,
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
export const derivativeEquationSolvingByManipulatingLineY = {
|
|
465
|
+
id: "derivativeEquationSolvingByManipulatingLineY",
|
|
466
|
+
connector: "=",
|
|
467
|
+
label: `Résoudre une équation du type "$f'(x) = k$" par la manipulation d'une droite de coefficient directeur fixé`,
|
|
468
|
+
isSingleStep: false,
|
|
469
|
+
generator: (nb) => getDistinctQuestions(getDerivativeEquationSolvingByManipulatingLineYQuestion, nb),
|
|
470
|
+
qcmTimer: 60,
|
|
471
|
+
freeTimer: 60,
|
|
472
|
+
getPropositions,
|
|
473
|
+
isAnswerValid,
|
|
474
|
+
subject: "Mathématiques",
|
|
475
|
+
getQuestionFromIdentifiers,
|
|
476
|
+
hasHintAndCorrection: true,
|
|
477
|
+
hasGeogebra: true,
|
|
478
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nodeIdsSlope: NodeIdentifiers;
|
|
5
|
+
nodeIdsF: NodeIdentifiers;
|
|
6
|
+
nodeIdsAbscissa: NodeIdentifiers[];
|
|
7
|
+
};
|
|
8
|
+
export declare const derivativeEquationSolvingByManipulatingLineYAndSlope: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAqE7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,eAAe,EAAE,eAAe,EAAE,CAAC;CACpC,CAAC;AAqiBF,eAAO,MAAM,oDAAoD,EAAE,QAAQ,CAAC,WAAW,CAmBpF,CAAC"}
|