math-exercises 3.0.173 → 3.0.175

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 (65) hide show
  1. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +2 -2
  2. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +1 -1
  3. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  4. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +0 -1
  5. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +2 -0
  6. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -0
  7. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +68 -0
  8. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts +15 -0
  9. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts.map +1 -0
  10. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +206 -0
  11. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +2 -0
  12. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -0
  13. package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +108 -0
  14. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts +25 -0
  15. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts.map +1 -0
  16. package/lib/exercises/math/probaStat/trees/probabilityTree.js +625 -0
  17. package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts +9 -0
  18. package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts.map +1 -0
  19. package/lib/exercises/math/probaStat/trees/treeInAnswer.js +107 -0
  20. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +1 -1
  21. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +1 -1
  22. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts +4 -1
  23. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
  24. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +66 -24
  25. package/lib/exercises/math/trigonometry/circle/index.d.ts +1 -0
  26. package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
  27. package/lib/exercises/math/trigonometry/circle/index.js +1 -0
  28. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts +2 -0
  29. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -0
  30. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +94 -0
  31. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts +10 -0
  32. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts.map +1 -0
  33. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.js +223 -0
  34. package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -1
  35. package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +2 -1
  36. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts +10 -0
  37. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts.map +1 -0
  38. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +208 -0
  39. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts +0 -6
  40. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts.map +1 -1
  41. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +162 -99
  42. package/lib/exercises/math/trigonometry/functions/index.d.ts +3 -0
  43. package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -1
  44. package/lib/exercises/math/trigonometry/functions/index.js +3 -0
  45. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts +12 -0
  46. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts.map +1 -0
  47. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.js +159 -0
  48. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts +10 -0
  49. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts.map +1 -0
  50. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.js +224 -0
  51. package/lib/exercises/math/trigonometry/trigoFundamentalEquation.js +1 -1
  52. package/lib/exercises/vea/treeTableVEA.d.ts +2 -0
  53. package/lib/exercises/vea/treeTableVEA.d.ts.map +1 -0
  54. package/lib/exercises/vea/treeTableVEA.js +7 -0
  55. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  56. package/lib/exercises/vea/varLineVEA.js +9 -6
  57. package/lib/index.d.ts +19 -1
  58. package/lib/index.d.ts.map +1 -1
  59. package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
  60. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  61. package/lib/tree/nodes/inequations/inequationNode.js +16 -0
  62. package/lib/utils/latex/poundify.d.ts +2 -0
  63. package/lib/utils/latex/poundify.d.ts.map +1 -0
  64. package/lib/utils/latex/poundify.js +3 -0
  65. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { InegalitySymbols } from "../../../../math/inequations/inequation.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ cosIds: NodeIdentifiers;
