math-exercises 3.0.158 → 3.0.160

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 (268) 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 +1 -3
  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/trinoms/factoForm/index.d.ts +1 -0
  62. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -1
  63. package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
  64. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts +13 -0
  65. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts.map +1 -0
  66. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.js +147 -0
  67. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +96 -0
  69. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +95 -1
  71. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts +9 -0
  72. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts.map +1 -0
  73. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.js +173 -0
  74. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +2 -0
  75. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -1
  76. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +2 -0
  77. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +1 -1
  78. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts +9 -0
  79. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.js +97 -0
  81. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +18 -23
  83. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +24 -26
  85. package/lib/exercises/math/functions/variations/index.d.ts +1 -0
  86. package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/variations/index.js +1 -0
  88. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
  89. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
  90. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
  91. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
  92. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
  93. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
  94. package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
  95. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  96. package/lib/exercises/math/geometry/cartesian/index.js +3 -0
  97. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
  98. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
  99. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
  100. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts +10 -0
  101. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts.map +1 -0
  102. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.js +174 -0
  103. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts +12 -0
  104. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -0
  105. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +161 -0
  106. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts +9 -0
  107. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts.map +1 -0
  108. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.js +145 -0
  109. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts +13 -0
  110. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts.map +1 -0
  111. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.js +181 -0
  112. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts +11 -0
  113. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts.map +1 -0
  114. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.js +191 -0
  115. package/lib/exercises/math/geometry/circles/index.d.ts +7 -0
  116. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
  117. package/lib/exercises/math/geometry/circles/index.js +6 -0
  118. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
  119. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
  120. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
  121. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
  122. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
  123. package/lib/exercises/math/geometry/index.d.ts +1 -0
  124. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/index.js +1 -0
  126. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts +10 -0
  127. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts.map +1 -0
  128. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.js +181 -0
  129. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts +4 -1
  130. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +23 -3
  132. package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
  133. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  134. package/lib/exercises/math/geometry/lines/index.js +1 -0
  135. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts +4 -0
  136. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
  137. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
  138. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
  139. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
  140. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
  141. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
  142. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
  143. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
  144. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
  145. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
  146. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
  147. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
  148. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
  149. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
  150. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
  151. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
  152. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
  153. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
  154. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
  155. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
  156. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
  157. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
  158. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
  159. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts +6 -0
  160. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
  161. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
  162. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
  163. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
  164. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
  165. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
  166. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
  167. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
  168. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
  169. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
  170. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
  171. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
  172. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
  173. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
  174. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
  175. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
  176. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
  177. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
  178. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
  179. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
  180. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
  181. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
  182. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
  183. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
  184. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
  185. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
  186. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +9 -0
  187. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
  188. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
  189. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
  190. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
  191. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
  192. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
  193. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  194. package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
  195. package/lib/exercises/math/sequences/generation/index.d.ts +2 -0
  196. package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
  197. package/lib/exercises/math/sequences/generation/index.js +1 -0
  198. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
  199. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
  200. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
  201. package/lib/exercises/math/sequences/graph/index.d.ts +2 -0
  202. package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
  203. package/lib/exercises/math/sequences/graph/index.js +1 -0
  204. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
  205. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
  206. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
  207. package/lib/exercises/math/sequences/index.d.ts +2 -0
  208. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  209. package/lib/exercises/math/sequences/index.js +2 -0
  210. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
  211. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
  212. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
  213. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
  214. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
  215. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
  216. package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
  217. package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
  218. package/lib/exercises/math/sequences/notation/index.js +2 -0
  219. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
  220. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
  221. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
  222. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
  223. package/lib/exercises/vea/cartesianLineVEA.d.ts +2 -0
  224. package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
  225. package/lib/exercises/vea/cartesianLineVEA.js +1 -0
  226. package/lib/exercises/vea/pointVEA.d.ts +2 -0
  227. package/lib/exercises/vea/pointVEA.d.ts.map +1 -0
  228. package/lib/exercises/vea/pointVEA.js +7 -0
  229. package/lib/index.d.ts +164 -1
  230. package/lib/index.d.ts.map +1 -1
  231. package/lib/math/geometry/circle.d.ts +6 -0
  232. package/lib/math/geometry/circle.d.ts.map +1 -1
  233. package/lib/math/geometry/circle.js +16 -0
  234. package/lib/math/geometry/line.d.ts +2 -0
  235. package/lib/math/geometry/line.d.ts.map +1 -1
  236. package/lib/math/geometry/line.js +7 -0
  237. package/lib/math/geometry/point.d.ts +1 -0
  238. package/lib/math/geometry/point.d.ts.map +1 -1
  239. package/lib/math/geometry/point.js +5 -0
  240. package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
  241. package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
  242. package/lib/math/geometry/polygons/relationPP.js +41 -0
  243. package/lib/math/polynomials/trinom.d.ts +1 -1
  244. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  245. package/lib/math/polynomials/trinom.js +15 -6
  246. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  247. package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
  248. package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
  249. package/lib/math/utils/geometry/randomVecs2.js +34 -0
  250. package/lib/tests/questionTest.d.ts.map +1 -1
  251. package/lib/tests/questionTest.js +2 -2
  252. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
  253. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  254. package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
  255. package/lib/tree/nodes/functions/expNode.d.ts +1 -1
  256. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  257. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
  258. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  259. package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
  260. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  261. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  262. package/lib/tree/nodes/operators/fractionNode.js +6 -4
  263. package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
  264. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  265. package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
  266. package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
  267. package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
  268. package/package.json +1 -1
