math-exercises 2.2.20 → 2.2.22
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/exercise.d.ts +22 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +107 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +1 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +113 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +44 -19
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +110 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/derivation/index.d.ts +0 -1
- package/lib/exercises/math/derivation/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/index.js +0 -1
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts +8 -0
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.js +102 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts +42 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +231 -0
- package/lib/exercises/math/derivation/tangent/index.d.ts +2 -0
- package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/index.js +2 -0
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +1 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +1 -0
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +11 -17
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +1 -0
- package/lib/exercises/math/geometry/vectors/index.d.ts +1 -2
- package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/index.js +1 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +19 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +136 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +60 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +67 -0
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +1 -1
- package/lib/exercises/math/percent/cmToEvolution.js +1 -1
- package/lib/exercises/math/powers/powersDivision.js +1 -1
- package/lib/exercises/math/powers/powersProduct.js +1 -1
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +1 -1
- package/lib/exercises/math/probaStat/conditionalProbability.js +1 -1
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +1 -1
- package/lib/exercises/pc/index.d.ts +3 -3
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +3 -3
- package/lib/index.d.ts +27 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +1 -0
- package/lib/math/polynomials/polynomial.js +1 -1
- package/lib/math/polynomials/trinom.d.ts +5 -0
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +12 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +10 -12
- package/lib/prototypesEnhancement.d.ts +2 -1
- package/lib/prototypesEnhancement.d.ts.map +1 -1
- package/lib/prototypesEnhancement.js +2 -2
- package/lib/server.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +2 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +4 -3
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +7 -3
- package/lib/tree/nodes/operators/addNode.d.ts +2 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +12 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +16 -11
- package/lib/tree/nodes/operators/substractNode.d.ts +4 -3
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -5
- package/lib/tree/parsers/affineParser.d.ts +3 -0
- package/lib/tree/parsers/affineParser.d.ts.map +1 -0
- package/lib/tree/parsers/affineParser.js +26 -0
- package/lib/tree/parsers/monomParser.d.ts +2 -0
- package/lib/tree/parsers/monomParser.d.ts.map +1 -0
- package/lib/tree/parsers/monomParser.js +5 -0
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/latex/alignTex.d.ts +2 -0
- package/lib/utils/latex/alignTex.d.ts.map +1 -0
- package/lib/utils/latex/alignTex.js +20 -0
- package/lib/utils/latex/colorize.d.ts +2 -0
- package/lib/utils/latex/colorize.d.ts.map +1 -0
- package/lib/utils/latex/colorize.js +9 -0
- package/package.json +4 -1
|
@@ -10,7 +10,7 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
|
10
10
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
11
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
12
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
14
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
15
15
|
const getFactoType1Question = () => {
|
|
16
16
|
const affine = affine_1.AffineConstructor.random({
|
|
@@ -8,7 +8,7 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
8
8
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
10
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
11
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
12
12
|
const getFactoType1Question = () => {
|
|
13
13
|
const affine = affine_1.AffineConstructor.random({
|
|
14
14
|
min: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -72,7 +72,6 @@ const isAnswerValid = (ans, { affinesCoeffs, operation }) => {
|
|
|
72
72
|
? affine1.multiply(affine2).toTree()
|
|
73
73
|
: new multiplyNode_1.MultiplyNode(affine2.toTree(), affine1.toTree())
|
|
74
74
|
: new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.toTree());
|
|
75
|
-
const answer = answerTree.toTex();
|
|
76
75
|
const validLatexs = answerTree.toAllValidTexs();
|
|
77
76
|
return validLatexs.includes(ans);
|
|
78
77
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
d: number;
|
|
7
|
+
isSubstract: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const factoType2: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=factoType2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factoType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAmIF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAiB5C,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.factoType2 = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
12
|
+
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
13
|
+
const buildFromIdentifiers = (identifiers) => { };
|
|
14
|
+
const getPropositions = (n, { answer, a, b, c, d, isSubstract }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
const affine1 = new affine_1.Affine(a, b);
|
|
17
|
+
const affine2 = new affine_1.Affine(c, d);
|
|
18
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({ a, b, c, d, isSubstract: !isSubstract }));
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.toTree()).toTex());
|
|
21
|
+
while (propositions.length < n) {
|
|
22
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(affine1.toTree(), affine_1.AffineConstructor.random().toTree()).toTex());
|
|
23
|
+
}
|
|
24
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
25
|
+
};
|
|
26
|
+
const getAnswerTree = (identifiers) => {
|
|
27
|
+
const affine1 = new affine_1.Affine(identifiers.a, identifiers.b);
|
|
28
|
+
const affine2 = new affine_1.Affine(identifiers.c, identifiers.d);
|
|
29
|
+
return new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.add(identifiers.isSubstract ? -1 : 1).toTree());
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
return getAnswerTree(identifiers).toTex();
|
|
33
|
+
};
|
|
34
|
+
const getInstruction = (identifiers) => {
|
|
35
|
+
const affine1 = new affine_1.Affine(identifiers.a, identifiers.b);
|
|
36
|
+
const affine2 = new affine_1.Affine(identifiers.c, identifiers.d);
|
|
37
|
+
const statement = new (identifiers.isSubstract ? substractNode_1.SubstractNode : addNode_1.AddNode)(new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.toTree()), affine1.toTree());
|
|
38
|
+
return `Factoriser et réduire :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
${statement.toTex()}
|
|
42
|
+
$$`;
|
|
43
|
+
};
|
|
44
|
+
const getHint = (identifiers) => {
|
|
45
|
+
return `Repère d'abord le facteur commun dans cette expression. Puis, multiplie ce facteur commun par les autres termes de l'expression.`;
|
|
46
|
+
};
|
|
47
|
+
const getCorrection = (identifiers) => {
|
|
48
|
+
const affine1 = new affine_1.Affine(identifiers.a, identifiers.b);
|
|
49
|
+
const affine2 = new affine_1.Affine(identifiers.c, identifiers.d);
|
|
50
|
+
const answer = getAnswer(identifiers);
|
|
51
|
+
const statement = new (identifiers.isSubstract ? substractNode_1.SubstractNode : addNode_1.AddNode)(new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.toTree()), affine1.toTree());
|
|
52
|
+
const corr = `
|
|
53
|
+
${(0, alignTex_1.alignTex)([
|
|
54
|
+
[
|
|
55
|
+
statement.toTex(),
|
|
56
|
+
"=",
|
|
57
|
+
new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(affine1.toTree(), affine2.toTree()), new multiplyNode_1.MultiplyNode(affine1.toTree(), identifiers.isSubstract ? (-1).toTree() : (1).toTree())).toTex(),
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"",
|
|
61
|
+
"=",
|
|
62
|
+
new multiplyNode_1.MultiplyNode(affine1.toTree(), new (identifiers.isSubstract ? substractNode_1.SubstractNode : addNode_1.AddNode)(affine2.toTree(), (1).toTree())).toTex(),
|
|
63
|
+
],
|
|
64
|
+
["", "=", answer],
|
|
65
|
+
])}
|
|
66
|
+
`;
|
|
67
|
+
return corr;
|
|
68
|
+
};
|
|
69
|
+
const getKeys = (identifiers) => {
|
|
70
|
+
return ["x"];
|
|
71
|
+
};
|
|
72
|
+
const isAnswerValid = (ans, { answer, a, b, c, d, isSubstract }) => {
|
|
73
|
+
const tree = getAnswerTree({ a, b, c, d, isSubstract });
|
|
74
|
+
return ans === answer || tree.toAllValidTexs().includes(ans);
|
|
75
|
+
};
|
|
76
|
+
const getFactoType2Question = () => {
|
|
77
|
+
const b = (0, randint_1.randint)(-10, 11);
|
|
78
|
+
const a = (0, randint_1.randint)(-10, 11, [0]);
|
|
79
|
+
const c = (0, randint_1.randint)(-10, 11, [0]);
|
|
80
|
+
const d = (0, randint_1.randint)(-10, 11, b === 0 ? [0, -1] : [0]);
|
|
81
|
+
const isSubstract = (0, coinFlip_1.coinFlip)();
|
|
82
|
+
const identifiers = { a, b, c, d, isSubstract };
|
|
83
|
+
const question = {
|
|
84
|
+
answer: getAnswer(identifiers),
|
|
85
|
+
instruction: getInstruction(identifiers),
|
|
86
|
+
keys: getKeys(identifiers),
|
|
87
|
+
answerFormat: "tex",
|
|
88
|
+
identifiers,
|
|
89
|
+
hint: getHint(identifiers),
|
|
90
|
+
correction: getCorrection(identifiers),
|
|
91
|
+
};
|
|
92
|
+
return question;
|
|
93
|
+
};
|
|
94
|
+
exports.factoType2 = {
|
|
95
|
+
id: "factoType2",
|
|
96
|
+
connector: "=",
|
|
97
|
+
label: "Factorisation du type $\\left(ax+b\\right)\\left(cx+d\\right)\\pm\\left(ax+b\\right)$",
|
|
98
|
+
isSingleStep: true,
|
|
99
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactoType2Question, nb),
|
|
100
|
+
qcmTimer: 60,
|
|
101
|
+
freeTimer: 60,
|
|
102
|
+
ggbTimer: 60,
|
|
103
|
+
getPropositions,
|
|
104
|
+
isAnswerValid,
|
|
105
|
+
subject: "Mathématiques",
|
|
106
|
+
getHint,
|
|
107
|
+
getCorrection,
|
|
108
|
+
getAnswer,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -9,7 +9,7 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
|
9
9
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
10
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
11
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
12
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
13
13
|
//(x-a)^2-b^2 avec b entier
|
|
14
14
|
const getFactorizeCanonicalFormQuestion = () => {
|
|
15
15
|
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 10, [0]));
|
|
@@ -10,7 +10,7 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
|
10
10
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
11
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
12
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
14
|
//(x-a)^2-b^2 avec b irrational
|
|
15
15
|
const getFactorizeCanonicalFormWithSqrtQuestion = () => {
|
|
16
16
|
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 10, [0]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC"}
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./factoIdRmq3"), exports);
|
|
|
20
20
|
__exportStar(require("./factoType1Exercise"), exports);
|
|
21
21
|
__exportStar(require("./factorizeCanonicalForm"), exports);
|
|
22
22
|
__exportStar(require("./factorizeCanonicalFormWithSqrt"), exports);
|
|
23
|
+
__exportStar(require("./factoType2"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC"}
|
|
@@ -16,5 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./derivative"), exports);
|
|
18
18
|
__exportStar(require("./derivativeNumberCalcul"), exports);
|
|
19
|
-
__exportStar(require("./derivativeNumberReading"), exports);
|
|
20
19
|
__exportStar(require("./tangent"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AA2FF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.derivativeNumberReading = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../../geogebra/colors");
|
|
7
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
8
|
+
const integer_1 = require("../../../../math/numbers/integer/integer");
|
|
9
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
10
|
+
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
11
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
12
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
13
|
+
const shuffle_1 = require("../../../../utils/shuffle");
|
|
14
|
+
const getDerivativeNumberReading = () => {
|
|
15
|
+
let xA, yA, xB, yB;
|
|
16
|
+
[xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-5, 6));
|
|
17
|
+
xB = xA > 0 ? (0, randint_1.randint)(xA - 4, 6, [xA]) : (0, randint_1.randint)(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
|
|
18
|
+
yB = yA > 0 ? (0, randint_1.randint)(yA - 4, 6) : (0, randint_1.randint)(-4, yA + 5);
|
|
19
|
+
const pente = new rational_1.Rational(yB - yA, xB - xA).simplify();
|
|
20
|
+
const origin = pente
|
|
21
|
+
.opposite()
|
|
22
|
+
.multiply(new integer_1.Integer(xA))
|
|
23
|
+
.add(new integer_1.Integer(yA));
|
|
24
|
+
const penteTree = pente.toTree();
|
|
25
|
+
const originTree = origin.toTree();
|
|
26
|
+
const penteString = penteTree.toMathString();
|
|
27
|
+
const originString = originTree.toMathString();
|
|
28
|
+
const penteValue = pente.value;
|
|
29
|
+
const originValue = origin.value;
|
|
30
|
+
const [a, b] = [
|
|
31
|
+
(3 * (0, randint_1.randint)(-100, 100, [0])) / 100,
|
|
32
|
+
(2 * (0, randint_1.randint)(-4, 5)) / 100,
|
|
33
|
+
];
|
|
34
|
+
const c = penteValue - a * Math.pow(xA, 2) - b * xA;
|
|
35
|
+
const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
|
|
36
|
+
const polynome = new polynomial_1.Polynomial([d, c, b / 2, a / 3]);
|
|
37
|
+
const instruction = `Ci-dessous sont tracées la courbe $\\mathcal C_f$ de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer $f'(${xA})$.`;
|
|
38
|
+
const commands = [
|
|
39
|
+
`f(x) = ${polynome.toString()}`,
|
|
40
|
+
`SetColor(f, "${colors_1.blueMain}")`,
|
|
41
|
+
`SetCaption(f, "$\\mathcal C_f$")`,
|
|
42
|
+
`ShowLabel(f, true)`,
|
|
43
|
+
`g(x) = (${penteString}) * x + (${originString})`,
|
|
44
|
+
`SetColor(g, "${colors_1.orange}")`,
|
|
45
|
+
`A = (${xA},${yA})`,
|
|
46
|
+
"SetFixed(A, true)",
|
|
47
|
+
"SetPointStyle(A, 1)",
|
|
48
|
+
];
|
|
49
|
+
const xMin = Math.min(xA, xB);
|
|
50
|
+
const yMin = Math.min(yA, yB);
|
|
51
|
+
const xMax = Math.max(xA, xB);
|
|
52
|
+
const yMax = Math.max(yA, yB);
|
|
53
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
54
|
+
commands,
|
|
55
|
+
});
|
|
56
|
+
const answer = penteTree.toTex();
|
|
57
|
+
const question = {
|
|
58
|
+
instruction,
|
|
59
|
+
startStatement: "a",
|
|
60
|
+
answer,
|
|
61
|
+
ggbOptions: ggb.getOptions({
|
|
62
|
+
coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
|
|
63
|
+
}),
|
|
64
|
+
answerFormat: "tex",
|
|
65
|
+
keys: [],
|
|
66
|
+
identifiers: { A: [xA, yA], B: [xB, yB] },
|
|
67
|
+
};
|
|
68
|
+
return question;
|
|
69
|
+
};
|
|
70
|
+
const getPropositions = (n, { answer, A, B }) => {
|
|
71
|
+
const propositions = [];
|
|
72
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
73
|
+
if (B[1] - A[1] !== 0)
|
|
74
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new rational_1.Rational(B[0] - A[0], B[1] - A[1]).simplify().toTree().toTex());
|
|
75
|
+
while (propositions.length < n) {
|
|
76
|
+
const wrongAnswer = new numberNode_1.NumberNode((0, randint_1.randint)(-4, 5, [0]));
|
|
77
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
78
|
+
}
|
|
79
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
80
|
+
};
|
|
81
|
+
const isAnswerValid = (ans, { A, B }) => {
|
|
82
|
+
const answer = new rational_1.Rational(B[1] - A[1], B[0] - A[0])
|
|
83
|
+
.simplify()
|
|
84
|
+
.toTree({ allowFractionToDecimal: true });
|
|
85
|
+
const texs = answer.toAllValidTexs();
|
|
86
|
+
return texs.includes(ans);
|
|
87
|
+
};
|
|
88
|
+
exports.derivativeNumberReading = {
|
|
89
|
+
id: "derivativeNumberReading",
|
|
90
|
+
connector: "=",
|
|
91
|
+
label: "Lecture de nombre dérivé",
|
|
92
|
+
levels: ["1reESM", "1reSpé", "1reTech", "MathComp", "1rePro"],
|
|
93
|
+
sections: ["Dérivation"],
|
|
94
|
+
isSingleStep: false,
|
|
95
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDerivativeNumberReading, nb),
|
|
96
|
+
qcmTimer: 60,
|
|
97
|
+
freeTimer: 60,
|
|
98
|
+
getPropositions,
|
|
99
|
+
isAnswerValid,
|
|
100
|
+
hasGeogebra: true,
|
|
101
|
+
subject: "Mathématiques",
|
|
102
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xA: number;
|
|
4
|
+
yA: number;
|
|
5
|
+
yPrimeA: any;
|
|
6
|
+
trinomCoeffs: number[];
|
|
7
|
+
};
|
|
8
|
+
export declare const derivativeTangentEquationReading: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
/**Math
|
|
11
|
+
*
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
xA yA sur la courbe
|
|
15
|
+
xA y'A dérivée
|
|
16
|
+
a,b,c ?
|
|
17
|
+
|
|
18
|
+
yA = axA^2 + bxA + c
|
|
19
|
+
y'A = 2axA + b
|
|
20
|
+
|
|
21
|
+
fixons c
|
|
22
|
+
|
|
23
|
+
yA-c = axA² + bxA
|
|
24
|
+
y'A = 2axA +b
|
|
25
|
+
|
|
26
|
+
xAy'A = 2axA² + bxA
|
|
27
|
+
= yA-c +axA²
|
|
28
|
+
|
|
29
|
+
a = (xAy'A-yA+c)/xA²
|
|
30
|
+
b = y'A - 2(xAy'A-yA+c)/xA
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
SI XA=0
|
|
34
|
+
yA =c
|
|
35
|
+
y'A = b
|
|
36
|
+
a is whatever
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
y = f'(a)(x-a)+f(a)
|
|
40
|
+
|
|
41
|
+
*/
|
|
42
|
+
//# sourceMappingURL=derivativeTangentEquationReading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivativeTangentEquationReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeTangentEquationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyPF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAmBlE,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.derivativeTangentEquationReading = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../../geogebra/colors");
|
|
7
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
8
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
9
|
+
const trinom_1 = require("../../../../math/polynomials/trinom");
|
|
10
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
11
|
+
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
12
|
+
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
13
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
14
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
15
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
16
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
17
|
+
const random_1 = require("../../../../utils/random");
|
|
18
|
+
const randomPente = () => {
|
|
19
|
+
return (0, random_1.random)([
|
|
20
|
+
0,
|
|
21
|
+
-1,
|
|
22
|
+
1,
|
|
23
|
+
-2,
|
|
24
|
+
2,
|
|
25
|
+
-3,
|
|
26
|
+
3,
|
|
27
|
+
new rational_1.Rational(1, 2),
|
|
28
|
+
new rational_1.Rational(-1, 2),
|
|
29
|
+
new rational_1.Rational(1, 3),
|
|
30
|
+
new rational_1.Rational(-1, 3),
|
|
31
|
+
new rational_1.Rational(3, 2),
|
|
32
|
+
new rational_1.Rational(-3, 2),
|
|
33
|
+
new rational_1.Rational(2, 3),
|
|
34
|
+
new rational_1.Rational(-2, 3),
|
|
35
|
+
new rational_1.Rational(3, 4),
|
|
36
|
+
new rational_1.Rational(-3, 4),
|
|
37
|
+
new rational_1.Rational(1, 4),
|
|
38
|
+
new rational_1.Rational(-1, 4),
|
|
39
|
+
]).toTree();
|
|
40
|
+
};
|
|
41
|
+
const getPropositions = (n, { answer, trinomCoeffs, xA, yA, yPrimeA }) => {
|
|
42
|
+
const propositions = [];
|
|
43
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equalNode_1.EqualNode("y".toTree(), getAnswerTree({ xA: -xA, yA, yPrimeA, trinomCoeffs })).toTex());
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equalNode_1.EqualNode("y".toTree(), getAnswerTree({ xA, yA: -yA, yPrimeA, trinomCoeffs })).toTex());
|
|
46
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equalNode_1.EqualNode("y".toTree(), getAnswerTree({
|
|
47
|
+
xA,
|
|
48
|
+
yA,
|
|
49
|
+
yPrimeA: randomPente().toIdentifiers(),
|
|
50
|
+
trinomCoeffs,
|
|
51
|
+
})).toTex());
|
|
52
|
+
while (propositions.length < n) {
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equalNode_1.EqualNode("y".toTree(), getAnswerTree({
|
|
54
|
+
xA: (0, randint_1.randint)(-10, 10),
|
|
55
|
+
yA: (0, randint_1.randint)(-10, 10),
|
|
56
|
+
yPrimeA,
|
|
57
|
+
trinomCoeffs,
|
|
58
|
+
})).toTex());
|
|
59
|
+
}
|
|
60
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
61
|
+
};
|
|
62
|
+
const getAnswerTree = ({ xA, yA, yPrimeA }) => {
|
|
63
|
+
const yPrimeTree = nodeConstructor_1.NodeConstructor.fromIdentifiers(yPrimeA);
|
|
64
|
+
const pente = new multiplyNode_1.MultiplyNode(yPrimeTree, "x".toTree());
|
|
65
|
+
//f(a)-f'(a)a
|
|
66
|
+
const b = new substractNode_1.SubstractNode(yA.toTree(), new multiplyNode_1.MultiplyNode(yPrimeTree, xA.toTree())).simplify();
|
|
67
|
+
const ansTree = new addNode_1.AddNode(pente, b).simplify({
|
|
68
|
+
forceDistributeFractions: true,
|
|
69
|
+
});
|
|
70
|
+
return ansTree;
|
|
71
|
+
};
|
|
72
|
+
const getAnswer = ({ trinomCoeffs, xA, yA, yPrimeA, }) => {
|
|
73
|
+
return new equalNode_1.EqualNode("y".toTree(), getAnswerTree({ xA, yA, yPrimeA, trinomCoeffs })).toTex();
|
|
74
|
+
};
|
|
75
|
+
const getInstruction = ({ xA }) => {
|
|
76
|
+
return `Ci-dessous sont tracées la courbe $\\mathcal C_f$ de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer l'équation de cette tangente.`;
|
|
77
|
+
};
|
|
78
|
+
const getHint = (identifiers) => {
|
|
79
|
+
return `L'équation de la tangente à la courbe de $f$ au point d'abscisse $a$ est :
|
|
80
|
+
|
|
81
|
+
$$
|
|
82
|
+
y = f'(a)(x-a)+f(a)
|
|
83
|
+
$$`;
|
|
84
|
+
};
|
|
85
|
+
const getCorrection = ({ trinomCoeffs, xA, yA, yPrimeA, }) => {
|
|
86
|
+
const yPrime = nodeConstructor_1.NodeConstructor.fromIdentifiers(yPrimeA);
|
|
87
|
+
const yPrimeTex = yPrime.toTex();
|
|
88
|
+
const add = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(yPrime, new addNode_1.AddNode("x".toTree(), (-xA).toTree())), yA.toTree());
|
|
89
|
+
return `L'équation de la tangente à la courbe de $f$ au point d'abscisse $a$ est :
|
|
90
|
+
|
|
91
|
+
$$
|
|
92
|
+
y = f'(a)(x-a)+f(a)
|
|
93
|
+
$$
|
|
94
|
+
|
|
95
|
+
Ici, on a $a = ${xA}$ et $f(a)=${yA}$.
|
|
96
|
+
|
|
97
|
+
Puis, on sait que $f'(a)$ est le coefficient directeur de la tangente. On lit graphiquement que le coefficient directeur de la droite est $${yPrimeTex}$. On a donc $f'(a)=${yPrimeTex}$.
|
|
98
|
+
|
|
99
|
+
Ainsi, l'équation de la tangente est :
|
|
100
|
+
${(0, alignTex_1.alignTex)([
|
|
101
|
+
["y", "=", add.toTex()],
|
|
102
|
+
["", "=", getAnswerTree({ trinomCoeffs, xA, yA, yPrimeA }).toTex()],
|
|
103
|
+
])}
|
|
104
|
+
`;
|
|
105
|
+
};
|
|
106
|
+
const getGGBOptions = ({ trinomCoeffs, xA, yA, yPrimeA, }) => {
|
|
107
|
+
const trinom = new trinom_1.Trinom(trinomCoeffs[0], trinomCoeffs[1], trinomCoeffs[2]);
|
|
108
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
109
|
+
commands: [
|
|
110
|
+
...trinom.toGGBCommands({
|
|
111
|
+
name: "f",
|
|
112
|
+
color: colors_1.blueMain,
|
|
113
|
+
label: "\\mathcal C_f",
|
|
114
|
+
}),
|
|
115
|
+
`A = (${xA},${yA})`,
|
|
116
|
+
"SetFixed(A, true)",
|
|
117
|
+
"SetPointStyle(A, 1)",
|
|
118
|
+
`g(x) = Tangent(f,A)`,
|
|
119
|
+
`SetColor(g, "${colors_1.orange}")`,
|
|
120
|
+
],
|
|
121
|
+
});
|
|
122
|
+
return ggb.getOptions({
|
|
123
|
+
coords: ggb.getAdaptedCoords({
|
|
124
|
+
xMin: xA - 5,
|
|
125
|
+
xMax: xA + 5,
|
|
126
|
+
yMax: yA + 5,
|
|
127
|
+
yMin: yA - 5,
|
|
128
|
+
forceShowAxes: true,
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const getKeys = (identifiers) => {
|
|
133
|
+
return ["y", "equal", "x"];
|
|
134
|
+
};
|
|
135
|
+
const isAnswerValid = (ans, { answer, trinomCoeffs, xA, yA, yPrimeA }) => {
|
|
136
|
+
const tree = getAnswerTree({ xA, yA, yPrimeA, trinomCoeffs });
|
|
137
|
+
const equalTree = new equalNode_1.EqualNode("y".toTree(), getAnswerTree({ xA, yA, yPrimeA, trinomCoeffs }));
|
|
138
|
+
return equalTree
|
|
139
|
+
.toAllValidTexs({
|
|
140
|
+
allowMinusAnywhereInFraction: true,
|
|
141
|
+
allowFractionToDecimal: true,
|
|
142
|
+
allowRawRightChildAsSolution: true,
|
|
143
|
+
})
|
|
144
|
+
.includes(ans);
|
|
145
|
+
};
|
|
146
|
+
const getDerivativeTangentEquationReadingQuestion = () => {
|
|
147
|
+
const xA = (0, randint_1.randint)(-8, 8);
|
|
148
|
+
const yA = (0, randint_1.randint)(-8, 8);
|
|
149
|
+
const yPrimeA = randomPente();
|
|
150
|
+
let a, b, c;
|
|
151
|
+
if (xA === 0) {
|
|
152
|
+
c = yA;
|
|
153
|
+
b = yPrimeA.evaluate({});
|
|
154
|
+
a = (0, randint_1.randint)(-5, 5, [0]);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
c = (0, randint_1.randint)(-5, 5, [yA - xA * yPrimeA.evaluate({})]);
|
|
158
|
+
a = new rational_1.Rational(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(xA.toTree(), yPrimeA), new substractNode_1.SubstractNode(c.toTree(), yA.toTree())).evaluate({}), xA ** 2)
|
|
159
|
+
.toTree()
|
|
160
|
+
.evaluate({});
|
|
161
|
+
b = new substractNode_1.SubstractNode(yPrimeA, new multiplyNode_1.MultiplyNode((2 / xA).toTree(), new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(xA.toTree(), yPrimeA), new substractNode_1.SubstractNode(c.toTree(), yA.toTree())))).evaluate({});
|
|
162
|
+
}
|
|
163
|
+
const identifiers = {
|
|
164
|
+
xA,
|
|
165
|
+
yA,
|
|
166
|
+
yPrimeA: yPrimeA.toIdentifiers(),
|
|
167
|
+
trinomCoeffs: [a, b, c],
|
|
168
|
+
};
|
|
169
|
+
const question = {
|
|
170
|
+
answer: getAnswer(identifiers),
|
|
171
|
+
instruction: getInstruction(identifiers),
|
|
172
|
+
keys: getKeys(identifiers),
|
|
173
|
+
answerFormat: "tex",
|
|
174
|
+
identifiers,
|
|
175
|
+
hint: getHint(identifiers),
|
|
176
|
+
correction: getCorrection(identifiers),
|
|
177
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
178
|
+
};
|
|
179
|
+
return question;
|
|
180
|
+
};
|
|
181
|
+
exports.derivativeTangentEquationReading = {
|
|
182
|
+
id: "derivativeTangentEquationReading",
|
|
183
|
+
connector: "=",
|
|
184
|
+
label: "Déterminer graphiquement l'équation d'une tangente",
|
|
185
|
+
isSingleStep: true,
|
|
186
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDerivativeTangentEquationReadingQuestion, nb),
|
|
187
|
+
qcmTimer: 60,
|
|
188
|
+
freeTimer: 60,
|
|
189
|
+
ggbTimer: 60,
|
|
190
|
+
getPropositions,
|
|
191
|
+
isAnswerValid,
|
|
192
|
+
subject: "Mathématiques",
|
|
193
|
+
getHint,
|
|
194
|
+
getCorrection,
|
|
195
|
+
getAnswer,
|
|
196
|
+
hasGeogebra: true,
|
|
197
|
+
hasHintAndCorrection: true,
|
|
198
|
+
getGGBOptions,
|
|
199
|
+
};
|
|
200
|
+
/**Math
|
|
201
|
+
*
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
xA yA sur la courbe
|
|
205
|
+
xA y'A dérivée
|
|
206
|
+
a,b,c ?
|
|
207
|
+
|
|
208
|
+
yA = axA^2 + bxA + c
|
|
209
|
+
y'A = 2axA + b
|
|
210
|
+
|
|
211
|
+
fixons c
|
|
212
|
+
|
|
213
|
+
yA-c = axA² + bxA
|
|
214
|
+
y'A = 2axA +b
|
|
215
|
+
|
|
216
|
+
xAy'A = 2axA² + bxA
|
|
217
|
+
= yA-c +axA²
|
|
218
|
+
|
|
219
|
+
a = (xAy'A-yA+c)/xA²
|
|
220
|
+
b = y'A - 2(xAy'A-yA+c)/xA
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
SI XA=0
|
|
224
|
+
yA =c
|
|
225
|
+
y'A = b
|
|
226
|
+
a is whatever
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
y = f'(a)(x-a)+f(a)
|
|
230
|
+
|
|
231
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC"}
|
|
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./tangentEquations"), exports);
|
|
18
|
+
__exportStar(require("./derivativeNumberReading"), exports);
|
|
19
|
+
__exportStar(require("./derivativeTangentEquationReading"), exports);
|
|
@@ -7,7 +7,7 @@ const decimal_1 = require("../../../../math/numbers/decimals/decimal");
|
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const log10Node_1 = require("../../../../tree/nodes/functions/log10Node");
|
|
9
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
10
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
11
11
|
const getLog10PowerSimplifyingQuestion = () => {
|
|
12
12
|
const tenthPower = (0, randint_1.randint)(-6, 8, [1]);
|
|
13
13
|
const nb = new decimal_1.Decimal(1).multiplyByPowerOfTen(tenthPower).toTree();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointCoordinates.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"pointCoordinates.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|