math-exercises 3.0.15 → 3.0.17

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.
@@ -1,6 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
3
  a: number;
4
+ c: number;
4
5
  coin: number;
5
6
  racine1: number;
6
7
  racine2: number;
@@ -1 +1 @@
1
- {"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkHF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
1
+ {"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsIF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
@@ -13,21 +13,21 @@ import { unionIntervalParser } from "../../../../tree/parsers/unionIntervalParse
13
13
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
14
  import { shuffle } from "../../../../utils/alea/shuffle.js";
15
15
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
- const getThirdDegreeFunctionVariation = () => {
17
- const a = randint(-3, 4, [0]);
18
- const c = randint(-2, 3);
19
- const racine1 = randint(-5, 4);
20
- const racine2 = randint(racine1 + 1, 6);
21
- const coefs = [
22
- c,
23
- a * racine1 * racine2,
24
- (-a * (racine1 + racine2)) / 2,
25
- a / 3,
26
- ];
27
- const polynome = new Polynomial(coefs);
28
- const coin = coinFlip() ? -1 : 1;
29
- const instruction = `Soit $f$ la fonction représentée ci-dessous. Sur quel intervalle la dérivée de $f$ est-elle ` +
30
- (coin < 0 ? "négative ?" : "positive ?");
16
+ const rebuildIdentifiers = (oldIds) => {
17
+ if (oldIds?.c !== undefined)
18
+ return oldIds;
19
+ return {
20
+ ...oldIds,
21
+ c: randint(-2, 3),
22
+ };
23
+ };
24
+ const getInstruction = (identifiers) => {
25
+ const { a, coin, racine1, racine2 } = identifiers;
26
+ return (`Soit $f$ la fonction représentée ci-dessous. Sur quel intervalle la dérivée de $f$ est-elle ` +
27
+ (coin < 0 ? "négative ?" : "positive ?"));
28
+ };
29
+ const getAnswer = (identifiers) => {
30
+ const { a, coin, racine1, racine2 } = identifiers;
31
31
  const racine1Tree = new NumberNode(racine1);
32
32
  const racine2Tree = new NumberNode(racine2);
33
33
  const answer = coin * a < 0
@@ -36,12 +36,23 @@ const getThirdDegreeFunctionVariation = () => {
36
36
  new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF),
37
37
  new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO),
38
38
  ]).toTex();
39
- const commands = [
40
- `f(x) = ${polynome.toString()}`,
41
- `SetColor(f, "${randomColor()}")`,
39
+ return answer;
40
+ };
41
+ const getGGBOptions = (identifiers) => {
42
+ const { a, coin, racine1, racine2, c } = identifiers;
43
+ const coefs = [
44
+ c,
45
+ a * racine1 * racine2,
46
+ (-a * (racine1 + racine2)) / 2,
47
+ a / 3,
42
48
  ];
49
+ const polynome = new Polynomial(coefs);
43
50
  const y1 = polynome.calculate(racine1);
44
51
  const y2 = polynome.calculate(racine2);
52
+ const commands = [
53
+ `f(x) = ${polynome.toMathString()}`,
54
+ `SetColor(f, "${randomColor()}")`,
55
+ ];
45
56
  const yMax = Math.max(y1, y2);
46
57
  const yMin = Math.min(y1, y2);
47
58
  const xMax = Math.max(racine1, racine2);
@@ -51,16 +62,25 @@ const getThirdDegreeFunctionVariation = () => {
51
62
  lockedAxesRatio: false,
52
63
  gridDistance: false,
53
64
  });
65
+ return ggb.getOptions({
66
+ coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
67
+ });
68
+ };
69
+ const getThirdDegreeFunctionVariation = () => {
70
+ const a = randint(-3, 4, [0]);
71
+ const c = randint(-2, 3);
72
+ const racine1 = randint(-5, 4);
73
+ const racine2 = randint(racine1 + 1, 6);
74
+ const coin = coinFlip() ? -1 : 1;
75
+ const identifiers = { racine1, racine2, coin, a, c };
54
76
  const question = {
55
- instruction,
77
+ instruction: getInstruction(identifiers),
56
78
  startStatement: "S",
57
- answer,
79
+ answer: getAnswer(identifiers),
58
80
  keys: ["lbracket", "rbracket", "semicolon", "infty", "cup"],
59
81
  answerFormat: "tex",
60
- ggbOptions: ggb.getOptions({
61
- coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
62
- }),
63
- identifiers: { racine1, racine2, coin, a },
82
+ ggbOptions: getGGBOptions(identifiers),
83
+ identifiers,
64
84
  };
65
85
  return question;
66
86
  };
