math-exercises 2.2.56 → 2.2.58

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 (160) hide show
  1. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
  2. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
  3. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
  4. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  5. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  6. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  7. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
  9. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
  10. package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
  11. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
  12. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
  13. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -0
  14. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  15. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
  16. package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
  17. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts +10 -0
  18. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
  19. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
  20. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
  21. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  22. package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
  23. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
  24. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  25. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  26. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  27. package/lib/exercises/math/geometry/thales/index.js +1 -0
  28. package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
  29. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  31. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
  32. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
  34. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
  35. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
  36. package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
  37. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
  38. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
  39. package/lib/exercises/math/probaStat/binomial/binomialInequation.js +160 -0
  40. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
  41. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
  42. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
  43. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
  44. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
  45. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
  46. package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
  47. package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
  48. package/lib/exercises/math/probaStat/binomial/index.js +20 -0
  49. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
  50. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
  51. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
  52. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
  53. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
  55. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
  56. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  57. package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
  58. package/lib/exercises/math/probaStat/index.d.ts +1 -3
  59. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  60. package/lib/exercises/math/probaStat/index.js +1 -3
  61. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
  62. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  63. package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
  64. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
  65. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  66. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
  67. package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
  68. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  69. package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
  70. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  71. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
  72. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  73. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
  74. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  75. package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
  76. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
  77. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  78. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  79. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
  80. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  81. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
  82. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
  83. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  84. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
  85. package/lib/exercises/pc/mole/molarMass.js +1 -1
  86. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
  87. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  88. package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
  89. package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
  90. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  91. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  92. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  93. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  94. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  95. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
  96. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  97. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
  98. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  99. package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
  100. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  101. package/lib/exercises/utils/getDistinctQuestions.js +11 -4
  102. package/lib/index.d.ts +88 -22
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/math/geometry/CloudPoints.d.ts +5 -1
  105. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  106. package/lib/math/geometry/CloudPoints.js +5 -0
  107. package/lib/math/geometry/line.d.ts +23 -1
  108. package/lib/math/geometry/line.d.ts.map +1 -1
  109. package/lib/math/geometry/line.js +53 -2
  110. package/lib/math/geometry/point.d.ts +15 -13
  111. package/lib/math/geometry/point.d.ts.map +1 -1
  112. package/lib/math/geometry/point.js +28 -12
  113. package/lib/math/geometry/segment.d.ts +11 -1
  114. package/lib/math/geometry/segment.d.ts.map +1 -1
  115. package/lib/math/geometry/segment.js +12 -0
  116. package/lib/math/geometry/triangle.d.ts +67 -0
  117. package/lib/math/geometry/triangle.d.ts.map +1 -0
  118. package/lib/math/geometry/triangle.js +227 -0
  119. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  120. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  121. package/lib/math/numbers/rationals/rational.js +5 -0
  122. package/lib/math/polynomials/generalTrinom.d.ts +2 -2
  123. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
  124. package/lib/math/probability/binomial.d.ts +10 -0
  125. package/lib/math/probability/binomial.d.ts.map +1 -0
  126. package/lib/math/probability/binomial.js +30 -0
  127. package/lib/math/sets/intervals/intervals.d.ts +1 -1
  128. package/lib/math/systems/generalSystem.d.ts +11 -0
  129. package/lib/math/systems/generalSystem.d.ts.map +1 -0
  130. package/lib/math/systems/generalSystem.js +79 -0
  131. package/lib/playground.d.ts.map +1 -1
  132. package/lib/playground.js +1 -4
  133. package/lib/server.js +0 -2
  134. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
  135. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/inequations/inequationNode.js +1 -1
  137. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
  138. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  139. package/lib/tree/nodes/node.d.ts +2 -1
  140. package/lib/tree/nodes/node.d.ts.map +1 -1
  141. package/lib/tree/nodes/node.js +1 -0
  142. package/lib/tree/nodes/nodeConstructor.d.ts +4 -3
  143. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  144. package/lib/tree/nodes/nodeConstructor.js +4 -0
  145. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  146. package/lib/tree/nodes/operators/addNode.js +20 -8
  147. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
  148. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
  149. package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -0
  150. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  151. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  153. package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
  154. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  155. package/lib/tree/nodes/operators/operatorNode.js +1 -0
  156. package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
  157. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/sets/intervalNode.js +1 -0
  159. package/lib/utils/alea/random.d.ts.map +1 -1
  160. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