@@ -39,11 +39,14 @@ const getAnswer = (identifiers) => {
39
39
  const isPlausible = rand < 2;
40
40
  return ["Oui", "Non"][isPlausible ? 0 : 1];
41
41
  };
42
- const getInstruction = () => {
42
+ const getInstruction = (identifiers) => {
43
+ const { s } = identifiers;
43
44
  return `La figure ci-dessous montre une portion
44
45
  de la courbe représentative d'une fonction $f$ (en rouge)
45
46
  et une de ses tangentes (en bleu).
46
47
 
48
+ La pente de la tangente vaut environ $${round(s, 2).frenchify()}$.
49
+
47
50
  En considérant ce qui est représenté de $f$, peut-il s'agir de la fonction exponentielle ?`;
48
51
  };
49
52
  const getHint = () => {
@@ -53,8 +56,6 @@ $$
53
56
  \\exp'(x)=\\exp(x) > 0
54
57
  $$
55
58
 
56
- Sa courbe représentative est toujours au-dessus de ses tangentes.
57
-
58
59
  `;
59
60
  };
60
61
  const getCorrection = (identifiers) => {
@@ -69,8 +70,6 @@ pour l'abscisse $x_{0}$ où est tracée la tangente :
69
70
 
70
71
  - $f'(x_{0})>0$
71
72
 
72
- - la tangente est en dessous de la courbe.
73
-
74
73
  Il peut donc s'agir de la fonction exponentielle.
75
74
 
76
75
  (Et en effet, ici, $f=\\exp$).
@@ -85,8 +84,6 @@ pour l'abscisse $x_{0}$ où est tracée la tangente :
85
84
 
86
85
  - $f'(x_{0})>0$
87
86
 
88
- - la tangente est en dessous de la courbe.
89
-
90
87
  Il peut donc s'agir de la fonction exponentielle.
91
88
 
92
89
  (En fait, ici, $f$ est une parabole).
@@ -159,27 +156,21 @@ const getCorrectionGGBOptions = (identifiers) => {
159
156
  });
160
157
  };
161
158
  const getGGBOptions = (identifiers) => {
162
- const { nodeIdsF, nodeIdsT, coordsFrame, s } = identifiers;
159
+ const { nodeIdsF, nodeIdsT, coordsFrame } = identifiers;
163
160
  const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
164
161
  const nodeT = NodeConstructor.fromIdentifiers(nodeIdsT);
165
162
  const [xMin, xMax, yMin, yMax] = coordsFrame;
166
- const xCenter = (xMin + xMax) / 2.0;
167
- const yCenter = (yMin + yMax) / 2.0;
168
163
  const commands = [
169
164
  `Cf = ${nodeF.toMathString()}`,
170
165
  `SetColor(Cf, "${red}")`,
171
166
  `Ct = ${nodeT.toMathString()}`,
172
167
  `SetColor(Ct, "${blueLight}")`,
173
- //label with slope
174
- `Lbl = Text("$\\large \\text{pente}\\approx${round(s, 2).frenchify()}$", (${xCenter},${yCenter}), false, true, 0, 0)`,
175
- `SetFixed(Lbl, true, false)`,
176
168
  ];
177
169
  const ggb = new GeogebraConstructor({
178
170
  commands,
179
171
  xAxis: {
180
172
  hidden: true,
181
173
  },
182
- hideGrid: true,
183
174
  lockedAxesRatio: (xMax - xMin) / (yMax - yMin),
184
175
  forbidShiftDragZoom: true,
185
176
  });
@@ -190,7 +181,7 @@ const getGGBOptions = (identifiers) => {
190
181
  const getIsPlausibleExpFromGraphQuestion = () => {
191
182
  let x;
192
183
  let nodeF;
193
- const rand = random([random([0, 1]), random([2, 3, 4, 5, 6])]);
184
+ const rand = random([random([0, 1]), random([2, 3 /*4, 5, 6*/])]);
194
185
  switch (rand) {
195
186
  case 0:
196
187
  {
@@ -1 +1 @@
1
- {"version":3,"file":"expFactorization.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/expFactorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAkKF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
1
+ {"version":3,"file":"expFactorization.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/expFactorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA8KF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
@@ -10,16 +10,23 @@ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
10
10
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
11
11
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
12
12
  import { isOppositeNode } from "../../../../tree/nodes/functions/oppositeNode.js";
13
- const getPropositions = (n, { answer, ...identifiers }) => {
14
- const propositions = [];
15
- const { uA } = identifiers;
16
- addValidProp(propositions, answer);
13
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
14
+ const getInstructionNode = (identifiers) => {
15
+ const { a, b, c, d, e, f, uA } = identifiers;
17
16
  const expNode = exp(multiply(uA, "x"));
18
- propWhile(propositions, n, () => {
19
- const affine = AffineConstructor.random();
20
- tryToAddWrongProp(propositions, multiply(affine.toTree(), expNode).toTex());
21
- });
22
- return shuffleProps(propositions, n);
17
+ return add(multiply(a, multiply(add(multiply(b, "x"), c).simplify({
18
+ forbidFactorize: true,
19
+ }), expNode)), multiply(d, multiply(add(multiply(e, "x"), f).simplify({
20
+ forbidFactorize: true,
21
+ }), expNode)));
22
+ };
23
+ const getInstruction = (identifiers) => {
24
+ const node = getInstructionNode(identifiers);
25
+ return `Factoriser l'expression suivante :
26
+
27
+ $$
28
+ ${node.toTex()}
29
+ $$`;
23
30
  };
24
31
  const getAnswerNode = (identifiers) => {
25
32
  const { a, b, c, d, e, f, uA } = identifiers;
@@ -41,40 +48,45 @@ const getAnswerNode = (identifiers) => {
41
48
  const getAnswer = (identifiers) => {
42
49
  return getAnswerNode(identifiers).toTex();
43
50
  };
44
- const getInstruction = (identifiers) => {
51
+ const getHint = () => {
52
+ return `Y a-t-il un facteur commun entre les deux termes ?`;
53
+ };
54
+ const getCorrection = (identifiers) => {
45
55
  const { a, b, c, d, e, f, uA } = identifiers;
46
56
  const expNode = exp(multiply(uA, "x"));
47
- const node = add(multiply(a, multiply(add(multiply(b, "x"), c).simplify({
57
+ const firstTerm = multiply(a, add(multiply(b, "x"), c)).simplify({
58
+ towardsDistribute: true,
48
59
  forbidFactorize: true,
49
- }), expNode)), multiply(d, multiply(add(multiply(e, "x"), f).simplify({
60
+ });
61
+ const secondTerm = multiply(d, add(multiply(e, "x"), f)).simplify({
62
+ towardsDistribute: true,
50
63
  forbidFactorize: true,
51
- }), expNode)));
52
- return `Factoriser l'expression suivante :
64
+ });
65
+ return `On peut choisir $${expNode.toTex()}$ comme facteur commun.
66
+
67
+ ${alignTex([
68
+ ["", "", `${getInstructionNode(identifiers).toTex()}`],
69
+ [
70
+ "",
71
+ "=",
72
+ `${expNode.toTex()}((${firstTerm.toTex()}) + (${secondTerm.toTex()}))`,
73
+ ],
74
+ ["", "=", `${getAnswer(identifiers)}`],
75
+ ])}
53
76
 
54
- $$
55
- ${node.toTex()}
56
- $$`;
77
+ `;
78
+ };
79
+ const getPropositions = (n, { answer, ...identifiers }) => {
80
+ const propositions = [];
81
+ const { uA } = identifiers;
82
+ addValidProp(propositions, answer);
83
+ const expNode = exp(multiply(uA, "x"));
84
+ propWhile(propositions, n, () => {
85
+ const affine = AffineConstructor.random();
86
+ tryToAddWrongProp(propositions, multiply(affine.toTree(), expNode).toTex());
87
+ });
88
+ return shuffleProps(propositions, n);
57
89
  };
58
- // const getHint: GetHint<Identifiers> = () => {
59
- // return `Pour factoriser une expression avec des exponentielles :
60
- // 1) Repérer le facteur exponentiel commun
61
- // 2) Mettre en facteur $e^{u(x)}$
62
- // 3) Factoriser l'expression entre parenthèses`;
63
- // };
64
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
65
- // const operator = isAdd ? "+" : "-";
66
- // const step1 = `(${a}x${b >= 0 ? "+" : ""}${b})e^{${u}} ${operator} (${c}x${
67
- // d >= 0 ? "+" : ""
68
- // }${d})e^{${u}}`;
69
- // const step2 = `e^{${u}}((${a}x${b >= 0 ? "+" : ""}${b}) ${operator} (${c}x${
70
- // d >= 0 ? "+" : ""
71
- // }${d}))`;
72
- // return `${alignTex([
73
- // ["", step1],
74
- // ["=", step2],
75
- // ])}
76
- // On a mis en facteur $e^{${u}}$ qui est le terme exponentiel commun.`;
77
- // };
78
90
  const getKeys = () => {
79
91
  return ["epower", "x"];
80
92
  };
