math-exercises 3.0.168 → 3.0.169

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.
Files changed (38) hide show
  1. package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.js +1 -1
  2. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts +4 -1
  3. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  4. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +45 -20
  5. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts +4 -1
  6. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
  7. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +43 -9
  8. package/lib/exercises/math/sequences/index.d.ts +1 -0
  9. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  10. package/lib/exercises/math/sequences/index.js +1 -0
  11. package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.d.ts +11 -0
  12. package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.d.ts.map +1 -0
  13. package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.js +160 -0
  14. package/lib/exercises/math/sequences/variations/index.d.ts +2 -0
  15. package/lib/exercises/math/sequences/variations/index.d.ts.map +1 -0
  16. package/lib/exercises/math/sequences/variations/index.js +1 -0
  17. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts.map +1 -1
  18. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.js +0 -1
  19. package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.d.ts +8 -0
  20. package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.d.ts.map +1 -0
  21. package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.js +158 -0
  22. package/lib/exercises/math/trigonometry/circle/index.d.ts +2 -0
  23. package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
  24. package/lib/exercises/math/trigonometry/circle/index.js +2 -0
  25. package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts.map +1 -1
  26. package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.js +8 -3
  27. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts +8 -0
  28. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -0
  29. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +167 -0
  30. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +2 -0
  31. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  32. package/lib/exercises/utils/geogebra/toolBarConstructor.js +4 -0
  33. package/lib/index.d.ts +16 -2
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/math/polynomials/trinom.d.ts +1 -1
  36. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  37. package/lib/math/polynomials/trinom.js +2 -2
  38. package/package.json +1 -1
@@ -141,7 +141,7 @@ const getTrinomSelectEquationWithoutDeltaNeededQuestion = () => {
141
141
  else {
142
142
  const trinom = TrinomConstructor.randomCanonical(undefined, {
143
143
  excludes: [0],
144
- });
144
+ }); //prevents x^2 + b which looks like devform
145
145
  return {
146
146
  a: trinom.a,
147
147
  b: trinom.b,
@@ -3,6 +3,9 @@ type Identifiers = {
3
3
  isAri: boolean;
4
4
  sequence: number[];
5
5
  };
6
- export declare const recognizeArithmeticFromGraph: Exercise<Identifiers>;
6
+ type Options = {
7
+ firstTermRankOne?: boolean;
8
+ };
9
+ export declare const recognizeArithmeticFromGraph: Exercise<Identifiers, Options>;
7
10
  export {};
8
11
  //# sourceMappingURL=recognizeArithmeticFromGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeArithmeticFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA6GF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
1
+ {"version":3,"file":"recognizeArithmeticFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2IF,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AASF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvE,CAAC"}
@@ -1,8 +1,9 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Point } from "../../../../math/geometry/point.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { round } from "../../../../math/utils/round.js";
6
7
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
7
8
  import { random } from "../../../../utils/alea/random.js";