3
+ type Identifiers = {
4
+ aIdentifiers: NodeIdentifiers;
5
+ bIdentifiers: NodeIdentifiers;
6
+ cIdentifiers: NodeIdentifiers;
7
+ isAsking: string;
8
+ };
9
+ export declare const coefficientsIdentification: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=coefficientsIdentification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coefficientsIdentification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/coefficientsIdentification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coefficientsIdentification = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const rational_1 = require("../../../../math/numbers/rationals/rational");
7
+ const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
10
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
13
+ const latexParser_1 = require("../../../../tree/parsers/latexParser");
14
+ const random_1 = require("../../../../utils/alea/random");
15
+ const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
16
+ const propositions = [];
17
+ (0, exercise_1.addValidProp)(propositions, answer);
18
+ const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers));
19
+ if (answer === "1") {
20
+ (0, exercise_1.tryToAddWrongProp)(propositions, "0");
21
+ }
22
+ if (answer === "0") {
23
+ (0, exercise_1.tryToAddWrongProp)(propositions, "1");
24
+ }
25
+ if (answer === "-1") {
26
+ (0, exercise_1.tryToAddWrongProp)(propositions, "-");
27
+ }
28
+ const askedNode = isAsking === "a" ? trinom.a : isAsking === "b" ? trinom.b : trinom.c;
29
+ if ((0, fractionNode_1.isFractionNode)(askedNode)) {
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, askedNode.leftChild.toTex());
31
+ }
32
+ // si frac ajouter que le num
33
+ const monom = isAsking === "a"
34
+ ? (0, multiplyNode_1.multiply)(trinom.a, (0, powerNode_1.square)("x")).simplify()
35
+ : isAsking === "b"
36
+ ? (0, multiplyNode_1.multiply)(trinom.b, "x").simplify()
37
+ : trinom.c;
38
+ (0, exercise_1.tryToAddWrongProp)(propositions, monom.toTex());
39
+ while (propositions.length < n) {
40
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-10, 10) + "");
41
+ }
42
+ return (0, exercise_1.shuffleProps)(propositions, n);
43
+ };
44
+ const getAnswer = (identifiers) => {
45
+ const { aIdentifiers, bIdentifiers, cIdentifiers, isAsking } = identifiers;
46
+ return isAsking === "a"
47
+ ? nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers).toTex()
48
+ : isAsking === "b"
49
+ ? nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers).toTex()
50
+ : nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers).toTex();
51
+ };
52
+ const getInstruction = (identifiers) => {
53
+ const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
54
+ return `Soit $f$ la fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
55
+
56
+ $$
57
+ f(x)=${trinom
58
+ .toTree()
59
+ .simplify({
60
+ // forceDistributeFractions: true,
61
+ forbidFactorize: true,
62
+ towardsDistribute: true,
63
+ })
64
+ .toTex()}
65
+ $$
66
+
67
+ Quelle est la valeur du coefficient $${identifiers.isAsking}$ de $f$ ?`;
68
+ };
69
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
70
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
71
+ const getKeys = (identifiers) => {
72
+ return [];
73
+ };
74
+ const isAnswerValid = (ans, { answer }) => {
75
+ const parsed = (0, latexParser_1.parseAlgebraic)(ans);
76
+ if (!parsed)
77
+ return false;
78
+ return parsed.simplify().toTex() === answer;
79
+ };
80
+ const getCoefficientsIdentificationQuestion = () => {
81
+ const a = (0, random_1.random)([
82
+ (-1).toTree(),
83
+ (1).toTree(),
84
+ (0, randint_1.randint)(-10, 11, [-1, 0, 1]).toTree(),
85
+ rational_1.RationalConstructor.randomIrreductible().toTree(),
86
+ ]);
87
+ const b = (0, random_1.random)([
88
+ (-1).toTree(),
89
+ (1).toTree(),
90
+ (0).toTree(),
91
+ (0, randint_1.randint)(-10, 10, [-1, 1, 0]).toTree(),
92
+ rational_1.RationalConstructor.randomIrreductible().toTree(),
93
+ ]);
94
+ const c = (0, random_1.random)([
95
+ (0).toTree(),
96
+ (0, randint_1.randint)(-10, 11, [0]).toTree(),
97
+ rational_1.RationalConstructor.randomIrreductible().toTree(),
98
+ ]);
99
+ const isAsking = (0, random_1.random)(["a", "b", "c"]);
100
+ const identifiers = {
101
+ aIdentifiers: a.toIdentifiers(),
102
+ bIdentifiers: b.toIdentifiers(),
103
+ cIdentifiers: c.toIdentifiers(),
104
+ isAsking,
105
+ };
106
+ const question = {
107
+ answer: getAnswer(identifiers),
108
+ instruction: getInstruction(identifiers),
109
+ keys: getKeys(identifiers),
110
+ answerFormat: "tex",
111
+ identifiers,
112
+ // hint: getHint(identifiers),
113
+ // correction: getCorrection(identifiers),
114
+ };
115
+ return question;
116
+ };
117
+ exports.coefficientsIdentification = {
118
+ id: "coefficientsIdentification",
119
+ connector: "=",
120
+ label: "Reconnaître les coefficients d'un trinôme exprimé sous forme développée",
121
+ isSingleStep: true,
122
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCoefficientsIdentificationQuestion, nb),
123
+ qcmTimer: 60,
124
+ freeTimer: 60,
125
+ getPropositions,
126
+ isAnswerValid,
127
+ subject: "Mathématiques",
128
+ // getHint,
129
+ // getCorrection,
130
+ getAnswer,
131
+ };
@@ -18,4 +18,5 @@ export * from "./trinomialMeanValue";
18
18
  export * from "./solveSecondDegreeEquationByFactorisation";
