math-exercises 3.0.57 → 3.0.59

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 (256) hide show
  1. package/lib/exercises/exercise.d.ts +1 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +46 -17
  5. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +8 -2
  7. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +15 -11
  9. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +4 -5
  11. package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +4 -2
  13. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/fractions/fractionSquare.js +0 -4
  15. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts +6 -3
  16. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +63 -28
  18. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -4
  20. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +0 -4
  22. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -1
  23. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +0 -4
  24. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  25. package/lib/exercises/math/calcul/fractions/fractionsSum.js +33 -12
  26. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  27. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  28. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  29. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  30. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  31. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  32. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  33. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  34. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  35. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  37. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  38. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  39. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  40. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  41. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  42. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  43. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  44. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  45. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  46. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  47. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  48. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  56. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  57. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  58. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  59. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  60. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  61. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  62. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  63. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  64. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  65. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  66. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  67. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  68. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  69. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  70. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  71. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  72. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  77. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  78. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  79. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  80. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  81. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  101. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  102. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  103. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  104. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  105. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  106. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  107. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  108. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  110. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  111. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  112. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  113. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  114. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  122. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  123. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  124. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  125. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  126. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  137. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  138. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  139. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  140. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  141. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  142. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  143. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  144. package/lib/exercises/math/derivation/index.d.ts +2 -0
  145. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  146. package/lib/exercises/math/derivation/index.js +2 -0
  147. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  148. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  149. package/lib/exercises/math/derivation/variations/index.js +1 -0
  150. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  151. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  152. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  153. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  154. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  155. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  156. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  157. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  158. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  159. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  160. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  161. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  162. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  163. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  164. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  165. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  166. package/lib/exercises/math/equaDiff/index.js +1 -1
  167. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  168. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  169. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  170. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  171. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  172. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  173. package/lib/exercises/math/geometry/areas/circleArea.js +1 -1
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  175. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  176. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  177. package/lib/exercises/math/percent/findProportion.js +1 -1
  178. package/lib/exercises/math/percent/findTVA.js +1 -1
  179. package/lib/exercises/math/percent/htToTTC.js +1 -1
  180. package/lib/exercises/math/percent/reciprocalPercentage.js +1 -1
  181. package/lib/exercises/math/percent/ttcToHT.js +1 -1
  182. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  183. package/lib/exercises/math/powers/powersOfTenToDecimal.js +1 -0
  184. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  185. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  186. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  187. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  188. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  189. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  190. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  191. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  192. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  193. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  194. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  195. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  196. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  197. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  198. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  199. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  200. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  201. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  202. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  203. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  204. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  205. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  206. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  207. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  208. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  209. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  210. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  211. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  212. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  213. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  214. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  215. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  216. package/lib/exercises/math/squareRoots/simpifySquareRoot.d.ts.map +1 -1
  217. package/lib/exercises/math/squareRoots/simpifySquareRoot.js +4 -4
  218. package/lib/exercises/math/squareRoots/squareRootEquation.d.ts.map +1 -1
  219. package/lib/exercises/math/squareRoots/squareRootEquation.js +4 -4
  220. package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts +1 -0
  221. package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
  222. package/lib/exercises/math/squareRoots/squareRootIdentities.js +64 -40
  223. package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
  224. package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +36 -23
  225. package/lib/exercises/math/squareRoots/squareRootsFractions.d.ts.map +1 -1
  226. package/lib/exercises/math/squareRoots/squareRootsFractions.js +4 -1
  227. package/lib/exercises/math/squareRoots/squareRootsProducts.d.ts.map +1 -1
  228. package/lib/exercises/math/squareRoots/squareRootsProducts.js +4 -1
  229. package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
  230. package/lib/exercises/math/squareRoots/squareRootsSum.js +4 -2
  231. package/lib/exercises/math/squareRoots/squareRootsToSquare.d.ts.map +1 -1
  232. package/lib/exercises/math/squareRoots/squareRootsToSquare.js +4 -2
  233. package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
  234. package/lib/exercises/math/trigonometry/arcValue.js +67 -31
  235. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  236. package/lib/exercises/math/trigonometry/associatePoint.js +33 -16
  237. package/lib/exercises/math/trigonometry/basicEquationSin.js +6 -6
  238. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +3 -3
  239. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  240. package/lib/exercises/math/trigonometry/trigonometry.js +0 -5
  241. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  242. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +0 -5
  243. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  244. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +0 -5
  245. package/lib/exercises/pc/index.d.ts +5 -5
  246. package/lib/exercises/pc/index.d.ts.map +1 -1
  247. package/lib/exercises/pc/index.js +5 -5
  248. package/lib/index.d.ts +48 -44
  249. package/lib/index.d.ts.map +1 -1
  250. package/lib/tree/nodes/functions/logNode.js +2 -4
  251. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  252. package/lib/tree/nodes/operators/fractionNode.js +4 -0
  253. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  254. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  255. package/lib/tree/parsers/latexParser.js +6 -2
  256. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { CosNode } from "../../../../../tree/nodes/functions/cosNode.js";