6
+ ineqType: InegalitySymbols;
7
+ };
8
+ export declare const cosInequationMainInterval: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=cosInequationMainInterval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cosInequationMainInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/cosInequationMainInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,gBAAgB,EAEjB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA0MF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAuB3D,CAAC"}
@@ -0,0 +1,208 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { red } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { InequationSymbolConstructor, } from "../../../../math/inequations/inequation.js";
6
+ import { mainTrigoValues } from "../../../../math/trigonometry/remarkableValues.js";
7
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
8
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
9
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
10
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
11
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
12
+ import { UnionIntervalNode } from "../../../../tree/nodes/sets/unionIntervalNode.js";
13
+ import { unionIntervalParser } from "../../../../tree/parsers/unionIntervalParser.js";
14
+ import { random } from "../../../../utils/alea/random.js";
15
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ const getPropositions = (n, { answer, ineqType, cosIds }) => {
17
+ const propositions = [];
18
+ addValidProp(propositions, answer);
19
+ tryToAddWrongProp(propositions, getAnswer({
20
+ ineqType: InequationSymbolConstructor.reverse(ineqType),
21
+ cosIds: cosIds,
22
+ }));
23
+ propWhile(propositions, n, () => {
24
+ const value = random(mainTrigoValues.filter((v) => Math.abs(v.cos.evaluate()) !== 1));
25
+ tryToAddWrongProp(propositions, getAnswer({
26
+ ineqType: ineqType,
27
+ cosIds: value.cos.toIdentifiers(),
28
+ }));
29
+ });
30
+ return shuffleProps(propositions, n);
31
+ };
32
+ const getAnswer = (identifiers) => {
33
+ const { cosIds, ineqType } = identifiers;
34
+ const cosValue = reifyAlgebraic(cosIds);
35
+ //trouve la premiere value dans ]-pi; 0]
36
+ const values = mainTrigoValues
37
+ .filter((v) => Math.abs(v.cos.evaluate() - cosValue.evaluate()) < 0.0001)
38
+ .map((e) => e.angle);
39
+ switch (ineqType) {
40
+ case "<":
41
+ return new UnionIntervalNode([
42
+ new IntervalNode(opposite(PiNode), values[0], ClosureType.OO),
43
+ new IntervalNode(values[1], PiNode, ClosureType.OF),
44
+ ]).toTex();
45
+ case "\\le":
46
+ return new UnionIntervalNode([
47
+ new IntervalNode(opposite(PiNode), values[0], ClosureType.OF),
48
+ new IntervalNode(values[1], PiNode, ClosureType.FF),
49
+ ]).toTex();
50
+ case ">":
51
+ return new IntervalNode(values[0], values[1], ClosureType.OO).toTex();
52
+ break;
53
+ case "\\ge":
54
+ return new IntervalNode(values[0], values[1], ClosureType.FF).toTex();
55
+ }
56
+ };
57
+ const getInstruction = (identifiers) => {
58
+ const { cosIds, ineqType } = identifiers;
59
+ const cosValue = reifyAlgebraic(cosIds);
60
+ return `Résoudre dans $]-\\pi; \\pi]$ l'inéquation suivante :
61
+
62
+ $$
63
+ \\cos(x)${ineqType}${cosValue.toTex()}
64
+ $$`;
65
+ };
66
+ const getHint = (identifiers) => {
67
+ const { cosIds } = identifiers;
68
+ const cosValue = reifyAlgebraic(cosIds);
69
+ return `Commence par résoudre sur $]-\\pi; \\pi]$ l'équation :
70
+
71
+ $$
72
+ \\cos(x)=${cosValue.toTex()}
73
+ $$
74
+
75
+ Puis, sers-toi du cercle trigonométrique pour en déduire l'ensemble des solutions de l'inéquation proposée.`;
76
+ };
77
+ const getCorrection = (identifiers) => {
78
+ const { cosIds, ineqType } = identifiers;
79
+ const cosValue = reifyAlgebraic(cosIds);
80
+ //trouve la premiere value dans ]-pi; 0]
81
+ const values = mainTrigoValues
82
+ .filter((v) => Math.abs(v.cos.evaluate() - cosValue.evaluate()) < 0.0001)
83
+ .map((e) => e.angle);
84
+ return `On commence par résoudre sur $]-\\pi; \\pi]$ l'équation :
85
+
86
+ $$
87
+ \\cos(x)=${cosValue.toTex()}
88
+ $$
89
+
90
+ Les solutions sont $${values[0].toTex()}$ et $${values[1].toTex()}$.
91
+
92
+ Puis on se sers du cercle trigonométrique ci-dessous, pour en déduire que l'ensemble des solutions de l'inéquation $\\cos(x)${ineqType}${cosValue.toTex()}$ est :
93
+
94
+ $$
95
+ ${getAnswer(identifiers)}
96
+ $$
97
+ `;
98
+ };
99
+ const getCorrectionGGBOptions = (identifiers) => {
100
+ const { cosIds, ineqType } = identifiers;
101
+ const cosValue = reifyAlgebraic(cosIds);
102
+ const values = mainTrigoValues
103
+ .filter((v) => Math.abs(v.cos.evaluate() - cosValue.evaluate()) < 0.0001)
104
+ .map((e) => e.angle);
105
+ const commands = [
106
+ `C : x^2 + y^2 = 1`,
107
+ `O = (0,0)`,
108
+ `ShowLabel(O, false)`,
109
+ `SetVisibleInView(O, 1, false)`,
110
+ `ShowLabel(C, false)`,
111
+ `SetFixed(C, true ,false)`,
112
+ `d : x = ${cosValue.evaluate()}`,
113
+ `SetLineThickness(d, 1.7)`,
114
+ `SetLineStyle(d, 1)`,
115
+ `A = (cos(${values[0].evaluate()}), sin(${values[0].evaluate()}))`,
116
+ `ShowLabel(A, false)`,
117
+ `Text("$\\tiny ${values[0].toTex()}$", A+0.3*Vector(O,A), false, true, 0, 0)`,
118
+ `B = (cos(${values[1].evaluate()}), sin(${values[1].evaluate()}))`,
119
+ `Text("$\\tiny ${values[1].toTex()}$", B+0.3*Vector(O,B), false, true, 0, 0)`,
120
+ `ShowLabel(B, false)`,
121
+ `D = (${cosValue.evaluate()}, 0)`,
122
+ `SetCaption(D, "$\\tiny ${cosValue.toTex()}$")`,
123
+ `Text("$\\tiny ${cosValue.toTex()}$", D, false, true, 0, 0)`,
124
+ `SetPointSize(D, 1.3)`,
125
+ `ShowLabel(D, false)`,
126
+ `E = (-1,0)`,
127
+ `I = (1,0)`,
128
+ `SetVisibleInView(E, 1, false)`,
129
+ `SetVisibleInView(I, 1, false)`,
130
+ `v = Vector(E, I)`,
131
+ `w = Vector((0, -1), (0, 1))`,
132
+ `SetLineThickness(v, 1.3)`,
133
+ `SetLineThickness(w, 1.3)`,
134
+ ];
135
+ if (ineqType === "<" || ineqType === "\\le") {
136
+ commands.push(`S = CircumcircularArc(A,E,B)`);
137
+ }
138
+ else {
139
+ commands.push(`S = CircumcircularArc(A,I,B)`);
140
+ }
141
+ commands.push(`SetFixed(S, true, false)`);
142
+ commands.push(`SetColor(S, "${red}")`);
143
+ const ggb = new GeogebraConstructor({
144
+ commands,
145
+ hideAxes: true,
146
+ hideGrid: true,
147
+ });
148
+ return ggb.getOptions({
149
+ coords: cosValue.evaluate() === 0
150
+ ? [-1.1, 1.1, -1.5, 1.5]
151
+ : [-1.1, 1.1, -1.3, 1.3],
152
+ });
153
+ };
154
+ const getKeys = () => {
155
+ return ["pi", "cup", "lbracket", "semicolon", "rbracket"];
156
+ };
157
+ const isAnswerValid = (ans, { answer }) => {
158
+ try {
159
+ const parsed = unionIntervalParser(ans, {
160
+ allowCommaInsteadOfSemicolon: true,
161
+ allowNoBrackets: true,
162
+ });
163
+ if (!parsed)
164
+ return false;
165
+ return parsed.simplify().toTex() === answer;
166
+ }
167
+ catch (err) {
168
+ return handleVEAError(err);
169
+ }
170
+ };
171
+ const getCosInequationMainIntervalQuestion = () => {
172
+ const value = random(mainTrigoValues.filter((v) => Math.abs(v.cos.evaluate()) !== 1));
173
+ const identifiers = {
174
+ cosIds: value.cos.toIdentifiers(),
175
+ ineqType: random(["<", ">", "\\le", "\\ge"]),
176
+ };
177
+ return getQuestionFromIdentifiers(identifiers);
178
+ };
179
+ const getQuestionFromIdentifiers = (identifiers) => {
180
+ return {
181
+ answer: getAnswer(identifiers),
182
+ instruction: getInstruction(identifiers),
183
+ keys: getKeys(identifiers),
184
+ answerFormat: "tex",
185
+ identifiers,
186
+ hint: getHint(identifiers),
187
+ correction: getCorrection(identifiers),
188
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
189
+ };
190
+ };
191
+ export const cosInequationMainInterval = {
192
+ id: "cosInequationMainInterval",
193
+ label: "Résoudre une inéquation du type $\\cos(x)\\leq k$ sur $]-\\pi; \\pi]$",
194
+ isSingleStep: true,
195
+ generator: (nb, opts) => getDistinctQuestions(() => getCosInequationMainIntervalQuestion(opts), nb, 20),
196
+ qcmTimer: 60,
197
+ freeTimer: 60,
198
+ getPropositions,
199
+ isAnswerValid,
200
+ subject: "Mathématiques",
201
+ getInstruction,
202
+ getHint,
203
+ getCorrection,
204
+ getAnswer,
205
+ getQuestionFromIdentifiers,
206
+ hasHintAndCorrection: true,
207
+ maxAllowedQuestions: 20,
208
+ };
@@ -1,8 +1,2 @@
1
- import { Exercise } from "../../../../exercises/exercise.js";
2
- type Identifiers = {
3
- degree: number;
4
- leftBoundPiMultiple: number;
5
- };
6
- export declare const equationSinOnRandomInterval: Exercise<Identifiers>;
7
1
  export {};
8
2
  //# sourceMappingURL=equationSinOnRandomInterval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"equationSinOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/equationSinOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAiHF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
1
+ {"version":3,"file":"equationSinOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/equationSinOnRandomInterval.ts"],"names":[],"mappings":""}
@@ -1,101 +1,164 @@
1
- import { addValidProp, shuffleProps, propWhile, } from "../../../../exercises/exercise.js";
2
- import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
- import { mainPositiveTrigovalues, mainTrigoValues, trigoValuesOnZeroTwoPIOF, } from "../../../../math/trigonometry/remarkableValues.js";
4
- import { randint } from "../../../../math/utils/random/randint.js";
5
- import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
6
- import { SinNode } from "../../../../tree/nodes/functions/sinNode.js";
7
- import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
8
- import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
9
- import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
10
- import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
11
- import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
12
- import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
13
- import { random } from "../../../../utils/alea/random.js";
14
- const getPropositions = (n, { answer }) => {
15
- const propositions = [];
16
- addValidProp(propositions, answer);
17
- propWhile(propositions, n, () => {
18
- throw Error("QCM not implemented");
19
- });
20
- return shuffleProps(propositions, n);
21
- };
22
- const getAnswer = (identifiers) => {
23
- const coeff = identifiers.leftBoundPiMultiple;
24
- /**
25
- * Si l'intervalle est centré autour d'un multiple de 2pi (coeff impair) (genre ]3pi, 5pi]) on ajoute (coeff+1)/2 tours
26
- * Sinon (coeff pair) (genre ]2pi, 4pipi]) , on chope la value de ]0, 2pi] et on ajoute coeff/2 tours
27
- */
28
- const turnsToAdd = Math.abs(coeff % 2) === 1 ? (coeff + 1) / 2 : coeff / 2;
29
- const sin = mainTrigoValues
30
- .find((v) => v.degree === identifiers.degree)
31
- .sin.evaluate({});
32
- const values = (Math.abs(coeff % 2) === 1 ? mainTrigoValues : trigoValuesOnZeroTwoPIOF).filter((v) => v.sin.evaluate({}) === sin);
33
- if (values.length === 1) {
34
- const value = values[0];
35
- const newValue = new AddNode(value.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
36
- return (new EquationSolutionNode(new DiscreteSetNode([newValue])).toTex() +
37
- ` turns ${turnsToAdd}, value : ${value.angle.toTex()}`);
38
- }
39
- else {
40
- const newValues = values.map((v) => {
41
- return new AddNode(v.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
42
- });
43
- return (new EquationSolutionNode(new DiscreteSetNode(newValues.sort((a, b) => a.evaluate({}) - b.evaluate({})))).toTex() +
44
- ` turns ${turnsToAdd}, values: ${values.map((v) => v.angle.toTex())}`);
45
- }
46
- };
47
- const getInstruction = ({ degree, leftBoundPiMultiple, }) => {
48
- const value = mainPositiveTrigovalues.find((v) => v.degree === degree);
49
- const leftBound = new MultiplyNode(leftBoundPiMultiple.toTree(), PiNode).simplify();
50
- const rightBound = new MultiplyNode((leftBoundPiMultiple + 2).toTree(), PiNode).simplify();
51
- const interval = new IntervalNode(leftBound, rightBound, ClosureType.OF);
52
- return `Résoudre sur $${interval.toTex()}$ l'équation :
53
-
54
- $$
55
- ${new SinNode("x".toTree()).toTex()}=${value.sin.toTex()}
56
- $$`;
57
- };
58
- // const getHint: GetHint<Identifiers> = (identifiers) => {
59
- // return "";
1
+ // import {
2
+ // Exercise,
3
+ // Proposition,
4
+ // QCMGenerator,
5
+ // Question,
6
+ // QuestionGenerator,
7
+ // VEA,
8
+ // addValidProp,
9
+ // shuffleProps,
10
+ // GetAnswer,
11
+ // GetInstruction,
12
+ // GetKeys,
13
+ // GetQuestionFromIdentifiers,
14
+ // propWhile,
15
+ // } from "../../../../exercises/exercise.js";
16
+ // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
17
+ // import {
18
+ // mainPositiveTrigovalues,
19
+ // mainTrigoValues,
20
+ // trigoValuesOnZeroTwoPIOF,
21
+ // } from "../../../../math/trigonometry/remarkableValues.js";
22
+ // import { randint } from "../../../../math/utils/random/randint.js";
23
+ // import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
24
+ // import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
25
+ // import { sin, SinNode } from "../../../../tree/nodes/functions/sinNode.js";
26
+ // import {
27
+ // NodeIdentifiers,
28
+ // reifyAlgebraic,
29
+ // } from "../../../../tree/nodes/nodeConstructor.js";
30
+ // import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
31
+ // import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
32
+ // import {
33
+ // multiply,
34
+ // MultiplyNode,
35
+ // } from "../../../../tree/nodes/operators/multiplyNode.js";
36
+ // import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
37
+ // import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
38
+ // import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
39
+ // import { random } from "../../../../utils/alea/random.js";
40
+ export {};
41
+ // // résoudre sin(x) = k sur ]a; a+2pi] avec a = kpi
42
+ // type Identifiers = {
43
+ // sinIds: NodeIdentifiers;
44
+ // multipleOfPiToAdd: number;
60
45
  // };
61
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
62
- // return "";
46
+ // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
47
+ // const propositions: Proposition[] = [];
48
+ // addValidProp(propositions, answer);
49
+ // propWhile(propositions, n, () => {
50
+ // throw Error("QCM not implemented");
51
+ // });
52
+ // return shuffleProps(propositions, n);
53
+ // };
54
+ // const getAnswer: GetAnswer<Identifiers> = (identifiers) => {
55
+ // const { multipleOfPiToAdd, sinIds } = identifiers;
56
+ // /**
57
+ // * Si l'intervalle est centré autour d'un multiple de 2pi (coeff impair) (genre ]3pi, 5pi]) on ajoute (coeff+1)/2 tours
58
+ // * Sinon (coeff pair) (genre ]2pi, 4pipi]) , on chope la value de ]0, 2pi] et on ajoute coeff/2 tours
59
+ // */
60
+ // const turnsToAdd = Math.abs(coeff % 2) === 1 ? (coeff + 1) / 2 : coeff / 2;
61
+ // const sin = mainTrigoValues
62
+ // .find((v) => v.degree === identifiers.degree)!
63
+ // .sin.evaluate({});
64
+ // const values = (
65
+ // Math.abs(coeff % 2) === 1 ? mainTrigoValues : trigoValuesOnZeroTwoPIOF
66
+ // ).filter((v) => v.sin.evaluate({}) === sin)!;
67
+ // if (values.length === 1) {
68
+ // const value = values[0];
69
+ // const newValue = new AddNode(
70
+ // value.angle,
71
+ // new MultiplyNode((turnsToAdd * 2).toTree(), PiNode),
72
+ // ).simplify();
73
+ // return (
74
+ // new EquationSolutionNode(new DiscreteSetNode([newValue])).toTex() +
75
+ // ` turns ${turnsToAdd}, value : ${value.angle.toTex()}`
76
+ // );
77
+ // } else {
78
+ // const newValues = values.map((v) => {
79
+ // return new AddNode(
80
+ // v.angle,
81
+ // new MultiplyNode((turnsToAdd * 2).toTree(), PiNode),
82
+ // ).simplify();
83
+ // });
84
+ // return (
85
+ // new EquationSolutionNode(
86
+ // new DiscreteSetNode(
87
+ // newValues.sort((a, b) => a.evaluate({}) - b.evaluate({})),
88
+ // ),
89
+ // ).toTex() +
90
+ // ` turns ${turnsToAdd}, values: ${values.map((v) => v.angle.toTex())}`
91
+ // );
92
+ // }
93
+ // };
94
+ // const getInstruction: GetInstruction<Identifiers> = ({
95
+ // sinIds,
96
+ // multipleOfPiToAdd,
97
+ // }) => {
98
+ // const sinValue = reifyAlgebraic(sinIds);
99
+ // const leftBound = add(
100
+ // opposite(PiNode),
101
+ // multiply(2 * multipleOfPiToAdd, PiNode),
102
+ // ).simplify();
103
+ // const rightBound = add(
104
+ // PiNode,
105
+ // multiply(2 * multipleOfPiToAdd, PiNode),
106
+ // ).simplify();
107
+ // const interval = new IntervalNode(leftBound, rightBound, ClosureType.OF);
108
+ // return `Résoudre sur $${interval.toTex()}$ l'équation :
109
+ // $$
110
+ // ${sin("x").toTex()}=${sinValue.toTex()}
111
+ // $$`;
112
+ // };
113
+ // // const getHint: GetHint<Identifiers> = (identifiers) => {
114
+ // // return "";
115
+ // // };
116
+ // // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
117
+ // // return "";
118
+ // // };
119
+ // const getKeys: GetKeys<Identifiers> = () => {
120
+ // return ["pi"];
121
+ // };
122
+ // const isAnswerValid: VEA<Identifiers> = () => {
123
+ // throw Error("VEA not implemented");
124
+ // };
125
+ // const getEquationSinOnRandomIntervalQuestion: QuestionGenerator<
126
+ // Identifiers
127
+ // > = () => {
128
+ // const value = random(mainTrigoValues);
129
+ // const multipleOfPiToAdd = randint(-3, 4, [0]);
130
+ // const identifiers: Identifiers = {
131
+ // sinIds: value.sin.toIdentifiers(),
132
+ // multipleOfPiToAdd,
133
+ // };
134
+ // return getQuestionFromIdentifiers(identifiers);
135
+ // };
136
+ // const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (
137
+ // identifiers,
138
+ // ) => {
139
+ // const question: Question<Identifiers> = {
140
+ // answer: getAnswer(identifiers),
141
+ // instruction: getInstruction(identifiers),
142
+ // keys: getKeys(identifiers),
143
+ // answerFormat: "tex",
144
+ // identifiers,
145
+ // // hint: getHint(identifiers),
146
+ // // correction: getCorrection(identifiers),
147
+ // };
148
+ // return question;
149
+ // };
150
+ // export const equationSinOnRandomInterval: Exercise<Identifiers> = {
151
+ // id: "equationSinOnRandomInterval",
152
+ // connector: "\\iff",
153
+ // label:
154
+ // "Résoudre une équation du type $\\sin\\left(x\\right)=k$ sur un intervalle donné",
155
+ // isSingleStep: true,
156
+ // generator: (nb: number) =>
157
+ // getDistinctQuestions(getEquationSinOnRandomIntervalQuestion, nb),
158
+ // qcmTimer: 60,
159
+ // freeTimer: 60,
160
+ // getPropositions,
161
+ // isAnswerValid,
162
+ // subject: "Mathématiques",
163
+ // getQuestionFromIdentifiers,
63
164
  // };
64
- const getKeys = () => {
65
- return ["pi"];
66
- };
67
- const isAnswerValid = () => {
68
- throw Error("VEA not implemented");
69
- };
70
- const getEquationSinOnRandomIntervalQuestion = () => {
71
- const value = random(mainPositiveTrigovalues);
72
- const degree = value.degree;
73
- const leftBoundPiMultiple = randint(-3, 4);
74
- const identifiers = { degree, leftBoundPiMultiple };
75
- return getQuestionFromIdentifiers(identifiers);
76
- };
77
- const getQuestionFromIdentifiers = (identifiers) => {
78
- const question = {
79
- answer: getAnswer(identifiers),
80
- instruction: getInstruction(identifiers),
81
- keys: getKeys(identifiers),
82
- answerFormat: "tex",
83
- identifiers,
84
- // hint: getHint(identifiers),
85
- // correction: getCorrection(identifiers),
86
- };
87
- return question;
88
- };
89
- export const equationSinOnRandomInterval = {
90
- id: "equationSinOnRandomInterval",
91
- connector: "\\iff",
92
- label: "Résoudre une équation du type $\\sin\\left(x\\right)=k$ sur un intervalle donné",
93
- isSingleStep: true,
94
- generator: (nb) => getDistinctQuestions(getEquationSinOnRandomIntervalQuestion, nb),
95
- qcmTimer: 60,
96
- freeTimer: 60,
97
- getPropositions,
98
- isAnswerValid,
99
- subject: "Mathématiques",
100
- getQuestionFromIdentifiers,
101
- };
@@ -3,4 +3,7 @@ export * from "./basicEquationSin.js";
3
3
  export * from "./basicTrigoSystemEquation.js";
4
4
  export * from "./equationCosOnRandomInterval.js";
5
5
  export * from "./trigoAssociateAngle.js";
6
+ export * from "./cosInequationMainInterval.js";
7
+ export * from "./sinInequationMainInterval.js";
8
+ export * from "./readPeriodicityOnFunctionGraph.js";
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC"}
@@ -4,3 +4,6 @@ export * from "./basicTrigoSystemEquation.js";
4
4
  export * from "./equationCosOnRandomInterval.js";
5
5
  // export * from "./equationSinOnRandomInterval.js";
6
6
  export * from "./trigoAssociateAngle.js";
7
+ export * from "./cosInequationMainInterval.js";
8
+ export * from "./sinInequationMainInterval.js";
9
+ export * from "./readPeriodicityOnFunctionGraph.js";
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ axisStep?: NodeIdentifiers;
5
+ isCos: boolean;
6
+ aIds: NodeIdentifiers;
7
+ bIds: NodeIdentifiers;
8
+ cIds: NodeIdentifiers;
9
+ };
10
+ export declare const readPeriodicityOnFunctionGraph: Exercise<Identifiers>;
11
+ export {};
12
+ //# sourceMappingURL=readPeriodicityOnFunctionGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readPeriodicityOnFunctionGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAU7C,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA+IF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAuBhE,CAAC"}