math-exercises 3.0.158 → 3.0.159

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 (218) hide show
  1. package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +7 -6
  2. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -1
  3. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +88 -9
  4. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +8 -2
  6. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  7. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  9. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  10. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +27 -2
  11. package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.js +0 -1
  13. package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +0 -1
  15. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -1
  16. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +11 -4
  17. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +11 -5
  19. package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
  20. package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
  22. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  23. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +91 -21
  24. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
  25. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +63 -43
  26. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
  27. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +72 -49
  28. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
  29. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -19
  30. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -1
  31. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +26 -14
  32. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +1 -0
  33. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -1
  34. package/lib/exercises/math/derivation/derivative/exp/index.js +1 -0
  35. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  36. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  37. package/lib/exercises/math/derivation/variations/index.js +1 -0
  38. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts +7 -0
  39. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +174 -0
  41. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +30 -3
  43. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +12 -7
  45. package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +1 -1
  46. package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +2 -2
  47. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -1
  48. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +33 -44
  49. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -1
  50. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +80 -8
  51. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -1
  52. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +80 -25
  53. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -1
  54. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +6 -15
  55. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  56. package/lib/exercises/math/functions/exponential/expFactorization.js +54 -42
  57. package/lib/exercises/math/functions/exponential/index.d.ts +2 -0
  58. package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
  59. package/lib/exercises/math/functions/exponential/index.js +2 -0
  60. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +3 -0
  61. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -1
  62. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +18 -23
  63. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -1
  64. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +24 -26
  65. package/lib/exercises/math/functions/variations/index.d.ts +1 -0
  66. package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
  67. package/lib/exercises/math/functions/variations/index.js +1 -0
  68. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
  69. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
  70. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
  71. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
  72. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
  73. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
  74. package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
  75. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  76. package/lib/exercises/math/geometry/cartesian/index.js +3 -0
  77. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
  78. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
  79. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
  80. package/lib/exercises/math/geometry/circles/index.d.ts +2 -0
  81. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
  82. package/lib/exercises/math/geometry/circles/index.js +1 -0
  83. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
  84. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
  85. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
  86. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
  87. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
  88. package/lib/exercises/math/geometry/index.d.ts +1 -0
  89. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  90. package/lib/exercises/math/geometry/index.js +1 -0
  91. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts +4 -0
  92. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
  93. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
  94. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
  95. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
  96. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
  97. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
  98. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
  99. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
  100. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
  101. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
  102. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
  103. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
  104. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
  105. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
  106. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
  107. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
  108. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
  109. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
  110. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
  111. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
  112. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
  113. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
  114. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
  115. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts +6 -0
  116. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
  117. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
  118. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
  119. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
  120. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
  121. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
  122. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
  123. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
  124. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
  125. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
  126. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
  127. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
  128. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
  129. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
  130. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
  131. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
  132. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
  133. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
  134. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
  135. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
  136. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
  137. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
  138. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
  139. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
  140. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
  141. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
  142. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +9 -0
  143. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
  144. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
  145. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
  146. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
  147. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
  148. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
  149. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  150. package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
  151. package/lib/exercises/math/sequences/generation/index.d.ts +2 -0
  152. package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
  153. package/lib/exercises/math/sequences/generation/index.js +1 -0
  154. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
  155. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
  156. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
  157. package/lib/exercises/math/sequences/graph/index.d.ts +2 -0
  158. package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
  159. package/lib/exercises/math/sequences/graph/index.js +1 -0
  160. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
  161. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
  162. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
  163. package/lib/exercises/math/sequences/index.d.ts +2 -0
  164. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  165. package/lib/exercises/math/sequences/index.js +2 -0
  166. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
  167. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
  168. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
  169. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
  170. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
  171. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
  172. package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
  173. package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
  174. package/lib/exercises/math/sequences/notation/index.js +2 -0
  175. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
  176. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
  177. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
  178. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
  179. package/lib/exercises/vea/cartesianLineVEA.d.ts +2 -0
  180. package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
  181. package/lib/exercises/vea/cartesianLineVEA.js +1 -0
  182. package/lib/index.d.ts +123 -0
  183. package/lib/index.d.ts.map +1 -1
  184. package/lib/math/geometry/line.d.ts +2 -0
  185. package/lib/math/geometry/line.d.ts.map +1 -1
  186. package/lib/math/geometry/line.js +7 -0
  187. package/lib/math/geometry/point.d.ts +1 -0
  188. package/lib/math/geometry/point.d.ts.map +1 -1
  189. package/lib/math/geometry/point.js +5 -0
  190. package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
  191. package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
  192. package/lib/math/geometry/polygons/relationPP.js +41 -0
  193. package/lib/math/polynomials/trinom.d.ts +1 -1
  194. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  195. package/lib/math/polynomials/trinom.js +15 -6
  196. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  197. package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
  198. package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
  199. package/lib/math/utils/geometry/randomVecs2.js +34 -0
  200. package/lib/tests/questionTest.d.ts.map +1 -1
  201. package/lib/tests/questionTest.js +2 -2
  202. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
  203. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  204. package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
  205. package/lib/tree/nodes/functions/expNode.d.ts +1 -1
  206. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  207. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
  208. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  209. package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
  210. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  211. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  212. package/lib/tree/nodes/operators/fractionNode.js +6 -4
  213. package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
  214. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  215. package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
  216. package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
  217. package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
  218. package/package.json +1 -1
@@ -32,11 +32,11 @@ const getInstruction = (identifiers) => {
32
32
  return `Sachant que :
33
33
 
34
34
  $$
35
- \\exp(${texA})\\approx${expARounded.frenchify()}
35
+ \\exp(${texA})\\approx ${expARounded.frenchify()}
36
36
  $$
37
37
 
38
38
  $$
39
- \\exp(${texB})\\approx${expBRounded.frenchify()}
39
+ \\exp(${texB})\\approx ${expBRounded.frenchify()}
40
40
  $$
41
41
 
42
42
  donner une valeur approchée de $\\exp(${texAOpBSubstituted})$
@@ -188,6 +188,33 @@ const getPropositions = (n, { answer, ...identifiers }) => {
188
188
  }
189
189
  });
190
190
  }
191
+ //filler
192
+ if (propositions.length < n) {
193
+ //exp(b)-exp(a)
194
+ {
195
+ const nodeWrong = round(substract(expBRounded, expARounded).evaluate(), precision).toTree();
196
+ const tex = nodeWrong.toTex();
197
+ if (tex !== "NaN") {
198
+ tryToAddWrongProp(propositions, tex);
199
+ }
200
+ }
201
+ //exp(a)/exp(b)
202
+ {
203
+ const nodeWrong = round(frac(expARounded, expBRounded).evaluate(), precision).toTree();
204
+ const tex = nodeWrong.toTex();
205
+ if (tex !== "NaN") {
206
+ tryToAddWrongProp(propositions, tex);
207
+ }
208
+ }
209
+ //(exp(a)+exp(b))/2
210
+ {
211
+ const nodeWrong = round(frac(add(expARounded, expBRounded), 2).evaluate(), precision).toTree();
212
+ const tex = nodeWrong.toTex();
213
+ if (tex !== "NaN") {
214
+ tryToAddWrongProp(propositions, tex);
215
+ }
216
+ }
217
+ }
191
218
  return shuffleProps(propositions, n);
192
219
  };
193
220
  const isAnswerValid = (ans, { answer }) => {
@@ -260,7 +287,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
260
287
  };
261
288
  export const approxExpAPlusB = {
262
289
  id: "approxExpAPlusB",
263
- label: "Déterminer une valeur approchée de $\\exp(a+b)$ ou de $\\exp(a-b)$",
290
+ label: "Déterminer une valeur approchée de $\\exp(a \\pm b)$ à partir de $\\exp(a)$ et $\\exp(b)$",
264
291
  isSingleStep: true,
265
292
  generator: (nb, opts) => getDistinctQuestions(() => getApproxExpAPlusBQuestion(opts), nb),
266
293
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"approxExpKa.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/algebraic/approxExpKa.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+OF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
1
+ {"version":3,"file":"approxExpKa.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/algebraic/approxExpKa.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqPF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
- import { randfloat } from "../../../../../math/utils/random/randfloat.js";
4
3
  import { randint } from "../../../../../math/utils/random/randint.js";
5
4
  import { round } from "../../../../../math/utils/round.js";
6
5
  import { exp } from "../../../../../tree/nodes/functions/expNode.js";
@@ -15,13 +14,13 @@ import { shuffle } from "../../../../../utils/alea/shuffle.js";
15
14
  const getInstruction = (identifiers) => {
16
15
  const { nodeIdsA, nodeIdsK, expARounded, precision } = identifiers;
17
16
  const [nodeA, nodeK] = [nodeIdsA, nodeIdsK].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
18
- const [texA, _] = [nodeA, nodeK].map((node) => node.toTex());
17
+ const [texA, _] = [nodeA, nodeK].map((node) => node.toTex({ roundTo: 2 }));
19
18
  const nodeKA = multiply(nodeK, nodeA).simplify({ fractionsToDecimal: true });
20
19
  const texKA = nodeKA.toTex();
21
20
  return `Sachant que :
22
21
 
23
22
  $$
24
- \\exp(${texA})\\approx${expARounded.frenchify()}
23
+ \\exp(${texA})\\approx ${expARounded.frenchify()}
25
24
  $$
26
25
 
27
26
  donner une valeur approchée de $\\exp(${texKA})$
@@ -39,7 +38,7 @@ const getAnswer = (identifiers) => {
39
38
  const getHint = (identifiers) => {
40
39
  const { nodeIdsA, nodeIdsK } = identifiers;
41
40
  const [nodeA, nodeK] = [nodeIdsA, nodeIdsK].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
42
- const [texA, texK] = [nodeA, nodeK].map((node) => node.toTex());
41
+ const [texA, texK] = [nodeA, nodeK].map((node) => node.toTex({ roundTo: 2 }));
43
42
  return `Utilise la propriété :
44
43
 
45
44
  $$
@@ -51,7 +50,7 @@ $$
51
50
  const getCorrection = (identifiers) => {
52
51
  const { nodeIdsA, nodeIdsK, expARounded } = identifiers;
53
52
  const [nodeA, nodeK] = [nodeIdsA, nodeIdsK].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
54
- const [texA, texK] = [nodeA, nodeK].map((node) => node.toTex());
53
+ const [texA, texK] = [nodeA, nodeK].map((node) => node.toTex({ roundTo: 2 }));
55
54
  const nodeKA = multiply(nodeK, nodeA).simplify();
56
55
  const texKA = nodeKA.toTex();
57
56
  return `On a :
@@ -69,7 +68,7 @@ $$
69
68
  On a donc :
70
69
 
71
70
  $$
72
- \\exp(${texKA}) = (e^{${texA}})^{${texK}} \\approx ({${expARounded.frenchify()}})^{${texK}}
71
+ \\exp(${texKA}) = (\\exp(${texA}))^{${texK}} \\approx ({${expARounded.frenchify()}})^{${texK}}
73
72
  $$
74
73
 
75
74
  $$
@@ -134,7 +133,13 @@ const isAnswerValid = (ans, { answer }) => {
134
133
  };
135
134
  const getApproxExpKaQuestion = () => {
136
135
  function createRandomIdentifiers() {
137
- const nodeA = randfloat(0, 3, 2, [0]).toTree();
136
+ const dot1Pool = [...Array(30).keys()]
137
+ .map((i) => i + 1)
138
+ .map((i) => i * 0.1);
139
+ const dot25Pool = [...Array(12).keys()]
140
+ .map((i) => i + 1)
141
+ .map((i) => i * 0.25);
142
+ const nodeA = random(random([dot1Pool, dot25Pool])).toTree();
138
143
  const precision = randint(1, 6);
139
144
  const expARounded = round(exp(nodeA).evaluate(), precision);
140
145
  const nodeK = random([
@@ -11,7 +11,7 @@ const getInstruction = (identifiers) => {
11
11
  return `Sachant que :
12
12
 
13
13
  $$
14
- \\exp(1)\\approx${exp1Rounded.frenchify()}
14
+ \\exp(1)\\approx ${exp1Rounded.frenchify()}
15
15
  $$
16
16
 
17
17
  donner une valeur approchée de $\\exp(${a.frenchify()})$
@@ -162,7 +162,7 @@ $$
162
162
  Ainsi :
163
163
 
164
164
  $$
165
- ${myExp(nodeAOpB).toTex()} = ${getAnswer(identifiers)}
165
+ ${myExp(nodeAOpB).toTex()} = ${getAnswer(identifiers, opts)}
166
166
  $$
167
167
 
168
168
  `;
@@ -200,7 +200,7 @@ const getKeys = (identifiers, optsIn) => {
200
200
  const nodeA = NodeConstructor.fromIdentifiers(identifiers.nodeIdsA);
201
201
  const isUsingPi = nodeA.toTex().includes("\\pi");
202
202
  return [
203
- ...(opts.isUseExpNotation ? ["exp"] : ["e"]),
203
+ ...(opts.isUseExpNotation ? ["exp"] : ["epower"]),
204
204
  ...(isUsingPi ? ["pi"] : []),
205
205
  ];
206
206
  };
@@ -1 +1 @@
1
- {"version":3,"file":"approxExpAPlusH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/approxExpAPlusH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,eAAe,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAqQF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAkBjD,CAAC"}
1
+ {"version":3,"file":"approxExpAPlusH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/approxExpAPlusH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,eAAe,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4PF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAmBjD,CAAC"}
@@ -13,6 +13,7 @@ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.j
13
13
  import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
14
14
  import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
15
15
  import { shuffle } from "../../../../../utils/alea/shuffle.js";
16
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
16
17
  const precision = 2;
17
18
  const getInstruction = (identifiers) => {
18
19
  const { nodeIdsA, nodeIdsH, nodeIdsAOpH, expARounded } = identifiers;
@@ -31,9 +32,7 @@ $$
31
32
  \\exp(${texA})\\approx${expARounded.frenchify()}
32
33
  $$
33
34
 
34
- donner une valeur approchée de $\\exp(${texAOpHSubstituted})$
35
-
36
- avec $${precision}$ décimale${precision > 1 ? "s" : ""}.`;
35
+ Donner une valeur approchée de $\\exp(${texAOpHSubstituted})$ avec $${precision}$ décimale${precision > 1 ? "s" : ""}.`;
37
36
  };
38
37
  const getAnswerNode = (identifiers) => {
39
38
  const { nodeIdsH, nodeIdsAOpH, expARounded } = identifiers;
@@ -80,37 +79,25 @@ const getCorrection = (identifiers) => {
80
79
  const { nodeIdsA, nodeIdsH, nodeIdsAOpH, expARounded } = identifiers;
81
80
  const [nodeA, nodeH, nodeAOpH] = [nodeIdsA, nodeIdsH, nodeIdsAOpH].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
82
81
  const [texA, texH, texAOpH] = [nodeA, nodeH, nodeAOpH].map((node) => node.toTex());
83
- switch (texAOpH) {
84
- case "a+h":
85
- return `On souhaite utiliser la formule :
86
-
87
- $$
88
- \\exp(${texA} + ${texH}) \\approx \\exp(${texA}) + \\exp'(${texA}) \\times ${texH}
89
- $$
90
-
91
- Or :
92
-
93
- $$
94
- \\exp'(${texA}) = \\exp(${texA}) \\approx ${expARounded.frenchify()}
95
- $$
96
-
97
- Ainsi :
98
-
99
- $$
100
- \\exp(${texA} + ${texH}) \\approx ${expARounded.frenchify()} + ${expARounded.frenchify()} \\times ${texH}
101
- $$
102
-
103
- $$
104
- \\exp(${texA} + ${texH}) \\approx ${getAnswer(identifiers)}
105
- $$
82
+ const strOpSymbol = (() => {
83
+ switch (texAOpH) {
84
+ case "a+h":
85
+ return "+";
86
+ case "a-h":
87
+ return "-";
88
+ default:
89
+ throw new Error("Unsupported texAOpH: " + texAOpH);
90
+ }
91
+ })();
92
+ return `On souhaite utiliser la formule :
106
93
 
107
- `;
108
- case "a-h":
109
- return `On souhaite utiliser la formule :
110
-
111
- $$
112
- \\exp(${texA} - ${texH}) \\approx \\exp(${texA}) - \\exp'(${texA}) \\times ${texH}
113
- $$
94
+ ${alignTex([
95
+ [
96
+ `\\exp(${texA} ${strOpSymbol} ${texH})`,
97
+ `\\approx`,
98
+ `\\exp(${texA}) ${strOpSymbol} \\exp'(${texA}) \\times ${texH}`,
99
+ ],
100
+ ])}
114
101
 
115
102
  Or :
116
103
 
@@ -120,18 +107,20 @@ $$
120
107
 
121
108
  Ainsi :
122
109
 
123
- $$
124
- \\exp(${texA} - ${texH}) \\approx ${expARounded.frenchify()} - ${expARounded.frenchify()} \\times ${texH}
125
- $$
126
-
127
- $$
128
- \\exp(${texA} - ${texH}) \\approx ${getAnswer(identifiers)}
129
- $$
110
+ ${alignTex([
111
+ [
112
+ `\\exp(${texA} ${strOpSymbol} ${texH})`,
113
+ `\\approx`,
114
+ `${expARounded.frenchify()} ${strOpSymbol} ${expARounded.frenchify()} \\times ${texH}`,
115
+ ],
116
+ [
117
+ `\\exp(${texA} ${strOpSymbol} ${texH})`,
118
+ `\\approx`,
119
+ `${getAnswer(identifiers)}`,
120
+ ],
121
+ ])}
130
122
 
131
123
  `;
132
- default:
133
- throw new Error("Unsupported texAOpH: " + texAOpH);
134
- }
135
124
  };
136
125
  const getPropositions = (n, { answer, ...identifiers }) => {
137
126
  const { nodeIdsA, nodeIdsH, nodeIdsAOpH, expARounded } = identifiers;
@@ -216,7 +205,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
216
205
  };
217
206
  export const approxExpAPlusH = {
218
207
  id: "approxExpAPlusH",
219
- label: "Déterminer une valeur approchée de $\\exp(a+h)$ ou de $\\exp(a-h)$",
208
+ label: "Déterminer une valeur approchée de $\\exp(a \\pm h)$ par approximation linéaire",
220
209
  isSingleStep: true,
221
210
  generator: (nb, opts) => getDistinctQuestions(() => getApproxExpAPlusHQuestion(opts), nb),
222
211
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"expAntecedentFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/expAntecedentFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4MF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"expAntecedentFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/expAntecedentFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAyRF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -4,6 +4,7 @@ import { greenMain, red } from "../../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
5
  import { Point } from "../../../../../math/geometry/point.js";
6
6
  import { randfloat } from "../../../../../math/utils/random/randfloat.js";
7
+ import { randint } from "../../../../../math/utils/random/randint.js";
7
8
  import { round } from "../../../../../math/utils/round.js";
8
9
  import { exp } from "../../../../../tree/nodes/functions/expNode.js";
9
10
  import { LogNode } from "../../../../../tree/nodes/functions/logNode.js";
@@ -11,6 +12,11 @@ import { substract } from "../../../../../tree/nodes/operators/substractNode.js"
11
12
  import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
12
13
  import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
13
14
  const precision = 2;
15
+ const getGridPoints = () => {
16
+ return [...Array(9).keys()]
17
+ .map((i) => i + 1)
18
+ .map((i) => new Point(`P${i}`, round(Math.log(i), precision), i));
19
+ };
14
20
  const getInstruction = (identifiers) => {
15
21
  const { a, isExpPrime } = identifiers;
16
22
  return `La courbe représentative de la fonction exponentielle est ci-dessous en rouge.
@@ -49,10 +55,10 @@ $$
49
55
 
50
56
  Cela étant dit,
51
57
 
52
- pour résoudre graphiquement $f(x)=${a.frenchify()}$, on cherche l'image ou les antécédents ?`;
58
+ pour résoudre graphiquement $f(x)=${a.frenchify()}$, cherche-t-on l'image ou les antécédents ?`;
53
59
  }
54
60
  else {
55
- return `Pour résoudre graphiquement $f(x)=${a.frenchify()}$, on cherche l'image ou les antécédents ?`;
61
+ return `Pour résoudre graphiquement $f(x)=${a.frenchify()}$, cherche-t-on l'image ou les antécédents ?`;
56
62
  }
57
63
  };
58
64
  const getCorrection = (identifiers) => {
@@ -78,10 +84,8 @@ $$
78
84
  }
79
85
  })()}
80
86
  On cherche les antécédents de $${a.frenchify()}$ par $\\exp$.
81
-
82
- La fonction exponentielle est strictement croissante de $\\mathbb{R}$ dans $\\mathbb{R}^{+*}$
83
87
 
84
- donc $${a.frenchify()}$ n'a qu'un seul antécédent par $\\exp$ ; on le nomme $x_{0}$.
88
+ Il n'y en a qu'un seul.
85
89
 
86
90
  On lit :
87
91
 
@@ -99,9 +103,33 @@ const getCorrectionGGBOptions = (identifiers) => {
99
103
  const pointX0 = new Point("PX0", x, 0);
100
104
  const point0Y = new Point("P0Y", 0, y);
101
105
  const pointXY = new Point("PXY", x, y);
106
+ const gridPoints = getGridPoints();
102
107
  const commands = [
103
108
  `Cf = exp(x)`,
104
109
  `SetColor(Cf, "${red}")`,
110
+ //custom grid
111
+ ...gridPoints.flatMap((point, i) => {
112
+ const x = point.x.evaluate();
113
+ const y = point.y.evaluate();
114
+ return [
115
+ //lineFromX
116
+ `LX${i} = Line((${x},0),(${x},1))`,
117
+ `SetColor(LX${i}, "#999999")`,
118
+ `SetLineThickness(LX${i}, 1)`,
119
+ `SetFixed(LX${i}, true)`,
120
+ //lineFromY
121
+ `LY${i} = Line((0,${y}),(1,${y}))`,
122
+ `SetColor(LY${i}, "#999999")`,
123
+ `SetLineThickness(LY${i}, 1)`,
124
+ `SetFixed(LY${i}, true)`,
125
+ //markerFromX
126
+ `LblX${i} = Text("\\footnotesize ${round(x, precision).frenchify()}", (${x},0), true, true, 0, -1)`,
127
+ //markerFromY
128
+ // `LblY${i} = Text("\\footnotesize ${round(y, precision).toFixed(
129
+ // precision,
130
+ // )}", (0,${y}), true, true, -1, 0)`,
131
+ ];
132
+ }),
105
133
  `v1 = Vector(${point0Y.toMathString()},${pointXY.toMathString()})`,
106
134
  `SetColor(v1, "${greenMain}")`,
107
135
  `v2 = Vector(${pointXY.toMathString()},${pointX0.toMathString()})`,
@@ -110,6 +138,10 @@ const getCorrectionGGBOptions = (identifiers) => {
110
138
  const ggb = new GeogebraConstructor({
111
139
  commands,
112
140
  lockedAxesRatio: (xMaxFrame - xMinFrame) / (yMaxFrame - yMinFrame),
141
+ xAxis: {
142
+ hideNumbers: true,
143
+ },
144
+ hideGrid: true,
113
145
  });
114
146
  return ggb.getOptions({
115
147
  coords: coordsFrame,
@@ -118,10 +150,41 @@ const getCorrectionGGBOptions = (identifiers) => {
118
150
  const getGGBOptions = (identifiers) => {
119
151
  const { coordsFrame } = identifiers;
120
152
  const [xMinFrame, xMaxFrame, yMinFrame, yMaxFrame] = coordsFrame;
121
- const commands = [`Cf = exp(x)`, `SetColor(Cf, "${red}")`];
153
+ const gridPoints = getGridPoints();
154
+ const commands = [
155
+ `Cf = exp(x)`,
156
+ `SetColor(Cf, "${red}")`,
157
+ //custom grid
158
+ ...gridPoints.flatMap((point, i) => {
159
+ const x = point.x.evaluate();
160
+ const y = point.y.evaluate();
161
+ return [
162
+ //lineFromX
163
+ `LX${i} = Line((${x},0),(${x},1))`,
164
+ `SetColor(LX${i}, "#999999")`,
165
+ `SetLineThickness(LX${i}, 1)`,
166
+ `SetFixed(LX${i}, true)`,
167
+ //lineFromY
168
+ `LY${i} = Line((0,${y}),(1,${y}))`,
169
+ `SetColor(LY${i}, "#999999")`,
170
+ `SetLineThickness(LY${i}, 1)`,
171
+ `SetFixed(LY${i}, true)`,
172
+ //markerFromX
173
+ `LblX${i} = Text("\\footnotesize ${round(x, precision).frenchify()}", (${x},0), true, true, 0, -1)`,
174
+ //markerFromY
175
+ // `LblY${i} = Text("\\footnotesize ${round(y, precision).toFixed(
176
+ // precision,
177
+ // )}", (0,${y}), true, true, -1, 0)`,
178
+ ];
179
+ }),
180
+ ];
122
181
  const ggb = new GeogebraConstructor({
123
182
  commands,
124
183
  lockedAxesRatio: (xMaxFrame - xMinFrame) / (yMaxFrame - yMinFrame),
184
+ xAxis: {
185
+ hideNumbers: true,
186
+ },
187
+ hideGrid: true,
125
188
  });
126
189
  return ggb.getOptions({
127
190
  coords: coordsFrame,
@@ -150,9 +213,18 @@ const isAnswerValid = (ans, { answer }) => {
150
213
  return substract(nodeAns, nodeAnswer).evaluate() === 0;
151
214
  };
152
215
  const getExpAntecedentFromGraphQuestion = () => {
153
- const a = randfloat(0.5, 2, precision);
216
+ const minA = 1;
217
+ const maxA = 8;
218
+ const a = randint(minA, maxA + 1);
154
219
  const isExpPrime = coinFlip();
155
- const coordsFrame = [-1, 2, Math.exp(-1), Math.exp(2)];
220
+ const minYFrame = Math.max(1, a - randint(1, 3));
221
+ const maxYFrame = a + randint(1, 3);
222
+ const coordsFrame = [
223
+ Math.log(minYFrame),
224
+ Math.log(maxYFrame),
225
+ -1.3,
226
+ maxYFrame,
227
+ ];
156
228
  const identifiers = {
157
229
  a,
158
230
  isExpPrime,
@@ -1 +1 @@
1
- {"version":3,"file":"expImageFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/expImageFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA0MF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
1
+ {"version":3,"file":"expImageFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/expImageFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwQF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
@@ -12,19 +12,16 @@ import { substract } from "../../../../../tree/nodes/operators/substractNode.js"
12
12
  import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
13
13
  import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
14
14
  const precision = 2;
15
+ const getGridPoints = () => {
16
+ return [...Array(9).keys()].map((i) => new Point(`P${i}`, i, round(Math.exp(i), precision)));
17
+ };
15
18
  const getInstruction = (identifiers) => {
16
19
  const { a, isExpPrime } = identifiers;
17
20
  return `La courbe représentative de la fonction exponentielle est ci-dessous en rouge.
18
21
 
19
- Résoudre graphiquement l'équation
20
-
21
- $$
22
- \\exp${isExpPrime ? "'" : ""}(${a.frenchify()}) = x
23
- $$
24
-
25
- (donner une valeur approchée
22
+ Donner une lecture graphique de la valeur de $\\exp${isExpPrime ? "'" : ""}(${a.frenchify()})$
26
23
 
27
- avec $${precision}$ décimale${precision > 1 ? "s" : ""}).`;
24
+ avec $${precision}$ décimale${precision > 1 ? "s" : ""}.`;
28
25
  };
29
26
  const getAnswerNode = (identifiers) => {
30
27
  const { a } = identifiers;
@@ -35,26 +32,22 @@ const getAnswer = (identifiers) => {
35
32
  };
36
33
  const getHint = (identifiers) => {
37
34
  const { a, isExpPrime } = identifiers;
38
- if (isExpPrime) {
39
- return `La fonction exponentielle vérifie pour tout $x$ réel :
35
+ return `${(() => {
36
+ if (isExpPrime) {
37
+ return `La fonction exponentielle vérifie pour tout $x$ réel :
40
38
 
41
39
  $$
42
40
  \\exp'(x)=\\exp(x)
43
41
  $$
44
42
 
45
- On cherche donc à résoudre l'équation :
46
-
47
- $$
48
- \\exp(x)=${a.frenchify()}
49
- $$
50
-
51
- Cela étant dit,
43
+ On cherche donc à lire graphiquement la valeur de $\\exp(${a.frenchify()})$.
52
44
 
53
- ici, on cherche l'image ou les antécédents ?`;
54
- }
55
- else {
56
- return `Ici, on cherche l'image ou les antécédents ?`;
57
- }
45
+ `;
46
+ }
47
+ else {
48
+ return ``;
49
+ }
50
+ })()}Pour une fonction $f$, comment lit-on $f(${a.frenchify()})$ ?`;
58
51
  };
59
52
  const getCorrection = (identifiers) => {
60
53
  const { a, isExpPrime } = identifiers;
@@ -72,7 +65,7 @@ $$
72
65
  return ``;
73
66
  }
74
67
  })()}
75
- On cherche l'image de $${a.frenchify()}$ par $\\exp$
68
+ On cherche l'image de $${a.frenchify()}$ par $\\exp$.
76
69
 
77
70
  On lit :
78
71
 
@@ -90,9 +83,34 @@ const getCorrectionGGBOptions = (identifiers) => {
90
83
  const pointX0 = new Point("PX0", x, 0);
91
84
  const point0Y = new Point("P0Y", 0, y);
92
85
  const pointXY = new Point("PXY", x, y);
86
+ const gridPoints = getGridPoints();
93
87
  const commands = [
94
88
  `Cf = exp(x)`,
95
89
  `SetColor(Cf, "${red}")`,
90
+ //custom grid
91
+ ...gridPoints.flatMap((point, i) => {
92
+ const x = point.x.evaluate();
93
+ const y = point.y.evaluate();
94
+ return [
95
+ //lineFromX
96
+ `LX${i} = Line((${x},0),(${x},1))`,
97
+ `SetColor(LX${i}, "#999999")`,
98
+ `SetLineThickness(LX${i}, 1)`,
99
+ `SetFixed(LX${i}, true)`,
100
+ //lineFromY
101
+ `LY${i} = Line((0,${y}),(1,${y}))`,
102
+ `SetColor(LY${i}, "#999999")`,
103
+ `SetLineThickness(LY${i}, 1)`,
104
+ `SetFixed(LY${i}, true)`,
105
+ //markerFromX
106
+ // `LblX${i} = Text("\\footnotesize ${round(
107
+ // x,
108
+ // precision,
109
+ // ).frenchify()}", (${x},0), true, true, 0, -1)`,
110
+ //markerFromY
111
+ `LblY${i} = Text("\\footnotesize ${round(y, precision).toFixed(precision)}", (0,${y}), true, true, -1, 0)`,
112
+ ];
113
+ }),
96
114
  `v1 = Vector(${pointX0.toMathString()},${pointXY.toMathString()})`,
97
115
  `SetColor(v1, "${greenMain}")`,
98
116
  `v2 = Vector(${pointXY.toMathString()},${point0Y.toMathString()})`,
@@ -101,6 +119,10 @@ const getCorrectionGGBOptions = (identifiers) => {
101
119
  const ggb = new GeogebraConstructor({
102
120
  commands,
103
121
  lockedAxesRatio: (xMaxFrame - xMinFrame) / (yMaxFrame - yMinFrame),
122
+ yAxis: {
123
+ hideNumbers: true,
124
+ },
125
+ hideGrid: true,
104
126
  });
105
127
  return ggb.getOptions({
106
128
  coords: coordsFrame,
@@ -109,10 +131,43 @@ const getCorrectionGGBOptions = (identifiers) => {
109
131
  const getGGBOptions = (identifiers) => {
110
132
  const { coordsFrame } = identifiers;
111
133
  const [xMinFrame, xMaxFrame, yMinFrame, yMaxFrame] = coordsFrame;
112
- const commands = [`Cf = exp(x)`, `SetColor(Cf, "${red}")`];
134
+ const gridPoints = getGridPoints();
135
+ const commands = [
136
+ //func
137
+ `Cf = exp(x)`,
138
+ `SetColor(Cf, "${red}")`,
139
+ //custom grid
140
+ ...gridPoints.flatMap((point, i) => {
141
+ const x = point.x.evaluate();
142
+ const y = point.y.evaluate();
143
+ return [
144
+ //lineFromX
145
+ `LX${i} = Line((${x},0),(${x},1))`,
146
+ `SetColor(LX${i}, "#999999")`,
147
+ `SetLineThickness(LX${i}, 1)`,
148
+ `SetFixed(LX${i}, true)`,
149
+ //lineFromY
150
+ `LY${i} = Line((0,${y}),(1,${y}))`,
151
+ `SetColor(LY${i}, "#999999")`,
152
+ `SetLineThickness(LY${i}, 1)`,
153
+ `SetFixed(LY${i}, true)`,
154
+ //markerFromX
155
+ // `LblX${i} = Text("\\footnotesize ${round(
156
+ // x,
157
+ // precision,
158
+ // ).frenchify()}", (${x},0), true, true, 0, -1)`,
159
+ //markerFromY
160
+ `LblY${i} = Text("\\footnotesize ${round(y, precision).toFixed(precision)}", (0,${y}), true, true, -1, 0)`,
161
+ ];
162
+ }),
163
+ ];
113
164
  const ggb = new GeogebraConstructor({
114
165
  commands,
115
166
  lockedAxesRatio: (xMaxFrame - xMinFrame) / (yMaxFrame - yMinFrame),
167
+ yAxis: {
168
+ hideNumbers: true,
169
+ },
170
+ hideGrid: true,
116
171
  });
117
172
  return ggb.getOptions({
118
173
  coords: coordsFrame,
@@ -145,7 +200,7 @@ const getExpImageFromGraphQuestion = () => {
145
200
  const maxA = 8;
146
201
  const a = randint(minA, maxA + 1);
147
202
  const isExpPrime = coinFlip();
148
- const minXFrame = a - randint(2, 6);
203
+ const minXFrame = -1;
149
204
  const maxXFrame = a + randint(1, 3);
150
205
  const coordsFrame = [
151
206
  minXFrame,
@@ -1 +1 @@
1
- {"version":3,"file":"isPlausibleExpFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAmB7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CAQd,CAAC;AA4XF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
1
+ {"version":3,"file":"isPlausibleExpFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAmB7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CAQd,CAAC;AA8WF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}