@@ -108,4 +128,8 @@ export const thirdDegreeFunctionVariation = {
108
128
  isAnswerValid,
109
129
  hasGeogebra: true,
110
130
  subject: "Mathématiques",
131
+ getInstruction,
132
+ getAnswer,
133
+ getGGBOptions,
134
+ rebuildIdentifiers,
111
135
  };
@@ -2,6 +2,7 @@ import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
3
  A: number[];
4
4
  B: number[];
5
+ coeffs: number[];
5
6
  };
6
7
  export declare const derivativeNumberReading: Exercise<Identifiers>;
7
8
  export {};
@@ -1 +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,6BAA6B,CAAC;AAmBrC,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"}
1
+ {"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAgJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAmBzD,CAAC"}
@@ -8,11 +8,53 @@ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
8
8
  import { randint } from "../../../../math/utils/random/randint.js";
9
9
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
10
10
  import { shuffle } from "../../../../utils/alea/shuffle.js";
11
- const getDerivativeNumberReading = () => {
12
- let xA, yA, xB, yB;
13
- [xA, yA] = [1, 2].map((el) => randint(-5, 6));
14
- xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
15
- yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
11
+ const rebuildIdentifiers = (oldIds) => {
12
+ if (oldIds?.coeffs?.length)
13
+ return oldIds;
14
+ const { A, B } = oldIds;
15
+ const xA = A[0];
16
+ const xB = B[0];
17
+ const yA = A[1];
18
+ const yB = B[1];
19
+ const pente = new Rational(yB - yA, xB - xA).simplify();
20
+ const penteValue = pente.value;
21
+ const [a, b] = [
22
+ (3 * randint(-100, 100, [0])) / 100,
23
+ (2 * randint(-4, 5)) / 100,
24
+ ];
25
+ const c = penteValue - a * Math.pow(xA, 2) - b * xA;
26
+ const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
27
+ return {
28
+ A,
29
+ B,
30
+ coeffs: [d, c, b / 2, a / 3],
31
+ };
32
+ };
33
+ const getInstruction = (identifiers) => {
34
+ const { A, B } = identifiers;
35
+ const xA = A[0];
36
+ const xB = B[0];
37
+ const yA = A[1];
38
+ const yB = B[1];
39
+ 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 $f'(${xA})$.`;
40
+ };
41
+ const getAnswer = (identifiers) => {
42
+ const { A, B } = identifiers;
43
+ const xA = A[0];
44
+ const xB = B[0];
45
+ const yA = A[1];
46
+ const yB = B[1];
47
+ const pente = new Rational(yB - yA, xB - xA).simplify();
48
+ const penteTree = pente.toTree();
49
+ const answer = penteTree.toTex();
50
+ return answer;
51
+ };
52
+ const getGGBOptions = (identifiers) => {
53
+ const { A, B } = identifiers;
54
+ const xA = A[0];
55
+ const xB = B[0];
56
+ const yA = A[1];
57
+ const yB = B[1];
16
58
  const pente = new Rational(yB - yA, xB - xA).simplify();
17
59
  const origin = pente
18
60
  .opposite()
@@ -22,18 +64,9 @@ const getDerivativeNumberReading = () => {
22
64
  const originTree = origin.toTree();
23
65
  const penteString = penteTree.toMathString();
24
66
  const originString = originTree.toMathString();
25
- const penteValue = pente.value;
26
- const originValue = origin.value;
27
- const [a, b] = [
28
- (3 * randint(-100, 100, [0])) / 100,
29
- (2 * randint(-4, 5)) / 100,
30
- ];
31
- const c = penteValue - a * Math.pow(xA, 2) - b * xA;
32
- const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
33
- const polynome = new Polynomial([d, c, b / 2, a / 3]);
34
- 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})$.`;
67
+ const polynome = new Polynomial(identifiers.coeffs);
35
68
  const commands = [
36
- `f(x) = ${polynome.toString()}`,
69
+ `f(x) = ${polynome.toMathString()}`,
37
70
  `SetColor(f, "${blueMain}")`,
38
71
  `SetCaption(f, "$\\mathcal C_f$")`,
39
72
  `ShowLabel(f, true)`,
@@ -50,17 +83,36 @@ const getDerivativeNumberReading = () => {
50
83
  const ggb = new GeogebraConstructor({
51
84
  commands,
52
85
  });
53
- const answer = penteTree.toTex();
86
+ return ggb.getOptions({
87
+ coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
88
+ });
89
+ };
90
+ const getDerivativeNumberReading = () => {
91
+ let xA, yA, xB, yB;
92
+ [xA, yA] = [1, 2].map((el) => randint(-5, 6));
93
+ xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
94
+ yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
95
+ const pente = new Rational(yB - yA, xB - xA).simplify();
96
+ const penteValue = pente.value;
97
+ const [a, b] = [
98
+ (3 * randint(-100, 100, [0])) / 100,
99
+ (2 * randint(-4, 5)) / 100,
100
+ ];
101
+ const c = penteValue - a * Math.pow(xA, 2) - b * xA;
102
+ const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
103
+ const identifiers = {
104
+ A: [xA, yA],
105
+ B: [xB, yB],
106
+ coeffs: [d, c, b / 2, a / 3],
107
+ };
54
108
  const question = {
55
- instruction,
109
+ instruction: getInstruction(identifiers),
56
110
  startStatement: "a",
57
- answer,
58
- ggbOptions: ggb.getOptions({
59
- coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
60
- }),
111
+ answer: getAnswer(identifiers),
112
+ ggbOptions: getGGBOptions(identifiers),
61
113
  answerFormat: "tex",
62
114
  keys: [],
63
- identifiers: { A: [xA, yA], B: [xB, yB] },
115
+ identifiers,
64
116
  };
65
117
  return question;
66
118
  };
@@ -96,4 +148,8 @@ export const derivativeNumberReading = {
96
148
  isAnswerValid,
97
149
  hasGeogebra: true,
98
150
  subject: "Mathématiques",
151
+ getInstruction,
152
+ getAnswer,
153
+ getGGBOptions,
154
+ rebuildIdentifiers,
99
155
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
1
+ {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAgB9C,CAAC"}
@@ -4,25 +4,39 @@ import { randomColor } from "../../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
5
  import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
6
6
  import { randint } from "../../../../../math/utils/random/randint.js";
7
- const getRootsReadingQuestion = () => {
8
- const trinom = TrinomConstructor.randomNiceRoots(randint(1, 3));
7
+ const getInstruction = (identifiers) => {
8
+ return `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous : `;
9
+ };
10
+ const getAnswer = (identifiers) => {
11
+ const { a, b, c } = identifiers;
12
+ const trinom = new Trinom(a, b, c);
9
13
  const roots = trinom.getRoots();
14
+ const answer = roots.length === 1 ? roots[0].toString() : roots.join("\\text{ et }");
15
+ return answer;
16
+ };
17
+ const getGGBOptions = (identifiers) => {
18
+ const { a, b, c } = identifiers;
19
+ const trinom = new Trinom(a, b, c);
10
20
  const commands = [
11
- `f(x) = ${trinom.toString()}`,
21
+ `f(x) = ${trinom.toMathString()}`,
12
22
  `SetColor(f, "${randomColor()}")`,
13
23
  ];
14
24
  const ggb = new GeogebraConstructor({
15
25
  commands,
16
26
  lockedAxesRatio: false,
17
27
  });
18
- const answer = roots.length === 1 ? roots[0].toString() : roots.join("\\text{ et }");
28
+ return ggb.getOptions({ coords: trinom.getCoords() });
29
+ };
30
+ const getRootsReadingQuestion = () => {
31
+ const trinom = TrinomConstructor.randomNiceRoots(randint(1, 3));
32
+ const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
19
33
  const question = {
20
- answer,
21
- instruction: `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous : `,
34
+ answer: getAnswer(identifiers),
35
+ instruction: getInstruction(identifiers),
22
36
  keys: ["et", "aucun"],
23
37
  answerFormat: "tex",
24
- ggbOptions: ggb.getOptions({ coords: trinom.getCoords() }),
25
- identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
38
+ ggbOptions: getGGBOptions(identifiers),
39
+ identifiers,
26
40
  };
27
41
  return question;
28
42
  };
@@ -60,4 +74,7 @@ export const rootsReading = {
60
74
  isAnswerValid,
61
75
  hasGeogebra: true,
62
76
  subject: "Mathématiques",
77
+ getInstruction,
78
+ getAnswer,
79
+ getGGBOptions,
63
80
  };
@@ -1 +1 @@
1
- {"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
1
+ {"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAgB/C,CAAC"}
@@ -5,26 +5,40 @@ import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor
5
5
  import { Point } from "../../../../../math/geometry/point.js";
6
6
  import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
7
7
  import { randint } from "../../../../../math/utils/random/randint.js";
8
- const getSummitReadingQuestion = () => {
9
- const trinom = TrinomConstructor.randomCanonical();
8
+ const getInstruction = (identifiers) => {
9
+ return `Déterminer les coordonnées du sommet de la parabole représentée ci-dessous :`;
10
+ };
11
+ const getAnswer = (identifiers) => {
12
+ const { a, b, c } = identifiers;
13
+ const trinom = new Trinom(a, b, c);
14
+ const answer = trinom.getSommet().toCoords();
15
+ return answer;
16
+ };
17
+ const getGGBOptions = (identifiers) => {
18
+ const { a, b, c } = identifiers;
19
+ const trinom = new Trinom(a, b, c);
10
20
  const commands = [
11
- `f(x) = ${trinom.toString()}`,
21
+ `f(x) = ${trinom.toMathString()}`,
12
22
  `SetColor(f, "${randomColor()}")`,
13
23
  ];
14
24
  const ggb = new GeogebraConstructor({
15
25
  commands,
16
26
  isGridSimple: true,
17
27
  });
18
- const answer = trinom.getSommet().toCoords();
28
+ return ggb.getOptions({
29
+ coords: trinom.getCoords(),
30
+ });
31
+ };
32
+ const getSummitReadingQuestion = () => {
33
+ const trinom = TrinomConstructor.randomCanonical();
34
+ const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
19
35
  const question = {
20
- answer,
21
- instruction: `Déterminer les coordonnées du sommet de la parabole représentée ci-dessous :`,
36
+ answer: getAnswer(identifiers),
37
+ instruction: getInstruction(identifiers),
22
38
  keys: ["leftParenthesis", "semicolon", "rightParenthesis"],
23
- ggbOptions: ggb.getOptions({
24
- coords: trinom.getCoords(),
25
- }),
39
+ ggbOptions: getGGBOptions(identifiers),
26
40
  answerFormat: "tex",
27
- identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
41
+ identifiers,
28
42
  };
29
43
  return question;
30
44
  };
@@ -56,4 +70,7 @@ export const summitReading = {
56
70
  isAnswerValid,
57
71
  hasGeogebra: true,
58
72
  subject: "Mathématiques",
73
+ getInstruction,
74
+ getAnswer,
75
+ getGGBOptions,
59
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA8JF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA+KF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAiB3D,CAAC"}
@@ -32,35 +32,41 @@ function generateEvenInflexionPoint() {
32
32
  } while (inflexionPointX % 10 !== 0);
33
33
  return inflexionPointX;
34
34
  }
35
- const getConvexityQuadrinomialsGeoQuestion = () => {
36
- const inflexionPointX = generateEvenInflexionPoint() * 0.1;
37
- const quadrinomial = generatePolynomialWithIntegerInflexionPoint(3, inflexionPointX);
38
- const quadcoeffs = quadrinomial.coefficients;
39
- const trinomial = quadrinomial.derivate();
40
- const criticalPoints = trinomial.getRoots();
41
- const yValues = criticalPoints.map((x) => quadrinomial.calculate(x));
42
- const xMin = Math.min(...criticalPoints) - 5;
43
- const xMax = Math.max(...criticalPoints) + 5;
44
- const yMin = Math.min(...yValues, 0) - 5;
45
- const yMax = Math.max(...yValues, 0) + 5;
46
- const askConvex = coinFlip();
35
+ const getInstruction = (identifiers) => {
36
+ const { askConvex, inflexionPoint, quadcoeffs } = identifiers;
37
+ const questionType = askConvex ? "convexe" : "concave";
38
+ const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur quel intervalle $f$ est-elle ${questionType} ?`;
39
+ return instruction;
40
+ };
41
+ const getAnswer = (identifiers) => {
42
+ const { askConvex, inflexionPoint, quadcoeffs } = identifiers;
47
43
  let interval;
48
44
  if (askConvex) {
49
45
  interval =
50
46
  quadcoeffs[3] > 0
51
- ? new IntervalNode(inflexionPointX.toTree(), PlusInfinityNode, ClosureType.OO).toTex()
52
- : new IntervalNode(MinusInfinityNode, inflexionPointX.toTree(), ClosureType.OO).toTex();
47
+ ? new IntervalNode(inflexionPoint.toTree(), PlusInfinityNode, ClosureType.OO).toTex()
48
+ : new IntervalNode(MinusInfinityNode, inflexionPoint.toTree(), ClosureType.OO).toTex();
53
49
  }
54
50
  else {
55
51
  interval =
56
52
  quadcoeffs[3] <= 0
57
- ? new IntervalNode(inflexionPointX.toTree(), PlusInfinityNode, ClosureType.OO).toTex()
58
- : new IntervalNode(MinusInfinityNode, inflexionPointX.toTree(), ClosureType.OO).toTex();
53
+ ? new IntervalNode(inflexionPoint.toTree(), PlusInfinityNode, ClosureType.OO).toTex()
54
+ : new IntervalNode(MinusInfinityNode, inflexionPoint.toTree(), ClosureType.OO).toTex();
59
55
  }
60
- const questionType = askConvex ? "convexe" : "concave";
61
- const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur quel intervalle $f$ est-elle ${questionType} ?`;
56
+ return interval;
57
+ };
58
+ const getGGBOptions = (identifiers) => {
59
+ const { askConvex, inflexionPoint, quadcoeffs } = identifiers;
60
+ const quadrinomial = new Polynomial(quadcoeffs);
61
+ const trinomial = quadrinomial.derivate();
62
+ const criticalPoints = trinomial.getRoots();
63
+ const yValues = criticalPoints.map((x) => quadrinomial.calculate(x));
64
+ const xMin = Math.min(...criticalPoints) - 5;
65
+ const xMax = Math.max(...criticalPoints) + 5;
66
+ const yMin = Math.min(...yValues, 0) - 5;
67
+ const yMax = Math.max(...yValues, 0) + 5;
62
68
  const commands = [
63
- `f(x) = ${quadrinomial.toString()}`,
69
+ `f(x) = ${quadrinomial.toMathString()}`,
64
70
  `SetColor(f, "${blueMain}")`,
65
71
  `SetCaption(f, "$\\mathcal C_f$")`,
66
72
  `ShowLabel(f, true)`,
@@ -69,15 +75,27 @@ const getConvexityQuadrinomialsGeoQuestion = () => {
69
75
  commands,
70
76
  lockedAxesRatio: false,
71
77
  });
78
+ return ggb.getOptions({
79
+ coords: [xMin, xMax, yMin, yMax],
80
+ });
81
+ };
82
+ const getConvexityQuadrinomialsGeoQuestion = () => {
83
+ const inflexionPointX = generateEvenInflexionPoint() * 0.1;
84
+ const quadrinomial = generatePolynomialWithIntegerInflexionPoint(3, inflexionPointX);
85
+ const quadcoeffs = quadrinomial.coefficients;
86
+ const askConvex = coinFlip();
87
+ const identifiers = {
88
+ askConvex,
89
+ quadcoeffs,
90
+ inflexionPoint: inflexionPointX,
91
+ };
72
92
  const question = {
73
- answer: interval,
74
- instruction,
75
- ggbOptions: ggb.getOptions({
76
- coords: [xMin, xMax, yMin, yMax],
77
- }),
93
+ answer: getAnswer(identifiers),
94
+ instruction: getInstruction(identifiers),
95
+ ggbOptions: getGGBOptions(identifiers),
78
96
  keys: ["rbracket", "lbracket", "semicolon", "infty", "reals"],
79
97
  answerFormat: "tex",
80
- identifiers: { askConvex, quadcoeffs, inflexionPoint: inflexionPointX },
98
+ identifiers,
81
99
  };
82
100
  return question;
83
101
  };
@@ -118,4 +136,7 @@ export const convexityQuadrinomialsGeo = {
118
136
  isAnswerValid,
119
137
  subject: "Mathématiques",
120
138
  hasGeogebra: true,
139
+ getInstruction,
140
+ getAnswer,
141
+ getGGBOptions,
121
142
  };
@@ -1 +1 @@
1
- {"version":3,"file":"convexityTrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityTrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAkDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"convexityTrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityTrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAmEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
@@ -2,13 +2,20 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { blueMain } from "../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
- import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
5
+ import { Trinom, TrinomConstructor } from "../../../../math/polynomials/trinom.js";
6
6
  import { shuffle } from "../../../../utils/alea/shuffle.js";
7
- const getConvexityTrinomialsGeoQuestion = () => {
8
- const trinom = TrinomConstructor.random();
9
- const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur $\\mathbb{R}$, la fonction $f$ est :`;
7
+ const getInstruction = (identifiers) => {
8
+ return `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur $\\mathbb{R}$, la fonction $f$ est :`;
9
+ };
10
+ const getAnswer = (identifiers) => {
11
+ const trinom = new Trinom(identifiers.trinom[0], identifiers.trinom[1], identifiers.trinom[2]);
12
+ const isConvex = trinom.a > 0 ? "Convexe" : "Concave";
13
+ return isConvex;
14
+ };
15
+ const getGGBOptions = (identifiers) => {
16
+ const trinom = new Trinom(identifiers.trinom[0], identifiers.trinom[1], identifiers.trinom[2]);
10
17
  const commands = [
11
- `f(x) = ${trinom.toString()}`,
18
+ `f(x) = ${trinom.toMathString()}`,
12
19
  `SetColor(f, "${blueMain}")`,
13
20
  `SetCaption(f, "$\\mathcal C_f$")`,
14
21
  `ShowLabel(f, true)`,
@@ -17,16 +24,20 @@ const getConvexityTrinomialsGeoQuestion = () => {
17
24
  commands,
18
25
  lockedAxesRatio: false,
19
26
  });
20
- const isConvex = trinom.a > 0 ? "Convexe" : "Concave";
27
+ return ggb.getOptions({
28
+ coords: trinom.getCoords(),
29
+ });
30
+ };
31
+ const getConvexityTrinomialsGeoQuestion = () => {
32
+ const trinom = TrinomConstructor.random();
33
+ const identifiers = { trinom: [trinom.a, trinom.b, trinom.c] };
21
34
  const question = {
22
- answer: isConvex,
23
- instruction,
24
- ggbOptions: ggb.getOptions({
25
- coords: trinom.getCoords(),
26
- }),
35
+ answer: getAnswer(identifiers),
36
+ instruction: getInstruction(identifiers),
37
+ ggbOptions: getGGBOptions(identifiers),
27
38
  keys: [],
28
39
  answerFormat: "raw",
29
- identifiers: { trinom: [trinom.a, trinom.b, trinom.c] },
40
+ identifiers,
30
41
  };
31
42
  return question;
32
43
  };
@@ -57,4 +68,7 @@ export const convexityTrinomialsGeo = {
57
68
  isAnswerValid,
58
69
  hasGeogebra: true,
59
70
  subject: "Mathématiques",
71
+ getInstruction,
72
+ getAnswer,
73
+ getGGBOptions,
60
74
  };
package/lib/index.d.ts CHANGED
@@ -539,6 +539,7 @@ declare const mathExercises: (Exercise<{
539
539
  coefficients: number[];
540
540
  }, {}> | Exercise<{
541
541
  a: number;
542
+ c: number;
542
543
  coin: number;
543
544
  racine1: number;
544
545
  racine2: number;
@@ -592,6 +593,7 @@ declare const mathExercises: (Exercise<{
592
593
  }, {}> | Exercise<{
593
594
  A: number[];
594
595
  B: number[];
596
+ coeffs: number[];
595
597
  }, {}> | Exercise<{
596
598
  xA: number;
597
599
  yA: number;
@@ -1886,6 +1888,7 @@ declare const pcExercises: (Exercise<{
1886
1888
  }, {}> | Exercise<{
1887
1889
  A: number[];
1888
1890
  B: number[];
1891
+ coeffs: number[];
1889
1892
  }, {}> | Exercise<{
1890
1893
  a: number;
1891
1894
  }, {}> | Exercise<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAA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,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAa1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAM9B,QAAQ,IAAI,MAAM,EAAE;IAmCpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU;IAyBvC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAQ7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAuBnC,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU;IAqBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAWtB,cAAc,IAAI,UAAU;IAiB5B,eAAe,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BlC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAO5B,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM;IAiB7C,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU;IAiBxC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW;IAuCzB,KAAK,IAAI,MAAM;IA0Bf,YAAY,IAAI,MAAM;CAGvB"}
@@ -249,7 +249,7 @@ export class Trinom extends Polynomial {
249
249
  return `${aString}${bString}${cString}`;
250
250
  }
251
251
  toGGBCommands({ name, color, label } = { name: "f", color: blueMain, label: "" }) {
252
- const cmds = [`${name} = ${this.toString()}`];
252
+ const cmds = [`${name} = ${this.toMathString()}`];
253
253
  if (color) {
254
254
  cmds.push(`SetColor(${name}, "${color}")`);
255
255
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.15",
4
+ "version": "3.0.17",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [