math-exercises 3.0.52 → 3.0.54

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 (238) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +0 -2
  3. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +0 -2
  5. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +0 -2
  7. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSum.js +0 -2
  9. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +3 -17
  11. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +0 -12
  13. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +0 -13
  15. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +0 -2
  17. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +8 -3
  18. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +53 -30
  20. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/equation/equa4.js +0 -2
  22. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +3 -0
  24. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +4 -4
  26. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -2
  28. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  29. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +0 -2
  30. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +2 -2
  31. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +52 -25
  33. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts +2 -2
  34. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  35. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +50 -33
  36. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +2 -1
  37. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +37 -17
  39. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  40. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +0 -2
  41. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/affines/affineExpressionReading.js +3 -2
  43. package/lib/exercises/math/functions/affines/interceptReading.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/affines/interceptReading.js +47 -18
  45. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.js +46 -13
  47. package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/angles/recognizeAngleType.js +33 -12
  49. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/areas/circleArea.js +45 -2
  51. package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/areas/squareArea.js +40 -7
  53. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +52 -7
  56. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts +9 -0
  57. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts.map +1 -0
  58. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +162 -0
  59. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts +10 -0
  60. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts.map +1 -0
  61. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +161 -0
  62. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts +4 -2
  63. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
  64. package/lib/exercises/math/geometry/cartesian/directionVector.js +110 -79
  65. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
  66. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +55 -11
  67. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  68. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +18 -2
  69. package/lib/exercises/math/geometry/cartesian/index.d.ts +2 -0
  70. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/cartesian/index.js +2 -0
  72. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +0 -2
  74. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +0 -2
  76. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
  77. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +0 -2
  78. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts +9 -0
  79. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts.map +1 -0
  80. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.js +108 -0
  81. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  82. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +20 -1
  83. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts +9 -0
  84. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -0
  85. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +115 -0
  86. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts +9 -0
  87. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts.map +1 -0
  88. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +122 -0
  89. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts +9 -0
  90. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts.map +1 -0
  91. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.js +121 -0
  92. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts +10 -0
  93. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -0
  94. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +124 -0
  95. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts +10 -0
  96. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts.map +1 -0
  97. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +123 -0
  98. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts +12 -0
  99. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +130 -0
  101. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts +10 -0
  102. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +109 -0
  104. package/lib/exercises/math/geometry/lines/index.d.ts +10 -0
  105. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/lines/index.js +10 -0
  107. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts +10 -0
  108. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/lines/reductEquationFindY.js +105 -0
  110. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts +10 -0
  111. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.js +149 -0
  113. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts +8 -0
  114. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/lines/reductEquationReading.js +142 -0
  116. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  117. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +58 -9
  118. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
  119. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +39 -6
  120. package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
  121. package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +40 -7
  122. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.d.ts.map +1 -1
  123. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +34 -7
  124. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/pythagore/pythagore.js +51 -15
  126. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  127. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +109 -19
  128. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/thales/thales.js +36 -5
  130. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/triangles/triangleNature.js +45 -14
  132. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.d.ts.map +1 -1
  133. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +78 -15
  134. package/lib/exercises/math/geometry/vectors/colinearity.d.ts +5 -4
  135. package/lib/exercises/math/geometry/vectors/colinearity.d.ts.map +1 -1
  136. package/lib/exercises/math/geometry/vectors/colinearity.js +82 -21
  137. package/lib/exercises/math/geometry/vectors/determinant.js +1 -1
  138. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +2 -0
  139. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -0
  140. package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +92 -0
  141. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.d.ts.map +1 -1
  142. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +117 -76
  143. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +1 -1
  144. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  145. package/lib/exercises/math/powers/calculateNegativePower.js +0 -2
  146. package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
  147. package/lib/exercises/math/powers/calculatePower.js +63 -8
  148. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  149. package/lib/exercises/math/powers/decimalToScientific.js +0 -15
  150. package/lib/exercises/math/powers/powerDefinition.d.ts.map +1 -1
  151. package/lib/exercises/math/powers/powerDefinition.js +39 -8
  152. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  153. package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -1
  154. package/lib/exercises/math/powers/powersPower.d.ts +5 -2
  155. package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
  156. package/lib/exercises/math/powers/powersPower.js +59 -28
  157. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  158. package/lib/exercises/math/powers/scientificToDecimal.js +0 -15
  159. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  160. package/lib/exercises/math/probaStat/index.d.ts +1 -0
  161. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  162. package/lib/exercises/math/probaStat/index.js +1 -0
  163. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +5 -0
  164. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -0
  165. package/lib/exercises/math/probaStat/randomVariable/index.js +4 -0
  166. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts +10 -0
  167. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -0
  168. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +81 -0
  169. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts +9 -0
  170. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts.map +1 -0
  171. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +95 -0
  172. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts +9 -0
  173. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts.map +1 -0
  174. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +106 -0
  175. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts +9 -0
  176. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts.map +1 -0
  177. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +105 -0
  178. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
  179. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +21 -0
  180. package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  181. package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
  182. package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
  183. package/lib/exercises/math/trigonometry/remarkableValues.js +3 -0
  184. package/lib/index.d.ts +76 -15
  185. package/lib/index.d.ts.map +1 -1
  186. package/lib/math/geometry/angle.d.ts.map +1 -1
  187. package/lib/math/geometry/angle.js +12 -7
  188. package/lib/math/geometry/line.d.ts +5 -10
  189. package/lib/math/geometry/line.d.ts.map +1 -1
  190. package/lib/math/geometry/line.js +71 -37
  191. package/lib/math/geometry/point.d.ts +2 -1
  192. package/lib/math/geometry/point.d.ts.map +1 -1
  193. package/lib/math/geometry/point.js +3 -0
  194. package/lib/math/geometry/segment.js +1 -1
  195. package/lib/math/geometry/triangles/triangle.d.ts.map +1 -1
  196. package/lib/math/geometry/triangles/triangle.js +11 -11
  197. package/lib/math/geometry/vector.d.ts +6 -0
  198. package/lib/math/geometry/vector.d.ts.map +1 -1
  199. package/lib/math/geometry/vector.js +30 -4
  200. package/lib/math/probability/randomVariable.d.ts +15 -0
  201. package/lib/math/probability/randomVariable.d.ts.map +1 -0
  202. package/lib/math/probability/randomVariable.js +56 -0
  203. package/lib/math/systems/generalSystem.d.ts +12 -1
  204. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  205. package/lib/math/systems/generalSystem.js +92 -55
  206. package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
  207. package/lib/math/trigonometry/remarkableValue.js +1 -1
  208. package/lib/playground.d.ts.map +1 -1
  209. package/lib/playground.js +1 -8
  210. package/lib/server.js +1 -1
  211. package/lib/tree/nodes/algebraicNode.d.ts +0 -1
  212. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  213. package/lib/tree/nodes/equations/equalNode.d.ts +3 -3
  214. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  215. package/lib/tree/nodes/equations/equalNode.js +3 -3
  216. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  217. package/lib/tree/nodes/functions/cosNode.js +11 -5
  218. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  219. package/lib/tree/nodes/functions/sinNode.js +11 -5
  220. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  221. package/lib/tree/nodes/functions/tanNode.js +11 -5
  222. package/lib/tree/nodes/node.d.ts +9 -8
  223. package/lib/tree/nodes/node.d.ts.map +1 -1
  224. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  225. package/lib/tree/nodes/nodeConstructor.js +1 -1
  226. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  227. package/lib/tree/nodes/numbers/numberNode.js +6 -2
  228. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +2 -1
  229. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  230. package/lib/tree/nodes/operators/binomialCoefficientNode.js +7 -2
  231. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  232. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  233. package/lib/tree/nodes/operators/powerNode.d.ts +4 -4
  234. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  235. package/lib/tree/nodes/operators/powerNode.js +5 -5
  236. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  237. package/lib/tree/parsers/latexParser.js +6 -0
  238. package/package.json +1 -1
@@ -2,19 +2,52 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../../math/utils/random/randint.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
- const getSquareArea = () => {
6
- const side = randint(1, 21);
5
+ const getInstruction = (identifiers) => {
6
+ const { side } = identifiers;
7
+ return `Calculer l'aire d'un carré de $${side}$ cm de côté.`;
8
+ };
9
+ const getAnswer = (identifiers) => {
10
+ const { side } = identifiers;
7
11
  const answer = side ** 2 + "";
8
12
  const answerTex = answer + "\\text{cm}^2";
13
+ return answerTex;
14
+ };
15
+ const getHint = (identifiers) => {
16
+ return `L'aire d'un carré s'obtient en multipliant la longueur d'un côté par elle-même.`;
17
+ };
18
+ const getCorrection = (identifiers) => {
19
+ const { side } = identifiers;
20
+ return `L'aire d'un carré de côté $c$ est :
21
+
22
+ $$
23
+ A = c\\times c
24
+ $$
25
+
26
+ Ici, on a $c = ${side}$ cm.
27
+
28
+ L'aire du carré vaut donc :
29
+
30
+ $$
31
+ A = ${side}\\times${side} = ${getAnswer(identifiers)}
32
+ $$`;
33
+ };
34
+ const getQuestionFromIdentifiers = (identifiers) => {
9
35
  const question = {
10
- instruction: `Calculer l'aire d'un carré de $${side}$ cm de côté.`,
11
- answer: answerTex,
36
+ instruction: getInstruction(identifiers),
37
+ answer: getAnswer(identifiers),
12
38
  answerFormat: "tex",
13
39
  keys: ["cm", "cm2"],
14
- identifiers: { side },
40
+ identifiers,
41
+ hint: getHint(identifiers),
42
+ correction: getCorrection(identifiers),
15
43
  };
16
44
  return question;
17
45
  };
46
+ const getSquareArea = () => {
47
+ const side = randint(1, 21);
48
+ const identifiers = { side };
49
+ return getQuestionFromIdentifiers(identifiers);
50
+ };
18
51
  const getPropositions = (n, { answer }) => {
19
52
  const propositions = [];
20
53
  addValidProp(propositions, answer);
@@ -31,9 +64,7 @@ export const squareArea = {
31
64
  id: "squareArea",
32
65
  connector: "=",
33
66
  label: "Calculer l'aire d'un carré",
34
- levels: ["4ème", "3ème", "2nde"],
35
67
  isSingleStep: false,
36
- sections: ["Aires", "Géométrie euclidienne"],
37
68
  generator: (nb) => getDistinctQuestions(getSquareArea, nb, 20),
38
69
  qcmTimer: 60,
39
70
  freeTimer: 60,
@@ -41,4 +72,6 @@ export const squareArea = {
41
72
  getPropositions,
42
73
  isAnswerValid,
43
74
  subject: "Mathématiques",
75
+ getQuestionFromIdentifiers,
76
+ hasHintAndCorrection: true,
44
77
  };
@@ -1 +1 @@
1
- {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AASnD,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAOnD,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA4GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA0KF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAazD,CAAC"}
1
+ {"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyNF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
@@ -3,12 +3,13 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Line } from "../../../../math/geometry/line.js";
5
5
  import { Point } from "../../../../math/geometry/point.js";
6
- import { Vector } from "../../../../math/geometry/vector.js";
6
+ import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
7
7
  import { randint } from "../../../../math/utils/random/randint.js";
8
8
  import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
9
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
9
10
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
10
- import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
11
- import { MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
11
+ import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
12
+ import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
12
13
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
13
14
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
14
15
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
@@ -24,6 +25,43 @@ const getAnswer = (identifiers) => {
24
25
  const correctAnswer = line.getCartesianEquation();
25
26
  return correctAnswer.toTex();
26
27
  };
28
+ const getHint = (identifiers) => {
29
+ return `Détermine un vecteur directeur de $d$. Cela permet de trouver les coefficients $a$ et $b$ dans l'équation cartésienne $ax+by+c=0$. Puis, utilise un point appartenant à $d$ pour obtenir $c$. `;
30
+ };
31
+ const getCorrection = (identifiers) => {
32
+ const { aX, aY, bX, bY } = identifiers;
33
+ const A = new Point("A", aX, aY);
34
+ const B = new Point("B", bX, bY);
35
+ const vec = VectorConstructor.fromPoints(A, B);
36
+ const partial = add(multiply(opposite(vec.y), "x"), multiply(vec.x, "y")).simplify({
37
+ forbidFactorize: true,
38
+ });
39
+ const partialEv = partial.toDetailedEvaluation({ x: A.x, y: A.y });
40
+ const partialEvSimp = partialEv.simplify();
41
+ const c = opposite(partialEvSimp).simplify();
42
+ return `On lit graphiquement que la droite passe par les points $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. On en déduit qu'un vecteur directeur de $d$ est $${vec.toTexWithCoords()}$.
43
+
44
+ Une équation cartésienne de $d$ est donc de la forme :
45
+
46
+ $$
47
+ ${partial.toTex()}+c = 0
48
+ $$
49
+
50
+ Pour déterminer $c$, on utilise le fait que le point $${A.toTexWithCoords()}$ appartient à $d$ :
51
+
52
+ $$
53
+ ${partialEv.toTex()}+c = 0
54
+ $$
55
+
56
+ ce qui donne $c=${c.toTex()}$.
57
+
58
+ Ainsi, une équation cartésienne de $d$ est :
59
+
60
+ $$
61
+ ${getAnswer(identifiers)}
62
+ $$
63
+ `;
64
+ };
27
65
  const getGGBOptions = (identifiers) => {
28
66
  const { aX, aY, bX, bY } = identifiers;
29
67
  const a = new Point("a", aX, aY);
@@ -40,10 +78,14 @@ const getGGBOptions = (identifiers) => {
40
78
  });
41
79
  };
42
80
  const getCartesianEquationOfLineQuestion = () => {
43
- const aX = randint(-5, 6);
44
- const aY = randint(-5, 6);
45
- const bX = randint(-5, 6, [aX]);
46
- const bY = randint(-5, 6, [aY]);
81
+ let aX = randint(-5, 6);
82
+ let aY = randint(-5, 6);
83
+ let bX = randint(-5, 6, [aX]);
84
+ let bY = randint(-5, 6, [aY]);
85
+ if (aX > bX) {
86
+ [aX, bX] = [bX, aX];
87
+ [aY, bY] = [bY, aY];
88
+ }
47
89
  const identifiers = { aX, aY, bX, bY };
48
90
  return getQuestionFromIdentifiers(identifiers);
49
91
  };
@@ -55,6 +97,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
55
97
  keys: ["x", "y", "equal"],
56
98
  answerFormat: "tex",
57
99
  identifiers,
100
+ // hint: getHint(identifiers),
101
+ // correction: getCorrection(identifiers),
58
102
  };
59
103
  return question;
60
104
  };
@@ -135,5 +179,6 @@ export const cartesianEquationOfLine = {
135
179
  isAnswerValid,
136
180
  hasGeogebra: true,
137
181
  subject: "Mathématiques",
182
+ // hasHintAndCorrection: true,
138
183
  getQuestionFromIdentifiers,
139
184
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ type Identifiers = {
4
+ pointIdentifiers: PointIdentifiers;
5
+ pointBIdentifiers: PointIdentifiers;
6
+ };
7
+ export declare const cartesianFromTwoPoints: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=cartesianFromTwoPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cartesianFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAoBtC,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iBAAiB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AA2JF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
@@ -0,0 +1,162 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Line, LineConstructor } from "../../../../math/geometry/line.js";
4
+ import { PointConstructor, } from "../../../../math/geometry/point.js";
5
+ import { Vector, VectorConstructor, } from "../../../../math/geometry/vector.js";
6
+ import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
7
+ import { isEqualNode, } from "../../../../tree/nodes/equations/equalNode.js";
8
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
9
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
10
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
11
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
12
+ import { parseLatex } from "../../../../tree/parsers/latexParser.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ const getPropositions = (n, { answer }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ while (propositions.length < n) {
18
+ const line = LineConstructor.random();
19
+ tryToAddWrongProp(propositions, line.getCartesianEquation().toTex());
20
+ }
21
+ return shuffleProps(propositions, n);
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { pointBIdentifiers, pointIdentifiers } = identifiers;
25
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
26
+ const pointB = PointConstructor.fromIdentifiers(pointBIdentifiers);
27
+ const line = new Line(point, pointB);
28
+ return line.getCartesianEquation().toTex();
29
+ };
30
+ const getInstruction = (identifiers) => {
31
+ const { pointBIdentifiers, pointIdentifiers } = identifiers;
32
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
33
+ const pointB = PointConstructor.fromIdentifiers(pointBIdentifiers);
34
+ return `Soit $d$ une droite passant par les points $${point.toTexWithCoords()}$ et $${pointB.toTexWithCoords()}$.
35
+
36
+ Déterminer une équation cartésienne de $d$.`;
37
+ };
38
+ const getHint = (identifiers) => {
39
+ const genVec = new Vector("u", opposite("b"), new VariableNode("a"));
40
+ return `Une droite de vecteur directeur $${genVec.toTexWithCoords()}$ admet une équation cartésienne de la forme :
41
+
42
+ $$
43
+ ax+by+c = 0
44
+ $$
45
+
46
+ On remarque que $\\overrightarrow{AB}$ est un vecteur directeur de $d$.
47
+
48
+ Puis, on peut ensuite utiliser les coordonnées d'un point de la droite pour déterminer $c$.`;
49
+ };
50
+ const getCorrection = (identifiers) => {
51
+ const { pointBIdentifiers, pointIdentifiers } = identifiers;
52
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
53
+ const pointB = PointConstructor.fromIdentifiers(pointBIdentifiers);
54
+ const vector = VectorConstructor.fromPoints(point, pointB);
55
+ const nonCEq = add(add(multiply(vector.y, "x"), multiply(opposite(vector.x), "y")), "c").simplify({
56
+ forbidFactorize: true,
57
+ });
58
+ const line = LineConstructor.fromPointAndVector(point, vector);
59
+ const [a, b, c] = line.toCartesianCoeffs();
60
+ const [aEv, bEv, cEv] = [a.evaluate(), b.evaluate(), c.evaluate()];
61
+ const allNeg = aEv < 0 && bEv < 0 && cEv < 0;
62
+ const pgcd = gcd(aEv, bEv, cEv);
63
+ const hasSimplified = allNeg || pgcd !== 1;
64
+ return `Puisque $${vector.toTexWithCoords()}$ est un vecteur directeur de $d$, cette dernière admet une équation cartésienne de la forme :
65
+
66
+ $$
67
+ ${nonCEq.toTex()}=0
68
+ $$
69
+
70
+ Pour déterminer $c$, on peut ensuite utiliser le fait que le point $${point.toTexWithCoords()}$ appartient à $d$ :
71
+
72
+ $$
73
+ ${nonCEq.toDetailedEvaluation({ x: point.x, y: point.y }).toTex()}=0
74
+ $$
75
+
76
+ On en déduit que $c=${c.simplify().toTex()}$.
77
+
78
+ Ainsi, une équation cartésienne de $d$ est :
79
+
80
+ $$
81
+ ${add(add(multiply(a, "x"), multiply(b, "y")), c)
82
+ .simplify({
83
+ forbidFactorize: true,
84
+ })
85
+ .toTex()}=0
86
+ $$
87
+
88
+ ${hasSimplified
89
+ ? `On peut alors simplifier cette équation en la divisant par $${allNeg ? opposite(pgcd).toTex() : pgcd}$ :
90
+
91
+ $$
92
+ ${getAnswer(identifiers)}
93
+ $$`
94
+ : ""}
95
+ `;
96
+ };
97
+ const getKeys = (identifiers) => {
98
+ return ["x", "y", "equal"];
99
+ };
100
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
101
+ try {
102
+ const parsed = parseLatex(ans);
103
+ if (!isEqualNode(parsed))
104
+ return false;
105
+ const { pointBIdentifiers, pointIdentifiers } = identifiers;
106
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
107
+ const pointB = PointConstructor.fromIdentifiers(pointBIdentifiers);
108
+ return (parsed.leftChild
109
+ .toDetailedEvaluation({
110
+ x: point.x,
111
+ y: point.y,
112
+ })
113
+ .simplify()
114
+ .toTex() === "0" &&
115
+ parsed.leftChild
116
+ .toDetailedEvaluation({
117
+ x: pointB.x,
118
+ y: pointB.y,
119
+ })
120
+ .simplify()
121
+ .toTex() === "0");
122
+ }
123
+ catch (err) {
124
+ return handleVEAError(err);
125
+ }
126
+ };
127
+ const getCartesianFromTwoPointsQuestion = (ops) => {
128
+ const points = PointConstructor.randomDifferent(2, { names: ["A", "B"] });
129
+ const identifiers = {
130
+ pointIdentifiers: points[0].toIdentifiers(),
131
+ pointBIdentifiers: points[1].toIdentifiers(),
132
+ };
133
+ return getQuestionFromIdentifiers(identifiers);
134
+ };
135
+ const getQuestionFromIdentifiers = (identifiers) => {
136
+ return {
137
+ answer: getAnswer(identifiers),
138
+ instruction: getInstruction(identifiers),
139
+ keys: getKeys(identifiers),
140
+ answerFormat: "tex",
141
+ identifiers,
142
+ hint: getHint(identifiers),
143
+ correction: getCorrection(identifiers),
144
+ };
145
+ };
146
+ export const cartesianFromTwoPoints = {
147
+ id: "cartesianFromTwoPoints",
148
+ label: "Déterminer l'équation cartésienne d'une droite en connaissant deux points",
149
+ isSingleStep: true,
150
+ generator: (nb, opts) => getDistinctQuestions(() => getCartesianFromTwoPointsQuestion(opts), nb),
151
+ qcmTimer: 60,
152
+ freeTimer: 60,
153
+ getPropositions,
154
+ isAnswerValid,
155
+ subject: "Mathématiques",
156
+ getInstruction,
157
+ getHint,
158
+ getCorrection,
159
+ getAnswer,
160
+ getQuestionFromIdentifiers,
161
+ hasHintAndCorrection: true,
162
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ import { VectorIdentifiers } from "../../../../math/geometry/vector.js";
4
+ type Identifiers = {
5
+ vectorIdentifiers: VectorIdentifiers;
6
+ pointIdentifiers: PointIdentifiers;
7
+ };
8
+ export declare const cartesianFromVectorAndPoint: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=cartesianFromVectorAndPoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cartesianFromVectorAndPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAevC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAuJF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAqB7D,CAAC"}
@@ -0,0 +1,161 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { LineConstructor } from "../../../../math/geometry/line.js";
4
+ import { PointConstructor, } from "../../../../math/geometry/point.js";
5
+ import { Vector, VectorConstructor, } from "../../../../math/geometry/vector.js";
6
+ import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
7
+ import { isEqualNode, } from "../../../../tree/nodes/equations/equalNode.js";
8
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
9
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
10
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
11
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
12
+ import { parseLatex } from "../../../../tree/parsers/latexParser.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ const getPropositions = (n, { answer }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ while (propositions.length < n) {
18
+ const line = LineConstructor.random();
19
+ tryToAddWrongProp(propositions, line.getCartesianEquation().toTex());
20
+ }
21
+ return shuffleProps(propositions, n);
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { vectorIdentifiers, pointIdentifiers } = identifiers;
25
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
26
+ const vector = VectorConstructor.fromIdentifiers(vectorIdentifiers);
27
+ const line = LineConstructor.fromPointAndVector(point, vector);
28
+ return line.getCartesianEquation().toTex();
29
+ };
30
+ const getInstruction = (identifiers) => {
31
+ const { vectorIdentifiers, pointIdentifiers } = identifiers;
32
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
33
+ const vector = VectorConstructor.fromIdentifiers(vectorIdentifiers);
34
+ return `Soit $d$ une droite de vecteur directeur $${vector.toTexWithCoords()}$ et passant par le point $${point.toTexWithCoords()}$.
35
+
36
+ Déterminer une équation cartésienne de $d$.`;
37
+ };
38
+ const getHint = (identifiers) => {
39
+ const genVec = new Vector("u", opposite("b"), new VariableNode("a"));
40
+ return `Une droite de vecteur directeur $${genVec.toTexWithCoords()}$ admet une équation cartésienne de la forme :
41
+
42
+ $$
43
+ ax+by+c = 0
44
+ $$
45
+
46
+ On peut ensuite utiliser les coordonnées d'un point de la droite pour déterminer $c$.`;
47
+ };
48
+ const getCorrection = (identifiers) => {
49
+ const { vectorIdentifiers, pointIdentifiers } = identifiers;
50
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
51
+ const vector = VectorConstructor.fromIdentifiers(vectorIdentifiers);
52
+ const nonCEq = add(add(multiply(vector.y, "x"), multiply(opposite(vector.x), "y")), "c").simplify({
53
+ forbidFactorize: true,
54
+ });
55
+ const line = LineConstructor.fromPointAndVector(point, vector);
56
+ const [a, b, c] = line.toCartesianCoeffs();
57
+ const [aEv, bEv, cEv] = [a.evaluate(), b.evaluate(), c.evaluate()];
58
+ const allNeg = aEv < 0 && bEv < 0 && cEv < 0;
59
+ const pgcd = gcd(aEv, bEv, cEv);
60
+ const hasSimplified = allNeg || pgcd !== 1;
61
+ return `Puisque $${vector.toTexWithCoords()}$ est un vecteur directeur de $d$, cette dernière admet une équation cartésienne de la forme :
62
+
63
+ $$
64
+ ${nonCEq.toTex()}=0
65
+ $$
66
+
67
+ Pour déterminer $c$, on peut ensuite utiliser le fait que le point $${point.toTexWithCoords()}$ appartient à $d$ :
68
+
69
+ $$
70
+ ${nonCEq.toDetailedEvaluation({ x: point.x, y: point.y }).toTex()}=0
71
+ $$
72
+
73
+ On en déduit que $c=${c.simplify().toTex()}$.
74
+
75
+ Ainsi, une équation cartésienne de $d$ est :
76
+
77
+ $$
78
+ ${add(add(multiply(a, "x"), multiply(b, "y")), c)
79
+ .simplify({
80
+ forbidFactorize: true,
81
+ })
82
+ .toTex()}=0
83
+ $$
84
+
85
+ ${hasSimplified
86
+ ? `On peut alors simplifier cette équation en la divisant par $${allNeg ? opposite(pgcd).toTex() : pgcd}$ :
87
+
88
+ $$
89
+ ${getAnswer(identifiers)}
90
+ $$`
91
+ : ""}
92
+ `;
93
+ };
94
+ const getKeys = (identifiers) => {
95
+ return ["x", "y", "equal"];
96
+ };
97
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
98
+ try {
99
+ const parsed = parseLatex(ans);
100
+ if (!isEqualNode(parsed))
101
+ return false;
102
+ const { vectorIdentifiers, pointIdentifiers } = identifiers;
103
+ const point = PointConstructor.fromIdentifiers(pointIdentifiers);
104
+ const vector = VectorConstructor.fromIdentifiers(vectorIdentifiers);
105
+ const secondPoint = vector.getEndPoint(point);
106
+ return (parsed.leftChild
107
+ .toDetailedEvaluation({
108
+ x: point.x,
109
+ y: point.y,
110
+ })
111
+ .simplify()
112
+ .toTex() === "0" &&
113
+ parsed.leftChild
114
+ .toDetailedEvaluation({
115
+ x: secondPoint.x,
116
+ y: secondPoint.y,
117
+ })
118
+ .simplify()
119
+ .toTex() === "0");
120
+ }
121
+ catch (err) {
122
+ return handleVEAError(err);
123
+ }
124
+ };
125
+ const getCartesianFromVectorAndPointQuestion = (ops) => {
126
+ const point = PointConstructor.random("A");
127
+ const vector = VectorConstructor.random("u");
128
+ const identifiers = {
129
+ pointIdentifiers: point.toIdentifiers(),
130
+ vectorIdentifiers: vector.toIdentifiers(),
131
+ };
132
+ return getQuestionFromIdentifiers(identifiers);
133
+ };
134
+ const getQuestionFromIdentifiers = (identifiers) => {
135
+ return {
136
+ answer: getAnswer(identifiers),
137
+ instruction: getInstruction(identifiers),
138
+ keys: getKeys(identifiers),
139
+ answerFormat: "tex",
140
+ identifiers,
141
+ hint: getHint(identifiers),
142
+ correction: getCorrection(identifiers),
143
+ };
144
+ };
145
+ export const cartesianFromVectorAndPoint = {
146
+ id: "cartesianFromVectorAndPoint",
147
+ label: "Déterminer l'équation cartésienne d'une droite en connaissant un point et un vecteur directeur",
148
+ isSingleStep: true,
149
+ generator: (nb, opts) => getDistinctQuestions(() => getCartesianFromVectorAndPointQuestion(opts), nb),
150
+ qcmTimer: 60,
151
+ freeTimer: 60,
152
+ getPropositions,
153
+ isAnswerValid,
154
+ subject: "Mathématiques",
155
+ getInstruction,
156
+ getHint,
157
+ getCorrection,
158
+ getAnswer,
159
+ getQuestionFromIdentifiers,
160
+ hasHintAndCorrection: true,
161
+ };
@@ -1,7 +1,9 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
- xValue: number;
4
- yValue: number;
3
+ x1: number;
4
+ x2: number;
5
+ y1: number;
6
+ y2: number;
5
7
  };
6
8
  export declare const directionVector: Exercise<Identifiers>;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"directionVector.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/directionVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyIF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
1
+ {"version":3,"file":"directionVector.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/directionVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IAIjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAkJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}