19
19
  export * from "./solveSecondDegreeEquationFromCano";
20
20
  export * from "./trinomSignFromRoots";
21
+ export * from "./coefficientsIdentification";
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
@@ -34,3 +34,4 @@ __exportStar(require("./trinomialMeanValue"), exports);
34
34
  __exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
35
35
  __exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
36
36
  __exportStar(require("./trinomSignFromRoots"), exports);
37
+ __exportStar(require("./coefficientsIdentification"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"summitAbscissFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/summitAbscissFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8CF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
1
+ {"version":3,"file":"summitAbscissFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/summitAbscissFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
@@ -6,10 +6,15 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const rational_1 = require("../../../../math/numbers/rationals/rational");
7
7
  const trinom_1 = require("../../../../math/polynomials/trinom");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
+ const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const alignTex_1 = require("../../../../utils/latex/alignTex");
9
13
  const getSummitAbscissFromDevFormQuestion = () => {
10
14
  const trinom = trinom_1.TrinomConstructor.random();
11
15
  const alpha = trinom.getAlphaNode();
12
16
  const answer = alpha.toTex();
17
+ const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
13
18
  const question = {
14
19
  answer,
15
20
  instruction: `Soit $f(x) = ${trinom
@@ -17,7 +22,9 @@ const getSummitAbscissFromDevFormQuestion = () => {
17
22
  .toTex()}$ une fonction polynôme du second degré. Quelle est l'abscisse du sommet de la parabole représentant $f$ ?`,
18
23
  keys: [],
19
24
  answerFormat: "tex",
20
- identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
25
+ identifiers,
26
+ hint: getHint(identifiers),
27
+ correction: getCorrection(identifiers),
21
28
  };
22
29
  return question;
23
30
  };
@@ -31,6 +38,34 @@ const getPropositions = (n, { answer, a, b, c }) => {
31
38
  }
32
39
  return (0, exercise_1.shuffleProps)(propositions, n);
33
40
  };
41
+ const getHint = (identifiers) => {
42
+ return `L'abscisse $\\alpha$ du sommet d'une parabole s'obtient à partir de la forme développée $f(x) = ax^2 + bx +c$ via la formule :
43
+
44
+ $$
45
+ \\alpha = \\frac{-b}{2a}
46
+ $$`;
47
+ };
48
+ const getCorrection = (identifiers) => {
49
+ const { a, b, c } = identifiers;
50
+ const alpha = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(b), (0, multiplyNode_1.multiply)(2, a), {
51
+ allowMinusAnywhereInFraction: true,
52
+ });
53
+ return `On sait que l'abscisse $\\alpha$ du sommet de la parabole vaut :
54
+
55
+ $$
56
+ \\alpha = \\frac{-b}{2a}
57
+ $$
58
+
59
+ Ici, $a=${a}$ et $b=${b}$.
60
+
61
+ Donc,
62
+
63
+ ${(0, alignTex_1.alignTex)([
64
+ ["\\alpha", "=", alpha.toTex()],
65
+ ["", "=", alpha.simplify().toTex()],
66
+ ])}
67
+ `;
68
+ };
34
69
  const isAnswerValid = (ans, { a, b, c }) => {
35
70
  const node = new rational_1.Rational(-b, 2 * a).simplify().toTree();
36
71
  const texs = node.toAllValidTexs({
@@ -51,5 +86,8 @@ exports.summitAbscissFromDevForm = {
51
86
  freeTimer: 60,
52
87
  getPropositions,
53
88
  isAnswerValid,
89
+ hasHintAndCorrection: true,
90
+ getHint,
91
+ getCorrection,
54
92
  subject: "Mathématiques",
55
93
  };
@@ -4,7 +4,7 @@ exports.rightTriangleArea = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
- const triangles_1 = require("../../../../math/geometry/triangles");
7
+ const triangle_1 = require("../../../../math/geometry/triangle");
8
8
  const rational_1 = require("../../../../math/numbers/rationals/rational");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
10
  const shuffle_1 = require("../../../../utils/alea/shuffle");
@@ -13,7 +13,7 @@ const getRightTriangleArea = () => {
13
13
  const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
14
14
  for (let i = 0; i < 3; i++)
15
15
  vertices.push(String.fromCharCode(code + i));
16
- const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({
16
+ const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
17
17
  minRapport: 0.4,
18
18
  maxRapport: 1.6,
19
19
  names: vertices,
@@ -4,7 +4,7 @@ exports.triangleArea = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
- const triangles_1 = require("../../../../math/geometry/triangles");
7
+ const triangle_1 = require("../../../../math/geometry/triangle");
8
8
  const rational_1 = require("../../../../math/numbers/rationals/rational");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
10
  const randomLetter_1 = require("../../../../utils/strings/randomLetter");
@@ -14,7 +14,7 @@ const getTriangleArea = () => {
14
14
  const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
15
15
  for (let i = 0; i < 3; i++)
16
16
  vertices.push(String.fromCharCode(code + i));
17
- const triangle = triangles_1.TriangleConstructor.createRandomTriangle({
17
+ const triangle = triangle_1.TriangleConstructor.createRandomTriangle({
18
18
  minAngle: 0.69,
19
19
  maxAngle: 1.5,
20
20
  names: vertices,
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ lengths: number[];
4
+ };
5
+ export declare const buildTriangleWithSizes: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=buildTriangleWithSizes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTriangleWithSizes.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAuGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTriangleWithSizes = void 0;
4
+ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
+ const ggbPointToCoords_1 = require("../../../../geogebra/parsers/ggbPointToCoords");
8
+ const parseGGBPoints_1 = require("../../../../geogebra/parsers/parseGGBPoints");
9
+ const point_1 = require("../../../../math/geometry/point");
10
+ const segment_1 = require("../../../../math/geometry/segment");
11
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
12
+ const round_1 = require("../../../../math/utils/round");
13
+ const arrayEqual_1 = require("../../../../utils/arrays/arrayEqual");
14
+ const getInstruction = (identifiers) => {
15
+ return `Construire un triangle dont les côtés mesurent $${identifiers.lengths[0].frenchify()}$ cm, $${identifiers.lengths[1].frenchify()}$ cm et $${identifiers.lengths[2].frenchify()}$ cm.`;
16
+ };
17
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
18
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
19
+ const getGGBAnswer = (identifiers) => {
20
+ return [
21
+ `A=(0,0)`,
22
+ `B=Point(Circle(A,${identifiers.lengths[0]}))`,
23
+ `C_1 = Circle(B,${identifiers.lengths[1]})`,
24
+ `C_2 = Circle(A,${identifiers.lengths[2]})`,
25
+ `C = Intersect(C_1,C_2,1)`,
26
+ `Polygon(A,B,C)`,
27
+ ];
28
+ };
29
+ const getStudentGGBOptions = (identifiers) => {
30
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
31
+ commands: [],
32
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
33
+ point: true,
34
+ intersect: true,
35
+ circleRadius: true,
36
+ // circleTwoPoints: true,
37
+ // segment: true,
38
+ segmentFixed: true,
39
+ polygon: true,
40
+ }),
41
+ hideAxes: true,
42
+ hideGrid: true,
43
+ });
44
+ return ggb.getOptions({
45
+ coords: [-8, 8, -8, 8],
46
+ });
47
+ };
48
+ const isGGBAnswerValid = (ans, { ggbAnswer, lengths }) => {
49
+ let points = [];
50
+ const polygone = ans.find((c) => c.includes("Polygon"));
51
+ if (polygone) {
52
+ const names = polygone
53
+ .split("=")[1]
54
+ .replace("(", "")
55
+ .replace(")", "")
56
+ .replace("[", "")
57
+ .replace("]", "")
58
+ .replace("Polygon", "")
59
+ .replaceAll(" ", "")
60
+ .split(",");
61
+ points = names.map((n) => {
62
+ const command = ans.find((c) => c.startsWith(n + "="));
63
+ if (!command)
64
+ throw Error("Point not found");
65
+ return (0, ggbPointToCoords_1.ggbPointToCoords)(command.split("=")[1]);
66
+ });
67
+ }
68
+ else {
69
+ points = (0, parseGGBPoints_1.parseGGBPoints)(ans).map((c) => (0, ggbPointToCoords_1.ggbPointToCoords)(c));
70
+ }
71
+ if (points.length !== 3) {
72
+ return false;
73
+ }
74
+ const pointsNode = points.map((p, i) => new point_1.Point("P" + i, p.x.toTree(), p.y.toTree()));
75
+ const lengthsAns = pointsNode
76
+ .map((p, i) => new segment_1.Segment(p, pointsNode[(i + 1) % 3]))
77
+ .map((s) => (0, round_1.round)(s.getLength(), 1))
78
+ .sort((a, b) => a - b);
79
+ const sortedExpected = lengths.sort((a, b) => a - b);
80
+ return (0, arrayEqual_1.arrayEqual)(lengthsAns, sortedExpected);
81
+ };
82
+ const getBuildTriangleWithSizesQuestion = () => {
83
+ const lengths = [];
84
+ let a, b, c;
85
+ do {
86
+ a = (0, randfloat_1.randfloat)(1, 10, 1);
87
+ b = (0, randfloat_1.randfloat)(1, 10, 1);
88
+ c = (0, randfloat_1.randfloat)(1, 10, 1);
89
+ } while (a + b < c || a + c < b || b + c < a);
90
+ lengths.push(a, b, c);
91
+ const identifiers = {
92
+ lengths,
93
+ };
94
+ const question = {
95
+ ggbAnswer: getGGBAnswer(identifiers),
96
+ instruction: getInstruction(identifiers),
97
+ studentGgbOptions: getStudentGGBOptions(identifiers),
98
+ identifiers,
99
+ // hint: getHint(identifiers),
100
+ // correction: getCorrection(identifiers),
101
+ };
102
+ return question;
103
+ };
104
+ exports.buildTriangleWithSizes = {
105
+ id: "buildTriangleWithSizes",
106
+ label: "Construire un triangle en connaissant les longueurs de ses côtés",
107
+ isSingleStep: true,
108
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBuildTriangleWithSizesQuestion, nb),
109
+ ggbTimer: 60,
110
+ isGGBAnswerValid,
111
+ subject: "Mathématiques",
112
+ // getHint,
113
+ // getCorrection,
114
+ getGGBAnswer,
115
+ getStudentGGBOptions,
116
+ answerType: "GGB",
117
+ };
@@ -1,2 +1,4 @@
1
1
  export * from "./buildMediatriceWithCompass";
2
+ export * from "./buildTriangleWithSizes";
3
+ export * from "./pointImageFromTranslation";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./buildMediatriceWithCompass"), exports);
18
+ __exportStar(require("./buildTriangleWithSizes"), exports);
19
+ __exportStar(require("./pointImageFromTranslation"), exports);
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point";
3
+ type Identifiers = {
4
+ points: PointIdentifiers[];
5
+ startPoint: string;
6
+ translationPoints: string[];
7
+ };
8
+ export declare const pointImageFromTranslation: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=pointImageFromTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAgHF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pointImageFromTranslation = void 0;
4
+ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
+ const approxEqual_1 = require("../../../../geogebra/parsers/approxEqual");
8
+ const ggbPointToCoords_1 = require("../../../../geogebra/parsers/ggbPointToCoords");
9
+ const point_1 = require("../../../../math/geometry/point");
10
+ const vector_1 = require("../../../../math/geometry/vector");
11
+ const random_1 = require("../../../../utils/alea/random");
12
+ const doWhile_1 = require("../../../../utils/doWhile");
13
+ const getInstruction = (identifiers) => {
14
+ return `Placer l'image du point $${identifiers.startPoint}$ par la translation qui transforme $${identifiers.translationPoints[0]}$ en $${identifiers.translationPoints[1]}$.`;
15
+ };
16
+ const getEndPoint = (identifiers) => {
17
+ const translationPoints = [
18
+ point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.translationPoints[0])),
19
+ point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.translationPoints[1])),
20
+ ];
21
+ const vector = vector_1.VectorConstructor.fromPoints(translationPoints[0], translationPoints[1]);
22
+ const startPoint = point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.startPoint));
23
+ const end = vector.getEndPoint(startPoint, "M");
24
+ return end;
25
+ };
26
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
27
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
28
+ const getGGBAnswer = (identifiers) => {
29
+ return getEndPoint(identifiers).toGGBCommand();
30
+ };
31
+ const getStudentGGBOptions = (identifiers) => {
32
+ const points = identifiers.points.map((p) => point_1.PointConstructor.fromIdentifiers(p));
33
+ const end = getEndPoint(identifiers);
34
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
35
+ hideAxes: true,
36
+ isGridSimple: true,
37
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({ point: true }),
38
+ commands: points.flatMap((p) => p.toGGBCommand({
39
+ size: 3,
40
+ style: 1,
41
+ })),
42
+ });
43
+ const [endX, endY] = [end.x.evaluate(), end.y.evaluate()];
44
+ return ggb.getOptions({
45
+ coords: [
46
+ Math.min(endX - 2, -7),
47
+ Math.max(endX + 2, 7),
48
+ Math.min(endY - 2, -7),
49
+ Math.max(endY + 2, 7),
50
+ ],
51
+ });
52
+ };
53
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
54
+ const studentAns = ans.filter((c) => !["A", "B", "C", "D"].includes(c[0]));
55
+ if (studentAns.length !== 1)
56
+ return false;
57
+ const coords = (0, ggbPointToCoords_1.ggbPointToCoords)(studentAns[0].split("=")[1]);
58
+ const coordsAns = (0, ggbPointToCoords_1.ggbPointToCoords)(ggbAnswer[0].split("=")[1]);
59
+ return ((0, approxEqual_1.approxEqual)(coords.x, coordsAns.x, 0.2) &&
60
+ (0, approxEqual_1.approxEqual)(coords.y, coordsAns.y, 0.2));
61
+ };
62
+ const getPointImageFromTranslationQuestion = () => {
63
+ const points = [];
64
+ for (let i = 0; i < 4; i++) {
65
+ const name = String.fromCharCode(65 + i);
66
+ const newPoint = (0, doWhile_1.doWhile)(() => point_1.PointConstructor.random(name, -4, 5), (p) => points.some((p2) => p.equals(p2)));
67
+ points.push(newPoint);
68
+ }
69
+ const startPoint = (0, random_1.random)(points).name;
70
+ const translationPoints = [
71
+ (0, random_1.random)(points.filter((p) => p.name !== startPoint)).name,
72
+ ];
73
+ translationPoints.push((0, random_1.random)(points.filter((p) => p.name !== translationPoints[0])).name);
74
+ const identifiers = {
75
+ points: points.map((p) => p.toIdentifiers()),
76
+ startPoint,
77
+ translationPoints,
78
+ };
79
+ const question = {
80
+ ggbAnswer: getGGBAnswer(identifiers),
81
+ instruction: getInstruction(identifiers),
82
+ studentGgbOptions: getStudentGGBOptions(identifiers),
83
+ identifiers,
84
+ // hint: getHint(identifiers),
85
+ // correction: getCorrection(identifiers),
86
+ };
87
+ return question;
88
+ };
89
+ exports.pointImageFromTranslation = {
90
+ id: "pointImageFromTranslation",
91
+ label: "Placer l'image d'un point par une translation",
92
+ isSingleStep: true,
93
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPointImageFromTranslationQuestion, nb),
94
+ ggbTimer: 60,
95
+ isGGBAnswerValid,
96
+ subject: "Mathématiques",
97
+ // getHint,
98
+ // getCorrection,
99
+ getGGBAnswer,
100
+ getStudentGGBOptions,
101
+ answerType: "GGB",
102
+ };
@@ -1,8 +1,10 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
2
3
  type Identifiers = {
3
4
  sideA: string;
4
5
  sideB: string;
5
6
  sideC: string;
7
+ triangleIdentifiers: TriangleIdentifiers;
6
8
  };