@@ -129,8 +141,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
129
141
  keys: getKeys(identifiers),
130
142
  answerFormat: "tex",
131
143
  identifiers,
132
- // hint: getHint(identifiers),
133
- // correction: getCorrection(identifiers),
144
+ hint: getHint(identifiers),
145
+ correction: getCorrection(identifiers),
134
146
  };
135
147
  return question;
136
148
  };
@@ -146,9 +158,9 @@ export const expFactorization = {
146
158
  isAnswerValid,
147
159
  subject: "Mathématiques",
148
160
  getInstruction,
149
- // getHint,
150
- // getCorrection,
161
+ getHint,
162
+ getCorrection,
151
163
  getAnswer,
152
- // hasHintAndCorrection: true,
164
+ hasHintAndCorrection: true,
153
165
  getQuestionFromIdentifiers,
154
166
  };
@@ -1,4 +1,6 @@
1
1
  export * from "./expEquation.js";
2
2
  export * from "./expSimplifiying.js";
3
3
  export * from "./expFactorization.js";
4
+ export * from "./algebraic/index.js";
5
+ export * from "./definition/index.js";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from "./expEquation.js";
2
2
  export * from "./expSimplifiying.js";
3
3
  export * from "./expFactorization.js";
4
+ export * from "./algebraic/index.js";
5
+ export * from "./definition/index.js";
@@ -132,3 +132,6 @@ export const secondDegreeInequation = {
132
132
  pdfOptions: { shouldSpreadPropositions: true },
133
133
  getQuestionFromIdentifiers,
134
134
  };
135
+ // export const reuseSecondDegreeInequation = {
136
+ // getAnswerNode,
137
+ // };
@@ -1,2 +1,3 @@
1
1
  export * from "./factorizedFormFromRoots.js";
2
+ export * from "./trinomDevelopFactorizedForm.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/factoForm/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/factoForm/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from "./factorizedFormFromRoots.js";
2
+ export * from "./trinomDevelopFactorizedForm.js";
@@ -0,0 +1,13 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ aIds: NodeIdentifiers;
5
+ x1Ids: NodeIdentifiers;
6
+ x2Ids: NodeIdentifiers;
7
+ };
8
+ type Options = {
9
+ rootsNb: string;
10
+ };
11
+ export declare const trinomDevelopFactorizedForm: Exercise<Identifiers, Options>;
12
+ export {};
13
+ //# sourceMappingURL=trinomDevelopFactorizedForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trinomDevelopFactorizedForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAsIF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAYF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBtE,CAAC"}
@@ -0,0 +1,147 @@
1
+ import { addValidProp, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, propWhile, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../../math/utils/random/randint.js";
4
+ import { reifyAlgebraic, } from "../../../../../tree/nodes/nodeConstructor.js";
5
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { square } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
8
+ import { polynomialParser } from "../../../../../tree/parsers/polynomialParser.js";
9
+ import { probaFlip } from "../../../../../utils/alea/probaFlip.js";
10
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
11
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
12
+ const getPropositions = (n, { answer }) => {
13
+ const propositions = [];
14
+ addValidProp(propositions, answer);
15
+ propWhile(propositions, n, () => {
16
+ const aIds = randint(-9, 10, [0]).toTree().toIdentifiers();
17
+ const x1Ids = randint(-9, 10, [0]).toTree().toIdentifiers();
18
+ const x2Ids = randint(-9, 10, [0]).toTree().toIdentifiers();
19
+ tryToAddWrongProp(propositions, getAnswer({
20
+ aIds,
21
+ x1Ids,
22
+ x2Ids,
23
+ }));
24
+ });
25
+ return shuffleProps(propositions, n);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ return getFacto(identifiers)
29
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
30
+ .toTex();
31
+ };
32
+ const getFacto = (identifiers) => {
33
+ const { aIds, x1Ids, x2Ids } = identifiers;
34
+ const a = reifyAlgebraic(aIds);
35
+ const x1 = reifyAlgebraic(x1Ids);
36
+ const x2 = reifyAlgebraic(x2Ids);
37
+ if (x1.evaluate() === x2.evaluate()) {
38
+ return multiply(a, square(substract("x", x1).simplify()));
39
+ }
40
+ return multiply(a, multiply(substract("x", x1).simplify(), substract("x", x2).simplify()));
41
+ };
42
+ const getInstruction = (identifiers) => {
43
+ return `Soit $f$ la fonction polynôme du second degré dont la forme factorisée est :
44
+
45
+ $$
46
+ f(x) = ${getFacto(identifiers).toTex()}
47
+ $$
48
+
49
+ Donner la forme dévelopée de $f$.`;
50
+ };
51
+ const getHint = () => {
52
+ return `Il suffit de développer puis de réduire la forme factorisée de $f$.`;
53
+ };
54
+ const getCorrection = (identifiers) => {
55
+ const { aIds, x1Ids, x2Ids } = identifiers;
56
+ const a = reifyAlgebraic(aIds);
57
+ const x1 = reifyAlgebraic(x1Ids);
58
+ const x2 = reifyAlgebraic(x2Ids);
59
+ return `On développe la forme factorisée de $f$ :
60
+
61
+ ${alignTex([
62
+ ["f(x)", "=", getFacto(identifiers).toTex()],
63
+ [
64
+ "",
65
+ "=",
66
+ multiply(a, multiply(substract("x", x1), substract("x", x2)).simplify({
67
+ towardsDistribute: true,
68
+ forbidFactorize: true,
69
+ })).toTex(),
70
+ ],
71
+ ["", "=", getAnswer(identifiers)],
72
+ ])}
73
+
74
+ `;
75
+ };
76
+ const getKeys = () => {
77
+ return ["x"];
78
+ };
79
+ const isAnswerValid = (ans, { answer }) => {
80
+ try {
81
+ const parsed = polynomialParser(ans);
82
+ if (!parsed)
83
+ return false;
84
+ return (parsed
85
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
86
+ .toTex() === answer);
87
+ }
88
+ catch (err) {
89
+ return handleVEAError(err);
90
+ }
91
+ };
92
+ const getTrinomDevelopFactorizedFormQuestion = (opts) => {
93
+ const a = randint(-9, 10, [0, 1]).toTree();
94
+ const isSameRoot = opts?.rootsNb === "Une"
95
+ ? true
96
+ : opts?.rootsNb === "Deux"
97
+ ? false
98
+ : probaFlip(0.3);
99
+ const x1 = randint(-10, 10, [0]);
100
+ const x2 = isSameRoot ? x1 : randint(-10, 10, [0, x1]);
101
+ const identifiers = {
102
+ aIds: a.toIdentifiers(),
103
+ x1Ids: x1.toTree().toIdentifiers(),
104
+ x2Ids: x2.toTree().toIdentifiers(),
105
+ };
106
+ return getQuestionFromIdentifiers(identifiers);
107
+ };
108
+ const getQuestionFromIdentifiers = (identifiers) => {
109
+ return {
110
+ answer: getAnswer(identifiers),
111
+ instruction: getInstruction(identifiers),
112
+ keys: getKeys(identifiers),
113
+ answerFormat: "tex",
114
+ identifiers,
115
+ hint: getHint(identifiers),
116
+ correction: getCorrection(identifiers),
117
+ };
118
+ };
119
+ const options = [
120
+ {
121
+ id: "rootsNb",
122
+ label: "Nombre de racines",
123
+ target: GeneratorOptionTarget.generation,
124
+ type: GeneratorOptionType.select,
125
+ values: ["Une", "Deux", "Une ou deux aléatoirement"],
126
+ defaultValue: "Une ou deux aléatoirement",
127
+ },
128
+ ];
129
+ export const trinomDevelopFactorizedForm = {
130
+ id: "trinomDevelopFactorizedForm",
131
+ connector: "=",
132
+ label: "Développer une forme factorisée du type $a(x-x_1)(x-x_2)$",
133
+ isSingleStep: true,
134
+ generator: (nb, opts) => getDistinctQuestions(() => getTrinomDevelopFactorizedFormQuestion(opts), nb),
135
+ qcmTimer: 60,
136
+ freeTimer: 60,
137
+ getPropositions,
138
+ isAnswerValid,
139
+ subject: "Mathématiques",
140
+ getInstruction,
141
+ getHint,
142
+ getCorrection,
143
+ getAnswer,
144
+ getQuestionFromIdentifiers,
145
+ hasHintAndCorrection: true,
146
+ options,
147
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"niceRootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAYtD,CAAC"}
1
+ {"version":3,"file":"niceRootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
@@ -2,9 +2,17 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../../exer
2
2
  import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
4
4
  import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { opposite } from "../../../../../tree/nodes/functions/oppositeNode.js";
6
+ import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
7
+ import { add } from "../../../../../tree/nodes/operators/addNode.js";
8
+ import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { square } from "../../../../../tree/nodes/operators/powerNode.js";
11
+ import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
5
12
  import { discreteSetParser } from "../../../../../tree/parsers/discreteSetParser.js";
6
13
  import { shuffle } from "../../../../../utils/alea/shuffle.js";
7
14
  import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
15
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
8
16
  const getInstruction = (identifiers) => {
9
17
  const { a, b, c } = identifiers;
10
18
  const trinom = new Trinom(a, b, c);
@@ -27,6 +35,91 @@ const getRootsFromDevFormQuestion = () => {
27
35
  const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
28
36
  return getQuestionFromIdentifiers(identifiers);
29
37
  };
38
+ const getHint = () => {
39
+ return `Calcule le déterminant $\\Delta$ de $f$ :
40
+
41
+ $$
42
+ \\Delta = b^2 -4ac
43
+ $$
44
+
45
+ Alors, l'équation $f(x) = 0$ :
46
+ - n'admet pas de solution réelle si $\\Delta<0$;
47
+ - admet une solution $x_0 = \\frac{-b}{2a}$ si $\\Delta=0$;
48
+ - admet deux solutions $x_1 = \\frac{-b-\\sqrt{\\Delta}}{2a}$ et $x_2 = \\frac{-b+\\sqrt{\\Delta}}{2a}$ si $\\Delta>0$.
49
+ `;
50
+ };
51
+ const getCorrection = (identifiers) => {
52
+ const { a, b, c } = identifiers;
53
+ const delta = substract(square(b), multiply(4, multiply(a, c))).simplify();
54
+ const deltaEv = delta.evaluate();
55
+ const hasNoSol = deltaEv < 0;
56
+ const hasOneSol = deltaEv === 0;
57
+ let corr = `On calcule le discriminant :
58
+
59
+ ${alignTex([
60
+ ["\\Delta", "=", "b^2 - 4ac"],
61
+ ["", "=", substract(square(b), multiply(4, multiply(a, c))).toTex()],
62
+ ["", "=", delta.toTex()],
63
+ ])}`;
64
+ if (hasNoSol) {
65
+ corr += `
66
+
67
+ Puisque $\\Delta<0$, l'équation $f(x) = 0$ n'admet donc pas de solution réelle.`;
68
+ }
69
+ else if (hasOneSol) {
70
+ corr += `
71
+
72
+ Puisque $\\Delta = 0$, l'équation $f(x)=0$ admet une solution $x_0$ :
73
+
74
+ ${alignTex([
75
+ ["x_0", "=", "\\frac{-b}{2a}"],
76
+ ["", "=", frac(opposite(b), multiply(2, a)).toTex()],
77
+ ["", "=", frac(opposite(b), multiply(2, a)).simplify().toTex()],
78
+ ])}
79
+
80
+ L'ensemble des solutions est donc :
81
+
82
+ $$
83
+ ${getAnswer(identifiers)}
84
+ $$`;
85
+ }
86
+ else {
87
+ corr += `
88
+
89
+ Puisque $\\Delta > 0$, l'équation $f(x)=0$ admet deux solutions :
90
+
91
+ ${alignTex([
92
+ ["x_1", "=", "\\frac{-b-\\sqrt{\\Delta}}{2a}"],
93
+ ["", "=", frac(substract(opposite(b), sqrt(delta)), multiply(2, a)).toTex()],
94
+ [
95
+ "",
96
+ "=",
97
+ frac(substract(opposite(b), sqrt(delta)), multiply(2, a))
98
+ .simplify()
99
+ .toTex(),
100
+ ],
101
+ ])}
102
+
103
+ ${alignTex([
104
+ ["x_2", "=", "\\frac{-b+\\sqrt{\\Delta}}{2a}"],
105
+ ["", "=", frac(add(opposite(b), sqrt(delta)), multiply(2, a)).toTex()],
106
+ [
107
+ "",
108
+ "=",
109
+ frac(add(opposite(b), sqrt(delta)), multiply(2, a))
110
+ .simplify()
111
+ .toTex(),
112
+ ],
113
+ ])}
114
+ L'ensemble des solutions est donc :
115
+
116
+ $$
117
+ ${getAnswer(identifiers)}
118
+ $$
119
+ `;
120
+ }
121
+ return corr;
122
+ };
30
123
  const getQuestionFromIdentifiers = (identifiers) => {
31
124
  const question = {
32
125
  answer: getAnswer(identifiers),
@@ -34,6 +127,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
34
127
  keys: ["S", "equal", "lbrace", "semicolon", "rbrace", "varnothing"],
35
128
  identifiers,
36
129
  answerFormat: "tex",
130
+ hint: getHint(identifiers),
131
+ correction: getCorrection(identifiers),
37
132
  };
38
133
  return question;
39
134
  };
@@ -72,4 +167,5 @@ export const niceRootsFromDevForm = {
72
167
  freeTimer: 60,
73
168
  subject: "Mathématiques",
74
169
  getQuestionFromIdentifiers,
170
+ hasHintAndCorrection: true,
75
171
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
1
+ {"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqMF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}