5
+ import { OppositeNode } from "../../../../../tree/nodes/functions/oppositeNode.js";
6
+ import { SinNode } from "../../../../../tree/nodes/functions/sinNode.js";
7
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
9
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
10
+ const getInstruction = (identifiers) => {
11
+ const { affineA, affineB } = identifiers;
12
+ const affine = new Affine(affineA, affineB);
13
+ const fct = new CosNode(affine.toTree());
14
+ return `Déterminer la dérivée de la fonction $f$ définie par :
15
+
16
+ $$
17
+ f(x) = ${fct.toTex()}
18
+ $$`;
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { affineA, affineB } = identifiers;
22
+ const affine = new Affine(affineA, affineB);
23
+ const deriv = new MultiplyNode((-affine.a).toTree(), new SinNode(affine.toTree()));
24
+ return deriv.toTex();
25
+ };
26
+ const getCosCompositionDerivationQuestion = () => {
27
+ const affine = AffineConstructor.random(undefined, { excludes: [0] });
28
+ const identifiers = { affineA: affine.a, affineB: affine.b };
29
+ const question = {
30
+ answer: getAnswer(identifiers),
31
+ instruction: getInstruction(identifiers),
32
+ keys: ["x", "sin", "cos", "tan"],
33
+ answerFormat: "tex",
34
+ identifiers,
35
+ };
36
+ return question;
37
+ };
38
+ const getPropositions = (n, { answer, affineA, affineB }) => {
39
+ const propositions = [];
40
+ addValidProp(propositions, answer);
41
+ const affine = new Affine(affineA, affineB);
42
+ const affineTree = affine.toTree();
43
+ const fct = new CosNode(affineTree);
44
+ const sin = new SinNode(affineTree);
45
+ tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), sin).toTex());
46
+ tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), fct).toTex());
47
+ tryToAddWrongProp(propositions, new MultiplyNode((-affineA).toTree(), fct).toTex());
48
+ tryToAddWrongProp(propositions, sin.toTex());
49
+ tryToAddWrongProp(propositions, new OppositeNode(sin).toTex());
50
+ return shuffleProps(propositions, n);
51
+ };
52
+ const isAnswerValid = (ans, { answer, affineA, affineB }) => {
53
+ try {
54
+ const parsed = parseAlgebraic(ans);
55
+ if (!parsed)
56
+ return false;
57
+ return (parsed
58
+ .simplify({
59
+ towardsDistribute: true,
60
+ forbidFactorize: true,
61
+ })
62
+ .toTex() === answer);
63
+ }
64
+ catch (err) {
65
+ return handleVEAError(err);
66
+ }
67
+ };
68
+ export const cosCompositionDerivation = {
69
+ id: "cosCompositionDerivation",
70
+ connector: "=",
71
+ label: "Dérivée de $\\cos(ax+b)$",
72
+ isSingleStep: true,
73
+ generator: (nb) => getDistinctQuestions(getCosCompositionDerivationQuestion, nb),
74
+ qcmTimer: 60,
75
+ freeTimer: 60,
76
+ getPropositions,
77
+ isAnswerValid,
78
+ subject: "Mathématiques",
79
+ getAnswer,
80
+ getInstruction,
81
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ affinecoeffs: number[];
4
+ };
5
+ export declare const cosSecondDegreeDerivative: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=cosSecondDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cosSecondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA+HF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { CosNode } from "../../../../../tree/nodes/functions/cosNode.js";
5
+ import { SinNode } from "../../../../../tree/nodes/functions/sinNode.js";
6
+ import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
7
+ import { AddNode } from "../../../../../tree/nodes/operators/addNode.js";
8
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
10
+ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
11
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
12
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
13
+ const getInstruction = (identifiers) => {
14
+ const { affinecoeffs } = identifiers;
15
+ const affine = AffineConstructor.fromCoeffs(affinecoeffs);
16
+ const func = new CosNode(affine.toTree().simplify({ forbidFactorize: true })).toTex();
17
+ return `Calculez la dérivée seconde de la fonction $f$ définie par :
18
+
19
+ $$
20
+ f(x) = ${func}
21
+ $$`;
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { affinecoeffs } = identifiers;
25
+ const affine = AffineConstructor.fromCoeffs(affinecoeffs);
26
+ const ans = new MultiplyNode(new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new NumberNode(-1)), new CosNode(affine.toTree().simplify({ forbidFactorize: true })))
27
+ .simplify({ forbidFactorize: true })
28
+ .toTex();
29
+ return ans;
30
+ };
31
+ const getCosSecondDegreeDerivativeQuestion = () => {
32
+ const affine = AffineConstructor.random();
33
+ const affinecoeffs = affine.coefficients;
34
+ const identifiers = { affinecoeffs };
35
+ const question = {
36
+ answer: getAnswer(identifiers),
37
+ instruction: getInstruction(identifiers),
38
+ keys: ["x", "sin", "cos", "tan"],
39
+ answerFormat: "tex",
40
+ identifiers,
41
+ };
42
+ return question;
43
+ };
44
+ const getPropositions = (n, { answer, affinecoeffs }) => {
45
+ const propositions = [];
46
+ addValidProp(propositions, answer);
47
+ const affine = new AddNode(new MultiplyNode(new NumberNode(affinecoeffs[1]), new VariableNode("x")), new NumberNode(affinecoeffs[0])).simplify({ forbidFactorize: true });
48
+ const wronganswer1 = new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new CosNode(affine))
49
+ .simplify()
50
+ .toTex();
51
+ const wronganswer2 = new MultiplyNode(new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new NumberNode(-1)), new SinNode(affine))
52
+ .simplify()
53
+ .toTex();
54
+ const wronganswer3 = new MultiplyNode(affinecoeffs[1].toTree(), new SinNode(affine))
55
+ .simplify()
56
+ .toTex();
57
+ const wronganswer4 = new MultiplyNode(affinecoeffs[1].toTree(), new CosNode(affine))
58
+ .simplify()
59
+ .toTex();
60
+ const wronganswer5 = affine.toTex();
61
+ tryToAddWrongProp(propositions, wronganswer1);
62
+ tryToAddWrongProp(propositions, wronganswer2);
63
+ tryToAddWrongProp(propositions, wronganswer3);
64
+ tryToAddWrongProp(propositions, wronganswer4);
65
+ tryToAddWrongProp(propositions, wronganswer5);
66
+ while (propositions.length < n) {
67
+ const random = AffineConstructor.random();
68
+ const randomwronganswer = new MultiplyNode(random.a.toTree(), new SinNode(random.toTree().simplify({ forbidFactorize: true })))
69
+ .simplify()
70
+ .toTex();
71
+ tryToAddWrongProp(propositions, randomwronganswer);
72
+ }
73
+ return shuffleProps(propositions, n);
74
+ };
75
+ const isAnswerValid = (ans, { answer, affinecoeffs }) => {
76
+ try {
77
+ const parsed = parseAlgebraic(ans);
78
+ if (!parsed)
79
+ return false;
80
+ return (parsed
81
+ .simplify({
82
+ towardsDistribute: true,
83
+ forbidFactorize: true,
84
+ })
85
+ .toTex() === answer);
86
+ }
87
+ catch (err) {
88
+ return handleVEAError(err);
89
+ }
90
+ };
91
+ export const cosSecondDegreeDerivative = {
92
+ id: "cosSecondDegreeDerivative",
93
+ label: "Dérivée seconde de $\\cos(u)$",
94
+ isSingleStep: true,
95
+ generator: (nb) => getDistinctQuestions(getCosSecondDegreeDerivativeQuestion, nb),
96
+ qcmTimer: 60,
97
+ freeTimer: 60,
98
+ getPropositions,
99
+ isAnswerValid,
100
+ subject: "Mathématiques",
101
+ getAnswer,
102
+ getInstruction,
103
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./cosCompositionDerivation.js";
2
+ export * from "./sinCompositionDerivation.js";
3
+ export * from "./sinSecondDegreeDerivative.js";
4
+ export * from "./cosSecondDegreeDerivative.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/trigo/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./cosCompositionDerivation.js";
2
+ export * from "./sinCompositionDerivation.js";
3
+ export * from "./sinSecondDegreeDerivative.js";
4
+ export * from "./cosSecondDegreeDerivative.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ affineA: number;
4
+ affineB: number;
5
+ };
6
+ export declare const sinCompositionDerivation: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=sinCompositionDerivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sinCompositionDerivation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { CosNode } from "../../../../../tree/nodes/functions/cosNode.js";
5
+ import { OppositeNode } from "../../../../../tree/nodes/functions/oppositeNode.js";
6
+ import { SinNode } from "../../../../../tree/nodes/functions/sinNode.js";
7
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ const getInstruction = (identifiers) => {
9
+ const { affineA, affineB } = identifiers;
10
+ const affine = new Affine(affineA, affineB);
11
+ const fct = new SinNode(affine.toTree());
12
+ return `Déterminer la dérivée de la fonction $f$ définie sur $\\mathbb{R}$ par :
13
+
14
+ $$
15
+ f(x) = ${fct.toTex()}
16
+ $$`;
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { affineA, affineB } = identifiers;
20
+ const affine = new Affine(affineA, affineB);
21
+ const deriv = new MultiplyNode(affine.a.toTree(), new CosNode(affine.toTree()));
22
+ return deriv.toTex();
23
+ };
24
+ const getSinCompositionDerivationQuestion = () => {
25
+ const affine = AffineConstructor.random(undefined, { excludes: [0] });
26
+ const identifiers = { affineA: affine.a, affineB: affine.b };
27
+ const question = {
28
+ answer: getAnswer(identifiers),
29
+ instruction: getInstruction(identifiers),
30
+ keys: ["x", "sin", "cos", "tan"],
31
+ answerFormat: "tex",
32
+ identifiers,
33
+ };
34
+ return question;
35
+ };
36
+ const getPropositions = (n, { answer, affineA, affineB }) => {
37
+ const propositions = [];
38
+ addValidProp(propositions, answer);
39
+ const affine = new Affine(affineA, affineB);
40
+ const affineTree = affine.toTree();
41
+ const sin = new SinNode(affineTree);
42
+ const cos = new CosNode(affineTree);
43
+ tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), sin).toTex());
44
+ tryToAddWrongProp(propositions, cos.toTex());
45
+ tryToAddWrongProp(propositions, new MultiplyNode((-affineA).toTree(), cos).toTex());
46
+ tryToAddWrongProp(propositions, new OppositeNode(cos).toTex());
47
+ tryToAddWrongProp(propositions, new SinNode(affineA.toTree()).simplify().toTex());
48
+ tryToAddWrongProp(propositions, new CosNode(affineA.toTree()).simplify().toTex());
49
+ return shuffleProps(propositions, n);
50
+ };
51
+ const isAnswerValid = (ans, { answer, affineA, affineB }) => {
52
+ const affine = new Affine(affineA, affineB);
53
+ const deriv = new MultiplyNode(affineA.toTree(), new CosNode(affine.toTree()));
54
+ const texs = deriv.toAllValidTexs();
55
+ return texs.includes(ans);
56
+ };
57
+ export const sinCompositionDerivation = {
58
+ id: "sinCompositionDerivation",
59
+ connector: "=",
60
+ label: "Dérivée de $\\sin(ax+b)$",
61
+ isSingleStep: true,
62
+ generator: (nb) => getDistinctQuestions(getSinCompositionDerivationQuestion, nb),
63
+ qcmTimer: 60,
64
+ freeTimer: 60,
65
+ getPropositions,
66
+ isAnswerValid,
67
+ subject: "Mathématiques",
68
+ getInstruction,
69
+ getAnswer,
70
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ affinecoeffs: number[];
4
+ };
5
+ export declare const sinSecondDegreeDerivative: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=sinSecondDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sinSecondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAkIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { CosNode } from "../../../../../tree/nodes/functions/cosNode.js";
5
+ import { SinNode } from "../../../../../tree/nodes/functions/sinNode.js";
6
+ import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
7
+ import { AddNode } from "../../../../../tree/nodes/operators/addNode.js";
8
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
10
+ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
11
+ const getAnswer = (identifiers) => {
12
+ const { affinecoeffs } = identifiers;
13
+ const affine = AffineConstructor.fromCoeffs(affinecoeffs);
14
+ const ans = new MultiplyNode(new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new NumberNode(-1)), new SinNode(affine.toTree().simplify({ forbidFactorize: true })))
15
+ .simplify()
16
+ .toTex();
17
+ return ans;
18
+ };
19
+ const getInstruction = (identifiers) => {
20
+ const { affinecoeffs } = identifiers;
21
+ const affine = AffineConstructor.fromCoeffs(affinecoeffs);
22
+ const func = new SinNode(affine.toTree().simplify({ forbidFactorize: true })).toTex();
23
+ return `Calculez la dérivée seconde de la fonction $f$ définie sur $\\mathbb{R}$ par :
24
+
25
+ $$
26
+ f(x) = ${func}
27
+ $$`;
28
+ };
29
+ const getSinSecondDegreeDerivativeQuestion = () => {
30
+ const affine = AffineConstructor.random();
31
+ const affinecoeffs = affine.coefficients;
32
+ const identifiers = { affinecoeffs };
33
+ const question = {
34
+ answer: getAnswer(identifiers),
35
+ instruction: getInstruction(identifiers),
36
+ keys: ["x", "sin", "cos", "tan"],
37
+ answerFormat: "tex",
38
+ identifiers,
39
+ };
40
+ return question;
41
+ };
42
+ const getPropositions = (n, { answer, affinecoeffs }) => {
43
+ const propositions = [];
44
+ addValidProp(propositions, answer);
45
+ const affine = new AddNode(new MultiplyNode(new NumberNode(affinecoeffs[1]), new VariableNode("x")), new NumberNode(affinecoeffs[0])).simplify({ forbidFactorize: true });
46
+ const wronganswer1 = new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new SinNode(affine))
47
+ .simplify()
48
+ .toTex();
49
+ const wronganswer2 = new MultiplyNode(new MultiplyNode(new PowerNode(affinecoeffs[1].toTree(), new NumberNode(2)), new NumberNode(-1)), new CosNode(affine))
50
+ .simplify()
51
+ .toTex();
52
+ const wronganswer3 = new MultiplyNode(affinecoeffs[1].toTree(), new CosNode(affine))
53
+ .simplify()
54
+ .toTex();
55
+ const wronganswer4 = new MultiplyNode(affinecoeffs[1].toTree(), new SinNode(affine))
56
+ .simplify()
57
+ .toTex();
58
+ const wronganswer5 = affine.toTex();
59
+ tryToAddWrongProp(propositions, wronganswer1);
60
+ tryToAddWrongProp(propositions, wronganswer2);
61
+ tryToAddWrongProp(propositions, wronganswer3);
62
+ tryToAddWrongProp(propositions, wronganswer4);
63
+ tryToAddWrongProp(propositions, wronganswer5);
64
+ while (propositions.length < n) {
65
+ const random = AffineConstructor.random();
66
+ const randomwronganswer = new MultiplyNode(random.a.toTree(), new CosNode(random.toTree().simplify({ forbidFactorize: true })))
67
+ .simplify()
68
+ .toTex();
69
+ tryToAddWrongProp(propositions, randomwronganswer);
70
+ }
71
+ return shuffleProps(propositions, n);
72
+ };
73
+ const isAnswerValid = (ans, { answer, affinecoeffs }) => {
74
+ const affine = new AddNode(new MultiplyNode(new NumberNode(affinecoeffs[1]), new VariableNode("x")), new NumberNode(affinecoeffs[0])).simplify({ forbidFactorize: true });
75
+ const validanswer = new MultiplyNode(new MultiplyNode(new PowerNode(new NumberNode(affinecoeffs[1]), new NumberNode(2)), new NumberNode(-1)), new SinNode(affine)).simplify();
76
+ const latexs = validanswer.toAllValidTexs();
77
+ return latexs.includes(ans);
78
+ };
79
+ export const sinSecondDegreeDerivative = {
80
+ id: "sinSecondDegreeDerivative",
81
+ label: "Dérivée seconde de $\\sin(u)$",
82
+ isSingleStep: true,
83
+ generator: (nb) => getDistinctQuestions(getSinSecondDegreeDerivativeQuestion, nb),
84
+ qcmTimer: 60,
85
+ freeTimer: 60,
86
+ getPropositions,
87
+ isAnswerValid,
88
+ subject: "Mathématiques",
89
+ getAnswer,
90
+ getInstruction,
91
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeNumberCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/derivativeNumberCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"derivativeNumberCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/derivativeNumberCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8DF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -24,6 +24,9 @@ const getDerivativeNumberCalculQuestion = () => {
24
24
  const x = randint(-9, 10);
25
25
  const trinom = PolynomialConstructor.randomWithOrder(2);
26
26
  const identifiers = { x, coeffs: trinom.coefficients };
27
+ return getQuestionFromIdentifiers(identifiers);
28
+ };
29
+ const getQuestionFromIdentifiers = (identifiers) => {
27
30
  const question = {
28
31
  answer: getAnswer(identifiers),
29
32
  instruction: getInstruction(identifiers),
@@ -61,6 +64,5 @@ export const derivativeNumberCalcul = {
61
64
  getPropositions,
62
65
  isAnswerValid,
63
66
  subject: "Mathématiques",
64
- getInstruction,
65
- getAnswer,
67
+ getQuestionFromIdentifiers,
66
68
  };
@@ -1,4 +1,6 @@
1
1
  export * from "./derivative/index.js";
2
2
  export * from "./derivativeNumberCalcul.js";
3
3
  export * from "./tangent/index.js";
4
+ export * from "./variations/index.js";
5
+ export * from "./convexity/index.js";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/derivation/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from "./derivative/index.js";
2
2
  export * from "./derivativeNumberCalcul.js";
3
3
  export * from "./tangent/index.js";
4
+ export * from "./variations/index.js";
5
+ export * from "./convexity/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./thirdDegreeFunctionVariation.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./thirdDegreeFunctionVariation.js";
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ c: number;
5
+ coin: number;
6
+ racine1: number;
7
+ racine2: number;
8
+ };
9
+ export declare const thirdDegreeFunctionVariation: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=thirdDegreeFunctionVariation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwKF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAmB9D,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randomColor } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
8
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
9
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
10
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
11
+ import { UnionIntervalNode } from "../../../../tree/nodes/sets/unionIntervalNode.js";
12
+ import { unionIntervalParser } from "../../../../tree/parsers/unionIntervalParser.js";
13
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
15
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ const rebuildIdentifiers = (oldIds) => {
17
+ if (oldIds?.c !== undefined)
18
+ return oldIds;
19
+ return {
20
+ ...oldIds,
21
+ c: randint(-2, 3),
22
+ };
23
+ };
24
+ const getInstruction = (identifiers) => {
25
+ const { a, coin, racine1, racine2 } = identifiers;
26
+ return `Soit $f$ la fonction représentée ci-dessous.
27
+
28
+ Sur quel(s) intervalle(s) la fonction dérivée $f'$ de $f$ est-elle ${coin < 0 ? "négative" : "positive"} ?`;
29
+ };
30
+ const getHint = (identifiers) => {
31
+ return `Si la fonction $f$ est croissante sur un intervalle, alors sa fonction dérivée $f'$ sera positive sur cet intervalle.
32
+
33
+ À l'inverse, si la fonction $f$ est décroissante sur un intervalle, alors sa fonction dérivée $f'$ sera négative sur cet intervalle.`;
34
+ };
35
+ const getCorrection = (identifiers) => {
36
+ const { a, coin, racine1, racine2 } = identifiers;
37
+ const variation = coin < 0 ? "décroissante" : "croissante";
38
+ const sign = coin < 0 ? "négative" : "positive";
39
+ const intervals = getIntervalsSolution(identifiers);
40
+ return `Si la fonction $f$ est ${variation} sur un intervalle, alors sa fonction dérivée $f'$ sera ${sign} sur cet intervalle.
41
+
42
+ Ici, on lit graphiquement que $f$ est ${variation} sur $${intervals[0].toTex()}$${intervals[1] ? ` et sur $${intervals[1].toTex()}$` : ""}.
43
+
44
+ On en déduit que $f'$ est donc ${sign} sur :
45
+
46
+ $$
47
+ ${getAnswer(identifiers)}
48
+ $$`;
49
+ };
50
+ const getIntervalsSolution = (identifiers) => {
51
+ const { a, coin, racine1, racine2 } = identifiers;
52
+ const racine1Tree = new NumberNode(racine1);
53
+ const racine2Tree = new NumberNode(racine2);
54
+ const intervals = coin * a < 0
55
+ ? [new IntervalNode(racine1Tree, racine2Tree, ClosureType.FF)]
56
+ : [
57
+ new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF),
58
+ new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO),
59
+ ];
60
+ return intervals;
61
+ };
62
+ const getAnswer = (identifiers) => {
63
+ const intervals = getIntervalsSolution(identifiers);
64
+ if (intervals.length === 1)
65
+ return intervals[0].toTex();
66
+ else
67
+ return new UnionIntervalNode(intervals).toTex();
68
+ };
69
+ const getGGBOptions = (identifiers) => {
70
+ const { a, coin, racine1, racine2, c } = identifiers;
71
+ const coefs = [
72
+ c,
73
+ a * racine1 * racine2,
74
+ (-a * (racine1 + racine2)) / 2,
75
+ a / 3,
76
+ ];
77
+ const polynome = new Polynomial(coefs);
78
+ const y1 = polynome.calculate(racine1);
79
+ const y2 = polynome.calculate(racine2);
80
+ const commands = [
81
+ `f(x) = ${polynome.toMathString()}`,
82
+ `SetColor(f, "${randomColor()}")`,
83
+ ];
84
+ const yMax = Math.max(y1, y2);
85
+ const yMin = Math.min(y1, y2);
86
+ const xMax = Math.max(racine1, racine2);
87
+ const xMin = Math.min(racine1, racine2);
88
+ const ggb = new GeogebraConstructor({
89
+ commands,
90
+ lockedAxesRatio: false,
91
+ gridDistance: false,
92
+ });
93
+ return ggb.getOptions({
94
+ coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
95
+ });
96
+ };
97
+ const getThirdDegreeFunctionVariation = () => {
98
+ const a = randint(-3, 4, [0]);
99
+ const c = randint(-2, 3);
100
+ const racine1 = randint(-5, 4);
101
+ const racine2 = randint(racine1 + 1, 6);
102
+ const coin = coinFlip() ? -1 : 1;
103
+ const identifiers = { racine1, racine2, coin, a, c };
104
+ const question = {
105
+ instruction: getInstruction(identifiers),
106
+ startStatement: "S",
107
+ answer: getAnswer(identifiers),
108
+ keys: ["lbracket", "rbracket", "semicolon", "infty", "cup"],
109
+ answerFormat: "tex",
110
+ ggbOptions: getGGBOptions(identifiers),
111
+ identifiers,
112
+ hint: getHint(identifiers),
113
+ correction: getCorrection(identifiers),
114
+ };
115
+ return question;
116
+ };
117
+ const getPropositions = (n, { answer, racine1, racine2 }) => {
118
+ const racine1Tree = new NumberNode(racine1);
119
+ const racine2Tree = new NumberNode(racine2);
120
+ const propositions = [];
121
+ addValidProp(propositions, answer);
122
+ tryToAddWrongProp(propositions, new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO).toTex());
123
+ tryToAddWrongProp(propositions, new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF).toTex());
124
+ tryToAddWrongProp(propositions, new UnionIntervalNode([
125
+ new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF),
126
+ new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO),
127
+ ]).toTex());
128
+ while (propositions.length < n) {
129
+ const root1 = randint(-5, 4);
130
+ const root2 = randint(root1 + 1, 6);
131
+ const root1Tree = new NumberNode(racine1);
132
+ const root2Tree = new NumberNode(racine2);
133
+ const wrongAnswer = new IntervalNode(root1Tree, root2Tree, ClosureType.FF).toTex();
134
+ tryToAddWrongProp(propositions, wrongAnswer);
135
+ }
136
+ return shuffle(propositions);
137
+ };
138
+ const isAnswerValid = (ans, { answer, racine1, racine2, coin, a }) => {
139
+ try {
140
+ const parsed = unionIntervalParser(ans);
141
+ if (!parsed)
142
+ return false;
143
+ return parsed.simplify().toTex() === answer;
144
+ }
145
+ catch (err) {
146
+ return handleVEAError(err);
147
+ }
148
+ };
149
+ export const thirdDegreeFunctionVariation = {
150
+ id: "thirdDegreeFunctionVariation",
151
+ connector: "=",
152
+ label: "Lecture du signe de la dérivée via les variations d'une fonction",
153
+ isSingleStep: true,
154
+ generator: (nb) => getDistinctQuestions(getThirdDegreeFunctionVariation, nb),
155
+ qcmTimer: 60,
156
+ freeTimer: 60,
157
+ getPropositions,
158
+ isAnswerValid,
159
+ hasGeogebra: true,
160
+ subject: "Mathématiques",
161
+ getInstruction,
162
+ getAnswer,
163
+ getGGBOptions,
164
+ rebuildIdentifiers,
165
+ hasHintAndCorrection: true,
166
+ getHint,
167
+ getCorrection,
168
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffAyPlusB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffAyPlusB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8GF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
1
+ {"version":3,"file":"equaDiffAyPlusB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffAyPlusB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}