7
9
  export declare const pythagore: Exercise<Identifiers>;
8
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
1
+ {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAStC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAiEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pythagore = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
- const triangles_1 = require("../../../../math/geometry/triangles");
6
+ const triangle_1 = require("../../../../math/geometry/triangle");
7
7
  const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const lengthNode_1 = require("../../../../tree/nodes/geometry/lengthNode");
9
9
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
@@ -15,7 +15,7 @@ const getPythagore = () => {
15
15
  const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
16
16
  for (let i = 0; i < 3; i++)
17
17
  vertices.push(String.fromCharCode(code + i));
18
- const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({
18
+ const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
19
19
  minRapport: 0.7,
20
20
  maxRapport: 1.3,
21
21
  names: vertices,
@@ -23,6 +23,7 @@ const getPythagore = () => {
23
23
  const sideA = triangle.getSideAName();
24
24
  const sideB = triangle.getSideBName();
25
25
  const sideC = triangle.getSideCName();
26
+ const triangleIdentifiers = triangle.toIdentifiers();
26
27
  const ggb = new geogebraConstructor_1.GeogebraConstructor({
27
28
  commands: triangle.generateCommands({}),
28
29
  hideAxes: true,
@@ -37,7 +38,7 @@ const getPythagore = () => {
37
38
  coords: triangle.generateCoords(),
38
39
  }),
39
40
  answerFormat: "tex",
40
- identifiers: { sideA, sideB, sideC },
41
+ identifiers: { sideA, sideB, sideC, triangleIdentifiers },
41
42
  };
42
43
  return question;
43
44
  };
@@ -1,7 +1,9 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
2
3
  type Identifiers = {
3
4
  square: number;
4
5
  sideLengths: number[];
6
+ triangleIdentifiers: TriangleIdentifiers;
5
7
  };
6
8
  export declare const pythagoreCalcul: Exercise<Identifiers>;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAmGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
1
+ {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}