8
9
  const getInstruction = () => {
@@ -12,9 +13,10 @@ const getAnswer = (identifiers) => {
12
13
  const { isAri } = identifiers;
13
14
  return isAri ? "Oui" : "Non";
14
15
  };
15
- const getGGBOptions = (identifiers) => {
16
+ const getGGBOptions = (identifiers, opts) => {
16
17
  const { sequence } = identifiers;
17
- const commands = sequence.flatMap((nb, index) => new Point(`A_${index}`, index.toTree(), nb.toTree()).toGGBCommand({
18
+ const rankOne = opts?.firstTermRankOne ? 1 : 0;
19
+ const commands = sequence.flatMap((nb, index) => new Point(`A_{${index + rankOne}}`, (index + rankOne).toTree(), nb.toTree()).toGGBCommand({
18
20
  showLabel: false,
19
21
  }));
20
22
  const ggb = new GeogebraConstructor({
@@ -28,25 +30,39 @@ const getGGBOptions = (identifiers) => {
28
30
  coords: [-1, 7, Math.min(-1, yMin - 2), Math.max(1, yMax + 2)],
29
31
  });
30
32
  };
31
- // const getHint: GetHint<Identifiers> = () => {
32
- // return `Une suite est arithmétique si, pour passer d'un terme au suivant, on ajoute toujours le même nombre (appelé la raison de la suite).
33
- // Sur le graphique, les points `;
34
- // };
35
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
36
- // return ``;
37
- // };
38
- const getQuestionFromIdentifiers = (identifiers) => {
39
- const question = {
33
+ const getHint = () => {
34
+ return `Une suite est arithmétique si, pour passer d'un terme au suivant, on ajoute toujours le même nombre (appelé la raison de la suite).
35
+
36
+ Sur le graphique, retrouve-t-on ce comportement ?`;
37
+ };
38
+ const getCorrection = (identifiers, opts) => {
39
+ const rankOne = opts?.firstTermRankOne ? 1 : 0;
40
+ const { isAri, sequence } = identifiers;
41
+ const reason = round(sequence[1] - sequence[0], 5);
42
+ return `On peut lire graphiquement les premiers termes de la suite :
43
+
44
+ ${sequence
45
+ .slice(0, 5)
46
+ .map((e, i) => `$$
47
+ u_{${i + rankOne}} = ${e.frenchify()}
48
+ $$`)
49
+ .join("\n \n")}
50
+
51
+ ${isAri
52
+ ? `Sur ces premiers termes, on ajoute donc $${reason.frenchify()}$ pour passer d'un terme à l'autre. La suite semble donc bien arithmétique.`
53
+ : "Puisqu'on n'ajoute pas toujours le même nombre pour passer d'un terme à l'autre, la suite n'est donc pas arithmétique."}`;
54
+ };
55
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
56
+ return {
40
57
  answer: getAnswer(identifiers),
41
58
  instruction: getInstruction(identifiers),
42
59
  keys: [],
43
- ggbOptions: getGGBOptions(identifiers),
60
+ ggbOptions: getGGBOptions(identifiers, opts),
44
61
  answerFormat: "raw",
45
62
  identifiers,
46
- // hint: getHint(identifiers),
47
- // correction: getCorrection(identifiers),
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers, opts),
48
65
  };
49
- return question;
50
66
  };
51
67
  const getRandomFirstNonAriTerms = () => {
52
68
  const type = randint(0, 3);
@@ -77,7 +93,7 @@ const getRandomFirstNonAriTerms = () => {
77
93
  }
78
94
  }
79
95
  };
80
- const getRecognizeArithmeticFromGraphQuestion = () => {
96
+ const getRecognizeArithmeticFromGraphQuestion = (opts) => {
81
97
  const isAri = coinFlip();
82
98
  const firstAriTerm = randint(-5, 10);
83
99
  const reason = randint(-4, 6, [0]);
@@ -85,7 +101,7 @@ const getRecognizeArithmeticFromGraphQuestion = () => {
85
101
  ? new Array(10).fill(0).map((_el, index) => firstAriTerm + reason * index)
86
102
  : getRandomFirstNonAriTerms();
87
103
  const identifiers = { sequence, isAri };
88
- return getQuestionFromIdentifiers(identifiers);
104
+ return getQuestionFromIdentifiers(identifiers, opts);
89
105
  };
90
106
  const getPropositions = (n, { answer }) => {
91
107
  const propositions = [];
@@ -94,11 +110,19 @@ const getPropositions = (n, { answer }) => {
94
110
  tryToAddWrongProp(propositions, "Non", "raw");
95
111
  return shuffleProps(propositions, n);
96
112
  };
113
+ const options = [
114
+ {
115
+ id: "firstTermRankOne",
116
+ label: "Utiliser $u_1$ comme premier terme",
117
+ target: GeneratorOptionTarget.generation,
118
+ type: GeneratorOptionType.checkbox,
119
+ },
120
+ ];
97
121
  export const recognizeArithmeticFromGraph = {
98
122
  id: "recognizeArithmeticFromGraph",
99
123
  label: "Reconnaître graphiquement si une suite est arithmétique",
100
124
  isSingleStep: true,
101
- generator: (nb) => getDistinctQuestions(getRecognizeArithmeticFromGraphQuestion, nb),
125
+ generator: (nb, opts) => getDistinctQuestions(() => getRecognizeArithmeticFromGraphQuestion(opts), nb),
102
126
  qcmTimer: 60,
103
127
  freeTimer: 60,
104
128
  getPropositions,
@@ -106,5 +130,6 @@ export const recognizeArithmeticFromGraph = {
106
130
  hasGeogebra: true,
107
131
  subject: "Mathématiques",
108
132
  getQuestionFromIdentifiers,
109
- // hasHintAndCorrection: true,
133
+ hasHintAndCorrection: true,
134
+ options,
110
135
  };
@@ -3,6 +3,9 @@ type Identifiers = {
3
3
  reason: number;
4
4
  sequence: number[];
5
5
  };
6
- export declare const recognizeReasonFromGraph: Exercise<Identifiers>;
6
+ type Options = {
7
+ firstTermRankOne?: boolean;
8
+ };
9
+ export declare const recognizeReasonFromGraph: Exercise<Identifiers, Options>;
7
10
  export {};
8
11
  //# sourceMappingURL=recognizeReasonFromGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeReasonFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAqEF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
1
+ {"version":3,"file":"recognizeReasonFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2GF,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAUF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAenE,CAAC"}
@@ -1,5 +1,6 @@
1
- import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
3
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
5
  import { Point } from "../../../../math/geometry/point.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -11,11 +12,12 @@ const getAnswer = (identifiers) => {
11
12
  const answer = reason + "";
12
13
  return answer;
13
14
  };
14
- const getGGBOptions = (identifiers) => {
15
+ const getGGBOptions = (identifiers, opts) => {
15
16
  const { sequence } = identifiers;
17
+ const rankOne = opts?.firstTermRankOne ? 1 : 0;
16
18
  const yMin = Math.min(...sequence.slice(0, 5));
17
19
  const yMax = Math.max(...sequence.slice(0, 5));
18
- const commands = sequence.flatMap((nb, index) => new Point(`A_${index}`, index.toTree(), nb.toTree()).toGGBCommand({
20
+ const commands = sequence.flatMap((nb, index) => new Point(`A_{${index + rankOne}}`, (index + rankOne).toTree(), nb.toTree()).toGGBCommand({
19
21
  showLabel: false,
20
22
  }));
21
23
  const ggb = new GeogebraConstructor({
@@ -27,25 +29,47 @@ const getGGBOptions = (identifiers) => {
27
29
  coords: [-1, 7, Math.min(-1, yMin - 2), Math.max(1, yMax + 2)],
28
30
  });
29
31
  };
30
- const getQuestionFromIdentifiers = (identifiers) => {
32
+ const getHint = () => {
33
+ return `Une suite est arithmétique si, pour passer d'un terme au suivant, on ajoute toujours le même nombre (appelé la raison de la suite).
34
+
35
+ Lit graphiquement les premiers termes de la suite pour déterminer ce nombre.`;
36
+ };
37
+ const getCorrection = (identifiers, opts) => {
38
+ const rankOne = opts?.firstTermRankOne ? 1 : 0;
39
+ const { sequence, reason } = identifiers;
40
+ return `On peut lire graphiquement les premiers termes de la suite :
41
+
42
+ ${sequence
43
+ .slice(0, 5)
44
+ .map((e, i) => `$$
45
+ u_{${i + rankOne}} = ${e.frenchify()}
46
+ $$`)
47
+ .join("\n \n")}
48
+
49
+ Pour passer d'un terme à l'autre, on ajoute donc toujours $${reason.frenchify()}$ : c'est la raison de la suite $u$.
50
+ `;
51
+ };
52
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
31
53
  const question = {
32
54
  answer: getAnswer(identifiers),
33
55
  instruction: getInstruction(identifiers),
34
56
  keys: [],
35
- ggbOptions: getGGBOptions(identifiers),
57
+ ggbOptions: getGGBOptions(identifiers, opts),
36
58
  answerFormat: "tex",
37
59
  identifiers,
60
+ hint: getHint(identifiers),
61
+ correction: getCorrection(identifiers, opts),
38
62
  };
39
63
  return question;
40
64
  };
41
- const getRecognizeReasonFromGraphQuestion = () => {
65
+ const getRecognizeReasonFromGraphQuestion = (opts) => {
42
66
  const firstTerm = randint(1, 20);
43
67
  const reason = randint(-5, 6, [0]);
44
68
  const sequence = new Array(10)
45
69
  .fill(0)
46
70
  .map((_el, index) => firstTerm + index * reason);
47
71
  const identifiers = { reason, sequence };
48
- return getQuestionFromIdentifiers(identifiers);
72
+ return getQuestionFromIdentifiers(identifiers, opts);
49
73
  };
50
74
  const getPropositions = (n, { answer }) => {
51
75
  const propositions = [];
@@ -56,13 +80,21 @@ const getPropositions = (n, { answer }) => {
56
80
  return shuffleProps(propositions, n);
57
81
  };
58
82
  const isAnswerValid = (ans, { answer }) => {
59
- return ans === answer;
83
+ return numberVEA(ans, answer);
60
84
  };
85
+ const options = [
86
+ {
87
+ id: "firstTermRankOne",
88
+ label: "Utiliser $u_1$ comme premier terme",
89
+ target: GeneratorOptionTarget.generation,
90
+ type: GeneratorOptionType.checkbox,
91
+ },
92
+ ];
61
93
  export const recognizeReasonFromGraph = {
62
94
  id: "recognizeReasonFromGraph",
63
95
  label: "Reconnaître graphiquement la raison d'une suite arithmétique",
64
96
  isSingleStep: true,
65
- generator: (nb) => getDistinctQuestions(getRecognizeReasonFromGraphQuestion, nb),
97
+ generator: (nb, opts) => getDistinctQuestions(() => getRecognizeReasonFromGraphQuestion(opts), nb),
66
98
  qcmTimer: 60,
67
99
  freeTimer: 60,
68
100
  getPropositions,
@@ -70,4 +102,6 @@ export const recognizeReasonFromGraph = {
70
102
  hasGeogebra: true,
71
103
  subject: "Mathématiques",
72
104
  getQuestionFromIdentifiers,
105
+ options,
106
+ hasHintAndCorrection: true,
73
107
  };
@@ -7,4 +7,5 @@ export * from "./sequenceEvaluation.js";
7
7
  export * from "./sequencePlot.js";
8
8
  export * from "./graph/index.js";
9
9
  export * from "./notation/index.js";
10
+ export * from "./variations/index.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,uBAAuB,CAAC"}
@@ -8,3 +8,4 @@ export * from "./sequencePlot.js";
8
8
  export * from "./graph/index.js";
9
9
  export * from "./notation/index.js";
10
10
  // export * from "./limits/index.js";
11
+ export * from "./variations/index.js";
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ formulaIds: NodeIdentifiers;
5
+ };
6
+ type Options = {
7
+ sequenceTypes: string[];
8
+ };
9
+ export declare const expressConsecutiveTermsDifference: Exercise<Identifiers, Options>;
10
+ export {};
11
+ //# sourceMappingURL=expressConsecutiveTermsDifference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expressConsecutiveTermsDifference.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/variations/expressConsecutiveTermsDifference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAWF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB1E,CAAC"}
@@ -0,0 +1,160 @@
1
+ import { addValidProp, shuffleProps, propWhile, GeneratorOptionTarget, GeneratorOptionType, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
+ import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
5
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
6
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
7
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
8
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
9
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
10
+ import { random } from "../../../../utils/alea/random.js";
11
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
12
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
13
+ const getPropositions = (n, { answer, formulaIds }) => {
14
+ const propositions = [];
15
+ addValidProp(propositions, answer);
16
+ const formula = reifyAlgebraic(formulaIds);
17
+ const un1 = formula.toDetailedEvaluation({ n: add("n", 1) });
18
+ tryToAddWrongProp(propositions, un1.simplify({ towardsDistribute: true, forbidFactorize: true }).toTex());
19
+ tryToAddWrongProp(propositions, add(un1, formula)
20
+ .simplify({
21
+ towardsDistribute: true,
22
+ forbidFactorize: true,
23
+ })
24
+ .toTex());
25
+ propWhile(propositions, n, () => {
26
+ tryToAddWrongProp(propositions, coinFlip()
27
+ ? AffineConstructor.random(undefined, undefined, "n").toTree().toTex()
28
+ : TrinomConstructor.random(undefined, undefined, undefined, "n")
29
+ .toTree()
30
+ .toTex());
31
+ });
32
+ return shuffleProps(propositions, n);
33
+ };
34
+ const getAnswer = (identifiers) => {
35
+ const { formulaIds } = identifiers;
36
+ const formula = reifyAlgebraic(formulaIds);
37
+ const un1 = formula.toDetailedEvaluation({ n: add("n", 1) });
38
+ return substract(un1, formula)
39
+ .simplify({
40
+ towardsDistribute: true,
41
+ forbidFactorize: true,
42
+ })
43
+ .toTex();
44
+ };
45
+ const getInstruction = (identifiers) => {
46
+ const { formulaIds } = identifiers;
47
+ const formula = reifyAlgebraic(formulaIds);
48
+ return `On considère la suite $u$ définie sur $\\mathbb{N}$ par :
49
+
50
+ $$
51
+ u_n = ${formula.toTex()}
52
+ $$
53
+
54
+ Pour $n\\geq 0$, exprimer en fonction de $n$ la différence :
55
+
56
+ $$
57
+ u_{n+1}-u_n
58
+ $$`;
59
+ };
60
+ const getHint = () => {
61
+ return `Calcule en fonction de $n$ le terme $u_{n+1}$, en remplaçant $n$ par $n+1$ dans la formule donnée.
62
+
63
+ Puis, soustrait $u_n$ et simplifie.`;
64
+ };
65
+ const getCorrection = (identifiers) => {
66
+ const { formulaIds } = identifiers;
67
+ const formula = reifyAlgebraic(formulaIds);
68
+ const un1 = formula.toDetailedEvaluation({ n: add("n", 1) });
69
+ const un1Simp = un1.simplify({
70
+ towardsDistribute: true,
71
+ forbidFactorize: true,
72
+ });
73
+ return `On exprime d'abord $u_{n+1}$ :
74
+
75
+ ${alignTex([
76
+ ["u_{n+1}", "=", un1.toTex()],
77
+ ["", "=", un1Simp.toTex()],
78
+ ])}
79
+
80
+ On a donc :
81
+
82
+ ${alignTex([
83
+ ["u_{n+1}-u_n", "=", substract(un1Simp, formula).toTex()],
84
+ [
85
+ "",
86
+ "=",
87
+ substract(un1Simp, formula)
88
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
89
+ .toTex(),
90
+ ],
91
+ ])}`;
92
+ };
93
+ const getKeys = () => {
94
+ return ["n"];
95
+ };
96
+ const isAnswerValid = (ans, { answer }) => {
97
+ try {
98
+ const parsed = parseAlgebraic(ans);
99
+ if (!parsed)
100
+ return false;
101
+ return (parsed
102
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
103
+ .toTex() === answer);
104
+ }
105
+ catch (err) {
106
+ return handleVEAError(err);
107
+ }
108
+ };
109
+ const getExpressConsecutiveTermsDifferenceQuestion = (opts) => {
110
+ const type = opts?.sequenceTypes
111
+ ? random(opts?.sequenceTypes)
112
+ : random(["Premier degré", "Second degré"]);
113
+ const formula = type === "Premier degré"
114
+ ? AffineConstructor.random(undefined, undefined, "n")
115
+ : TrinomConstructor.random(undefined, undefined, undefined, "n");
116
+ const identifiers = {
117
+ formulaIds: formula.toTree().toIdentifiers(),
118
+ };
119
+ return getQuestionFromIdentifiers(identifiers);
120
+ };
121
+ const getQuestionFromIdentifiers = (identifiers) => {
122
+ return {
123
+ answer: getAnswer(identifiers),
124
+ instruction: getInstruction(identifiers),
125
+ keys: getKeys(identifiers),
126
+ answerFormat: "tex",
127
+ identifiers,
128
+ hint: getHint(identifiers),
129
+ correction: getCorrection(identifiers),
130
+ };
131
+ };
132
+ const options = [
133
+ {
134
+ id: "sequenceTypes",
135
+ label: "Type de fonctions",
136
+ target: GeneratorOptionTarget.generation,
137
+ type: GeneratorOptionType.multiselect,
138
+ values: ["Premier degré", "Second degré"],
139
+ defaultValue: ["Premier degré", "Second degré"],
140
+ },
141
+ ];
142
+ export const expressConsecutiveTermsDifference = {
143
+ id: "expressConsecutiveTermsDifference",
144
+ connector: "=",
145
+ label: "Exprimer la différence de deux termes consécutifs $u_{n+1}-u_n$ pour une suite donnée explicitement",
146
+ isSingleStep: true,
147
+ generator: (nb, opts) => getDistinctQuestions(() => getExpressConsecutiveTermsDifferenceQuestion(opts), nb),
148
+ qcmTimer: 60,
149
+ freeTimer: 60,
150
+ getPropositions,
151
+ isAnswerValid,
152
+ subject: "Mathématiques",
153
+ getInstruction,
154
+ getHint,
155
+ getCorrection,
156
+ getAnswer,
157
+ getQuestionFromIdentifiers,
158
+ options,
159
+ hasHintAndCorrection: true,
160
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./expressConsecutiveTermsDifference.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/variations/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./expressConsecutiveTermsDifference.js";
@@ -1 +1 @@
1
- {"version":3,"file":"findAngleFromCosAndSin.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/findAngleFromCosAndSin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
1
+ {"version":3,"file":"findAngleFromCosAndSin.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/findAngleFromCosAndSin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
@@ -11,7 +11,6 @@ const getPropositions = (n, { answer }) => {
11
11
  propWhile(propositions, n, () => {
12
12
  tryToAddWrongProp(propositions, random(mainTrigoValues).angle.toTex());
13
13
  });
14
- throw Error("correction not over");
15
14
  return shuffleProps(propositions, n);
16
15
  };
17
16
  const getAnswer = (identifiers) => {
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ associateType: number;
4
+ startPoint: string;
5
+ };
6
+ export declare const findAssociateAnglePointOnTrigoCircle: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=findAssociateAnglePointOnTrigoCircle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findAssociateAnglePointOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAuKF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAqBtE,CAAC"}
@@ -0,0 +1,158 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
5
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
6
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
7
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
8
+ import { random } from "../../../../utils/alea/random.js";
9
+ import { doWhile } from "../../../../utils/doWhile.js";
10
+ const points = [
11
+ "I",
12
+ "A",
13
+ "B",
14
+ "C",
15
+ "D",
16
+ "E",
17
+ "J",
18
+ "F",
19
+ "G",
20
+ "H",
21
+ "K",
22
+ "L",
23
+ "M",
24
+ "N",
25
+ "P",
26
+ "Q",
27
+ "R",
28
+ "S",
29
+ "T",
30
+ "U",
31
+ "V",
32
+ "W",
33
+ "X",
34
+ "Y",
35
+ ];
36
+ const getPropositions = (n, { answer, startPoint }) => {
37
+ const propositions = [];
38
+ addValidProp(propositions, answer);
39
+ tryToAddWrongProp(propositions, getAnswer({
40
+ associateType: 0,
41
+ startPoint,
42
+ }));
43
+ tryToAddWrongProp(propositions, getAnswer({
44
+ associateType: 1,
45
+ startPoint,
46
+ }));
47
+ tryToAddWrongProp(propositions, getAnswer({
48
+ associateType: 2,
49
+ startPoint,
50
+ }));
51
+ propWhile(propositions, n, () => {
52
+ tryToAddWrongProp(propositions, random(points));
53
+ });
54
+ return shuffleProps(propositions, n);
55
+ };
56
+ const getAnswer = (identifiers) => {
57
+ //pi+a :index +12
58
+ //-a : length - index
59
+ const { associateType, startPoint } = identifiers;
60
+ const startIndex = points.indexOf(startPoint);
61
+ switch (associateType) {
62
+ case 0:
63
+ return points[points.length - startIndex];
64
+ case 1:
65
+ return points[(startIndex + 12) % points.length];
66
+ case 2:
67
+ default:
68
+ if (startIndex <= 12)
69
+ return points[12 - startIndex];
70
+ else
71
+ return points[12 + (points.length - startIndex)];
72
+ }
73
+ };
74
+ const getAssociateAngle = (identifiers) => {
75
+ const { associateType } = identifiers;
76
+ switch (associateType) {
77
+ case 0:
78
+ return opposite("a");
79
+ case 1:
80
+ return add(PiNode, "a");
81
+ case 2:
82
+ default:
83
+ return substract(PiNode, "a");
84
+ }
85
+ };
86
+ const getInstruction = (identifiers) => {
87
+ const { startPoint } = identifiers;
88
+ return `On considère un réel $a$, dont le point-image est $${startPoint}$ sur le cercle trigonométrique ci-dessous.
89
+
90
+ Quel est le point-image de $${getAssociateAngle(identifiers).toTex()}$ ?
91
+
92
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCircleBy12.png)`;
93
+ };
94
+ const getHint = (identifiers) => {
95
+ const { associateType } = identifiers;
96
+ switch (associateType) {
97
+ case 0:
98
+ return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.`;
99
+ case 1:
100
+ return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.`;
101
+ case 2:
102
+ default:
103
+ return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.`;
104
+ }
105
+ };
106
+ const getCorrection = (identifiers) => {
107
+ const { associateType } = identifiers;
108
+ switch (associateType) {
109
+ case 0:
110
+ return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.
111
+
112
+ Le point-image associé à l'angle $${getAssociateAngle(identifiers).toTex()}$ est donc $${getAnswer(identifiers)}$.`;
113
+ case 1:
114
+ return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.
115
+
116
+ Le point-image associé à l'angle $${getAssociateAngle(identifiers).toTex()}$ est donc $${getAnswer(identifiers)}$.`;
117
+ case 2:
118
+ default:
119
+ return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.
120
+
121
+ Le point-image associé à l'angle $${getAssociateAngle(identifiers).toTex()}$ est donc $${getAnswer(identifiers)}$.`;
122
+ }
123
+ };
124
+ const getFindAssociateAnglePointOnTrigoCircleQuestion = () => {
125
+ const startPoint = doWhile(() => random(points), (p) => ["I", "J", "M", "T"].includes(p));
126
+ const identifiers = {
127
+ associateType: randint(0, 3),
128
+ startPoint,
129
+ };
130
+ return getQuestionFromIdentifiers(identifiers);
131
+ };
132
+ const getQuestionFromIdentifiers = (identifiers) => {
133
+ return {
134
+ answer: getAnswer(identifiers),
135
+ instruction: getInstruction(identifiers),
136
+ answerFormat: "tex",
137
+ identifiers,
138
+ hint: getHint(identifiers),
139
+ correction: getCorrection(identifiers),
140
+ };
141
+ };
142
+ export const findAssociateAnglePointOnTrigoCircle = {
143
+ id: "findAssociateAnglePointOnTrigoCircle",
144
+ label: "Repérer le point-image d'un angle associé à un autre sur le cercle trigonométriqueérer ",
145
+ isSingleStep: true,
146
+ generator: (nb, opts) => getDistinctQuestions(() => getFindAssociateAnglePointOnTrigoCircleQuestion(opts), nb),
147
+ qcmTimer: 60,
148
+ freeTimer: 60,
149
+ getPropositions,
150
+ subject: "Mathématiques",
151
+ getInstruction,
152
+ getHint,
153
+ getCorrection,
154
+ getAnswer,
155
+ getQuestionFromIdentifiers,
156
+ hasHintAndCorrection: true,
157
+ answerType: "QCU",
158
+ };
@@ -4,4 +4,6 @@ export * from "./mainRemarkableValues.js";
4
4
  export * from "./remarkableValues.js";
5
5
  export * from "./areReelsOnTheSameTrigoCirclePoint.js";
6
6
  export * from "./associateReelToTrigoCirclePoint.js";
7
+ export * from "./placeAssociateAngleOnCircle.js";
8
+ export * from "./findAssociateAnglePointOnTrigoCircle.js";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAErD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC"}
@@ -5,3 +5,5 @@ export * from "./remarkableValues.js";
5
5
  export * from "./areReelsOnTheSameTrigoCirclePoint.js";
6
6
  export * from "./associateReelToTrigoCirclePoint.js";
7
7
  // export * from "./findAngleFromCosAndSin.js";
8
+ export * from "./placeAssociateAngleOnCircle.js";
9
+ export * from "./findAssociateAnglePointOnTrigoCircle.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAgGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
1
+ {"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAkGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
@@ -1,4 +1,7 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp,
2
+ // GetCorrection,
3
+ // GetHint,
4
+ } from "../../../../exercises/exercise.js";
2
5
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
6
  import { mainTrigoValues, } from "../../../../math/trigonometry/remarkableValues.js";
4
7
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -43,9 +46,10 @@ $$
43
46
  };
44
47
  // const getHint: GetHint<Identifiers> = (identifiers) => {
45
48
  // const angle = NodeConstructor.fromIdentifiers(identifiers.nodeIds);
46
- // return `La mesure principale d'un angle en radian est sa valeur appartenant à l'intervalle $]-\\pi; \\pi]$. Il faut donc ajouter (ou retirer) $2\\pi$ à $${angle.toTex()}$ jusqu'à ce que le résultat soit dans cet intervalle.`;
49
+ // return `La mesure principale d'un angle en radian est sa valeur appartenant à l'intervalle $]-\\pi; \\pi]$.
50
+ // Il faut donc ajouter (ou retirer) $2\\pi$ à $${angle.toTex()}$ jusqu'à ce que le résultat soit dans cet intervalle.`;
47
51
  // };
48
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
52
+ // const getCorrection: GetCorrection<Identifiers> = () => {
49
53
  // return `a`;
50
54
  // };
51
55
  const getKeys = () => {
@@ -97,4 +101,5 @@ export const mainAngleMeasure = {
97
101
  isAnswerValid,
98
102
  subject: "Mathématiques",
99
103
  getQuestionFromIdentifiers,
104
+ // hasHintAndCorrection: true,
100
105
  };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ degree: number;
4
+ associateType: number;
5
+ };
6
+ export declare const placeAssociateAngleOnCircle: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=placeAssociateAngleOnCircle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeAssociateAngleOnCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AA4LF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAqB7D,CAAC"}
@@ -0,0 +1,167 @@
1
+ import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { pinkDark } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
6
+ import { parseGGBPoints } from "../../../../geogebra/parsers/parseGGBPoints.js";
7
+ import { Point } from "../../../../math/geometry/point.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
10
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
11
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
12
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
13
+ import { doWhile } from "../../../../utils/doWhile.js";
14
+ const getAssociateAngle = (identifiers) => {
15
+ const { associateType } = identifiers;
16
+ switch (associateType) {
17
+ case 0:
18
+ return opposite("a");
19
+ case 1:
20
+ return add(PiNode, "a");
21
+ case 2:
22
+ default:
23
+ return substract(PiNode, "a");
24
+ }
25
+ };
26
+ const getInstruction = (identifiers) => {
27
+ return `On considère un réel $a$, dont le point-image est $A$ sur le cercle trigonométrique ci-dessous.
28
+
29
+ Avec les outils disponibles, construire sur la figure le point-image du réel $${getAssociateAngle(identifiers).toTex()}$.
30
+ `;
31
+ };
32
+ const getHint = (identifiers) => {
33
+ const { associateType } = identifiers;
34
+ switch (associateType) {
35
+ case 0:
36
+ return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.`;
37
+ case 1:
38
+ return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.`;
39
+ case 2:
40
+ default:
41
+ return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.`;
42
+ }
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { associateType } = identifiers;
46
+ switch (associateType) {
47
+ case 0:
48
+ return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.
49
+
50
+ On utilise donc l'outil "Symétrie linéaire", on sélectionne le point $A$ puis l'axe des abscisses. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$.`;
51
+ case 1:
52
+ return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.
53
+
54
+ On utilise donc l'outil "Symétrie centrale", on sélectionne le point $A$ puis l'origine du repère. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$.`;
55
+ case 2:
56
+ default:
57
+ return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.
58
+
59
+ On utilise donc l'outil "Symétrie linéaire", on sélectionne le point $A$ puis l'axe des ordonnées. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$. `;
60
+ }
61
+ };
62
+ const getAnswerPoint = (identifiers) => {
63
+ const { associateType, degree } = identifiers;
64
+ switch (associateType) {
65
+ case 0:
66
+ return new Point("A'", Math.cos((-degree * Math.PI) / 180), Math.sin((-degree * Math.PI) / 180));
67
+ case 1:
68
+ return new Point("A'", Math.cos(((180 + degree) * Math.PI) / 180), Math.sin(((180 + degree) * Math.PI) / 180));
69
+ case 2:
70
+ default:
71
+ return new Point("A'", Math.cos(((180 - degree) * Math.PI) / 180), Math.sin(((180 - degree) * Math.PI) / 180));
72
+ }
73
+ };
74
+ const getGGBAnswer = (identifiers) => {
75
+ const point = getAnswerPoint(identifiers);
76
+ return [
77
+ ...point.toGGBCommand({
78
+ showLabel: true,
79
+ }),
80
+ `S = Segment(A, A')`,
81
+ `SetFixed(S, true, false)`,
82
+ `SetColor(S, "${pinkDark}")`,
83
+ ];
84
+ };
85
+ const getStudentGGBOptions = (identifiers) => {
86
+ const { degree } = identifiers;
87
+ const point = new Point("A", Math.cos((degree * Math.PI) / 180), Math.sin((degree * Math.PI) / 180));
88
+ const ggb = new GeogebraConstructor({
89
+ commands: [
90
+ `O = (0,0)`,
91
+ `SetFixed(O, true, true)`,
92
+ `C = Circle((0,0),1)`,
93
+ `ShowLabel(C, false)`,
94
+ `SetFixed(C, true, false)`,
95
+ // `I = (1,0)`,
96
+ // `SetFixed(I, true, false)`,
97
+ // `J = (0, 1)`,
98
+ // `SetFixed(J, true, false)`,
99
+ ...point.toGGBCommand({
100
+ showLabel: true,
101
+ isSelectionnable: true,
102
+ }),
103
+ // `Text("$\\small A$", (1.4*cos(${degree} * pi / 180), 1.4*sin(${degree} * pi / 180)), true, true, 0,0)`,
104
+ ],
105
+ customToolBar: toolBarConstructor({
106
+ intersect: true,
107
+ centralSymetric: true,
108
+ lineSymetric: true,
109
+ }),
110
+ hideGrid: true,
111
+ xAxis: {
112
+ hideNumbers: true,
113
+ },
114
+ yAxis: {
115
+ hideNumbers: true,
116
+ },
117
+ });
118
+ return ggb.getOptions({
119
+ coords: [-1.1, 1.1, -1.1, 1.1],
120
+ });
121
+ };
122
+ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
123
+ const points = parseGGBPoints(ans)
124
+ .map((p) => ggbPointToCoords(p))
125
+ .map((coords, i) => new Point(`K_${i}`, coords.x, coords.y));
126
+ const answerPoint = getAnswerPoint(identifiers);
127
+ console.log(points.map((e) => [e.x.toTex(), e.y.toTex()]));
128
+ console.log(answerPoint.x.toTex(), answerPoint.y.toTex());
129
+ return (points.length < 5 &&
130
+ points.some((point) => point.distanceTo(answerPoint) < 0.1));
131
+ };
132
+ const getPlaceAssociateAngleOnCircleQuestion = () => {
133
+ const degree = doWhile(() => randint(0, 360), (x) => Math.min(x % 90, 90 - (x % 90)) < 20);
134
+ const associateType = randint(0, 3);
135
+ const identifiers = {
136
+ degree,
137
+ associateType,
138
+ };
139
+ return getQuestionFromIdentifiers(identifiers);
140
+ };
141
+ const getQuestionFromIdentifiers = (identifiers) => {
142
+ return {
143
+ ggbAnswer: getGGBAnswer(identifiers),
144
+ instruction: getInstruction(identifiers),
145
+ studentGgbOptions: getStudentGGBOptions(identifiers),
146
+ identifiers,
147
+ hint: getHint(identifiers),
148
+ correction: getCorrection(identifiers),
149
+ };
150
+ };
151
+ export const placeAssociateAngleOnCircle = {
152
+ id: "placeAssociateAngleOnCircle",
153
+ label: "Construire le point-image d'un angle associé à un autre sur le cercle trigonométrique",
154
+ isSingleStep: true,
155
+ generator: (nb, opts) => getDistinctQuestions(() => getPlaceAssociateAngleOnCircleQuestion(opts), nb),
156
+ ggbTimer: 60,
157
+ isGGBAnswerValid,
158
+ subject: "Mathématiques",
159
+ getHint,
160
+ getInstruction,
161
+ getCorrection,
162
+ getGGBAnswer,
163
+ getStudentGGBOptions,
164
+ answerType: "GGB",
165
+ getQuestionFromIdentifiers,
166
+ hasHintAndCorrection: true,
167
+ };
@@ -11,5 +11,7 @@ export declare const toolBarConstructor: (options: {
11
11
  segmentFixed?: boolean;
12
12
  polygon?: boolean;
13
13
  erase?: boolean;
14
+ centralSymetric?: boolean;
15
+ lineSymetric?: boolean;
14
16
  }) => string;
15
17
  //# sourceMappingURL=toolBarConstructor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,SAAS;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,WAgBA,CAAC"}
1
+ {"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,SAAS;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,WAkBA,CAAC"}
@@ -24,5 +24,9 @@ export const toolBarConstructor = (options) => {
24
24
  customToolBar += "||34";
25
25
  if (options.polygon)
26
26
  customToolBar += "||16";
27
+ if (options.centralSymetric)
28
+ customToolBar += "||29";
29
+ if (options.lineSymetric)
30
+ customToolBar += "||30";
27
31
  return customToolBar;
28
32
  };
package/lib/index.d.ts CHANGED
@@ -3125,10 +3125,14 @@ declare const mathExercises: (Exercise<{
3125
3125
  }, Record<string, string | boolean | string[]>> | Exercise<{
3126
3126
  reason: number;
3127
3127
  sequence: number[];
3128
- }, Record<string, string | boolean | string[]>> | Exercise<{
3128
+ }, {
3129
+ firstTermRankOne?: boolean;
3130
+ }> | Exercise<{
3129
3131
  isAri: boolean;
3130
3132
  sequence: number[];
3131
- }, Record<string, string | boolean | string[]>> | Exercise<{
3133
+ }, {
3134
+ firstTermRankOne?: boolean;
3135
+ }> | Exercise<{
3132
3136
  firstRank: number;
3133
3137
  firstValue: number;
3134
3138
  reason: number;
@@ -3258,6 +3262,10 @@ declare const mathExercises: (Exercise<{
3258
3262
  askedTerm: number;
3259
3263
  }, {
3260
3264
  firstRank: string;
3265
+ }> | Exercise<{
3266
+ formulaIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3267
+ }, {
3268
+ sequenceTypes: string[];
3261
3269
  }> | Exercise<{
3262
3270
  intervalIdentifiers: import("./tree/nodes/sets/intervalNode.js").IntervalNodeIdentifiers;
3263
3271
  }, Record<string, string | boolean | string[]>> | Exercise<{
@@ -3457,6 +3465,12 @@ declare const mathExercises: (Exercise<{
3457
3465
  }, {
3458
3466
  solutionInterval: string;
3459
3467
  }> | Exercise<{
3468
+ degree: number;
3469
+ associateType: number;
3470
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3471
+ associateType: number;
3472
+ startPoint: string;
3473
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3460
3474
  trigFunction: string;
3461
3475
  trigValue: number;
3462
3476
  angleInDegrees: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -17,7 +17,7 @@ export declare abstract class TrinomConstructor {
17
17
  min?: number;
18
18
  max?: number;
19
19
  excludes?: number[];
20
- }): Trinom;
20
+ }, variable?: string): Trinom;
21
21
  static randomCanonical(aOpts?: {
22
22
  min?: number;
23
23
  max?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAO,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAEL,YAAY,EACb,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMlE,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM,CACX,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC1D,MAAM;IAmBT,MAAM,CAAC,eAAe,CACpB,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAA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,EAAE;IAyD/B,2BAA2B,CAAC,eAAe,CAAC,EAAE,OAAO;IAarD,QAAQ;IAGR,YAAY;IAIZ,OAAO;IAIP,WAAW;IAIX,YAAY;IAeZ,gBAAgB;IAsBhB,SAAS;IAIT,SAAS;IAYT,QAAQ;IAkCR,aAAa,CACX,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;;;;KAA4C;CAYrE"}
@@ -16,11 +16,11 @@ import { random } from "../../utils/alea/random.js";
16
16
  import { blueMain } from "../../geogebra/colors.js";
17
17
  import { round } from "../utils/round.js";
18
18
  export class TrinomConstructor {
19
- static random(aOpts, bOpts, cOpts) {
19
+ static random(aOpts, bOpts, cOpts, variable) {
20
20
  const a = randint(aOpts?.min ?? -9, aOpts?.max ?? 10, aOpts?.excludes ?? [0]);
21
21
  const b = randint(bOpts?.min ?? -9, bOpts?.max ?? 10, bOpts?.excludes ?? []);
22
22
  const c = randint(cOpts?.min ?? -9, cOpts?.max ?? 10, cOpts?.excludes ?? []);
23
- return new Trinom(a, b, c);
23
+ return new Trinom(a, b, c, variable ? { variable } : undefined);
24
24
  }
25
25
  static randomCanonical(aOpts, alphaOpts, betaOpts) {
26
26
  const a = aOpts?.from
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.168",
4
+ "version": "3.0.169",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [