math-exercises 3.0.56 → 3.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  2. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  4. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
  6. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  8. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  9. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  11. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
  13. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  14. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  16. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
  18. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
  20. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
  22. package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
  23. package/lib/exercises/math/conversion/capacityConversion.js +68 -12
  24. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
  26. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  27. package/lib/exercises/math/conversion/lengthConversion.js +55 -6
  28. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  29. package/lib/exercises/math/conversion/massConversion.js +72 -16
  30. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  31. package/lib/exercises/math/conversion/volumeConversion.js +72 -12
  32. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  33. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  35. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  36. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  38. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  39. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  41. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  42. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  44. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  45. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  47. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  48. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  56. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  57. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  59. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  60. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  62. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  63. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  64. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  65. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  66. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  68. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  69. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  77. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  78. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  79. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  80. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  81. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  101. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  102. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  103. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  104. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  105. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  106. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  107. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  108. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  110. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  111. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  112. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  113. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  114. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  122. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  123. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  124. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  125. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  126. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  137. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  138. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  139. package/lib/exercises/math/derivation/index.d.ts +2 -0
  140. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/index.js +2 -0
  142. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  143. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  144. package/lib/exercises/math/derivation/variations/index.js +1 -0
  145. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  146. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  147. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  148. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  149. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  150. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  151. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  152. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  153. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  154. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  155. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  156. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  157. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  158. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  159. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  160. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  161. package/lib/exercises/math/equaDiff/index.js +1 -1
  162. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  163. package/lib/exercises/math/functions/affines/signFunction.js +23 -11
  164. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  165. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  166. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  167. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  168. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  170. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  171. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
  172. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  173. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  175. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
  177. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
  178. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
  179. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
  180. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
  181. package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
  182. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  183. package/lib/exercises/math/limits/polynomLimit.js +28 -9
  184. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
  185. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  186. package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
  187. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  188. package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
  189. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  190. package/lib/exercises/math/powers/decimalToScientific.js +55 -11
  191. package/lib/exercises/math/powers/index.d.ts +1 -0
  192. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  193. package/lib/exercises/math/powers/index.js +1 -0
  194. package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
  195. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  196. package/lib/exercises/math/powers/powersDivision.js +68 -53
  197. package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
  198. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  199. package/lib/exercises/math/powers/powersMixOperations.js +88 -17
  200. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
  201. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
  202. package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
  203. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  204. package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
  205. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  206. package/lib/exercises/math/powers/powersProduct.js +1 -0
  207. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  208. package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
  209. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  210. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  211. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  212. package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
  213. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  214. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  215. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  216. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  217. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  218. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  219. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  220. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  221. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  222. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  223. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  224. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  225. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  226. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  227. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  229. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  230. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  231. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  232. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  233. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  235. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  236. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  237. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  238. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  239. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  240. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  241. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  242. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  243. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  244. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +40 -2
  245. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  246. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
  247. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  248. package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
  249. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  250. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
  251. package/lib/exercises/pc/index.d.ts +5 -5
  252. package/lib/exercises/pc/index.d.ts.map +1 -1
  253. package/lib/exercises/pc/index.js +5 -5
  254. package/lib/index.d.ts +56 -45
  255. package/lib/index.d.ts.map +1 -1
  256. package/lib/math/geometry/angle.d.ts.map +1 -1
  257. package/lib/math/geometry/angle.js +0 -5
  258. package/lib/math/geometry/vector.d.ts +1 -0
  259. package/lib/math/geometry/vector.d.ts.map +1 -1
  260. package/lib/math/geometry/vector.js +19 -0
  261. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  262. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  263. package/lib/math/numbers/decimals/decimal.js +2 -0
  264. package/lib/math/systems/generalSystem.d.ts +6 -1
  265. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  266. package/lib/math/systems/generalSystem.js +137 -0
  267. package/lib/math/utils/arithmetic/lcm.js +1 -1
  268. package/lib/playground.d.ts.map +1 -1
  269. package/lib/playground.js +4 -34
  270. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  271. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
  273. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  274. package/lib/tree/nodes/equations/equalNode.js +17 -9
  275. package/lib/tree/nodes/functions/logNode.js +2 -4
  276. package/lib/tree/nodes/operators/addNode.js +1 -1
  277. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/operators/fractionNode.js +35 -11
  279. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  280. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  281. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  282. package/lib/tree/nodes/operators/powerNode.js +5 -0
  283. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  284. package/lib/tree/nodes/sets/intervalNode.js +3 -1
  285. package/lib/tree/parsers/latexParser.js +6 -2
  286. package/package.json +1 -1
@@ -0,0 +1,77 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../../math/utils/random/randint.js";
4
+ import { ExpNode } from "../../../../../tree/nodes/functions/expNode.js";
5
+ import { LogNode } from "../../../../../tree/nodes/functions/logNode.js";
6
+ import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
7
+ import { AddNode } from "../../../../../tree/nodes/operators/addNode.js";
8
+ import { FractionNode } from "../../../../../tree/nodes/operators/fractionNode.js";
9
+ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
11
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
12
+ import { shuffle } from "../../../../../utils/alea/shuffle.js";
13
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
14
+ const getInstruction = (identifiers) => {
15
+ const { a, b } = identifiers;
16
+ const myfunction = new AddNode(new MultiplyNode(new NumberNode(a), new LogNode(new VariableNode("x"))), new NumberNode(b));
17
+ return `Déterminer la dérivée de la fonction $f$ définie par :
18
+
19
+ $$
20
+ f(x) = ${myfunction.toTex()}
21
+ $$`;
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { a, b } = identifiers;
25
+ const derivative = new FractionNode(new NumberNode(a), new VariableNode("x"));
26
+ const answer = derivative.toTex();
27
+ return answer;
28
+ };
29
+ const getLnDerivative = () => {
30
+ const a = randint(-9, 10, [0]);
31
+ const b = randint(-9, 10, [0]);
32
+ const identifiers = { a, b };
33
+ const question = {
34
+ instruction: getInstruction(identifiers),
35
+ startStatement: "f'(x)",
36
+ answer: getAnswer(identifiers),
37
+ keys: ["x", "lnBrackets", "epower"],
38
+ answerFormat: "tex",
39
+ identifiers,
40
+ };
41
+ return question;
42
+ };
43
+ const getPropositions = (n, { answer, a, b }) => {
44
+ const propositions = [];
45
+ addValidProp(propositions, answer);
46
+ tryToAddWrongProp(propositions, new AddNode(new FractionNode(new NumberNode(a), new VariableNode("x")), new NumberNode(b)).toTex());
47
+ tryToAddWrongProp(propositions, a + "");
48
+ tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a), new ExpNode(new VariableNode("x"))).toTex());
49
+ while (propositions.length < n) {
50
+ const randomA = randint(-9, 10, [0]);
51
+ tryToAddWrongProp(propositions, new FractionNode(new NumberNode(randomA), new VariableNode("x")).toTex());
52
+ }
53
+ return shuffle(propositions);
54
+ };
55
+ const isAnswerValid = (ans, { answer, a }) => {
56
+ try {
57
+ const parsed = parseAlgebraic(ans);
58
+ if (!parsed)
59
+ return false;
60
+ return parsed.simplify().toTex() === answer;
61
+ }
62
+ catch (err) {
63
+ return handleVEAError(err);
64
+ }
65
+ };
66
+ export const lnDerivativeTwo = {
67
+ id: "lnDerivativeTwo",
68
+ connector: "=",
69
+ label: "Dérivée de $a \\times \\ln(x) + b$",
70
+ isSingleStep: false,
71
+ generator: (nb) => getDistinctQuestions(getLnDerivative, nb),
72
+ getPropositions,
73
+ isAnswerValid,
74
+ qcmTimer: 60,
75
+ freeTimer: 60,
76
+ subject: "Mathématiques",
77
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise, QCMGenerator, QuestionGenerator, VEA } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ tex: string;
4
+ };
5
+ export declare const getConstanteDerivative: QuestionGenerator<Identifiers>;
6
+ export declare const getConstanteDerivativePropositions: QCMGenerator<Identifiers>;
7
+ export declare const isConstanteDerivativeAnswerValid: VEA<Identifiers>;
8
+ export declare const constanteDerivative: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=constanteDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constanteDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/constanteDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAmBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAgBjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAmBxE,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CAE7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { NombreConstructor } from "../../../../../math/numbers/nombre.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ const getHint = ({ tex }) => {
6
+ return `$f$ est une fonction constante égale à $${tex}$`;
7
+ };
8
+ const getCorrection = ({ tex }) => {
9
+ return `La fonction $f$ est une fonction constante égale à $${tex}$. Or, la fonction dérivée d'une fonction constante est nulle. Ainsi, pour tout $x\\in \\mathbb{R}$, $f'(x) = 0$.`;
10
+ };
11
+ const getAnswer = () => "0";
12
+ const getInstruction = (identifiers) => {
13
+ const tex = identifiers.tex;
14
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
15
+
16
+ $$
17
+ f(x) = ${tex}
18
+ $$`;
19
+ };
20
+ export const getConstanteDerivative = () => {
21
+ const c = NombreConstructor.random();
22
+ const tex = c.toTree().toTex();
23
+ const identifiers = { tex };
24
+ const question = {
25
+ instruction: getInstruction(identifiers),
26
+ startStatement: `f'(x)`,
27
+ answer: getAnswer(identifiers),
28
+ keys: ["x"],
29
+ answerFormat: "tex",
30
+ identifiers,
31
+ hint: getHint({ tex }),
32
+ correction: getCorrection({ tex }),
33
+ };
34
+ return question;
35
+ };
36
+ export const getConstanteDerivativePropositions = (n, { answer, tex }) => {
37
+ const propositions = [];
38
+ addValidProp(propositions, answer);
39
+ tryToAddWrongProp(propositions, tex);
40
+ tryToAddWrongProp(propositions, "1");
41
+ const opposite = tex[0] === "-" ? tex.slice(1) : "-" + tex;
42
+ tryToAddWrongProp(propositions, `${opposite}`);
43
+ tryToAddWrongProp(propositions, "x");
44
+ while (propositions.length < n) {
45
+ const wrongAnswer = randint(-9, 10);
46
+ tryToAddWrongProp(propositions, wrongAnswer + "");
47
+ }
48
+ return shuffleProps(propositions, n);
49
+ };
50
+ export const isConstanteDerivativeAnswerValid = (ans, {}) => {
51
+ return ans === "0";
52
+ };
53
+ export const constanteDerivative = {
54
+ id: "constanteDerivative",
55
+ connector: "=",
56
+ label: "Dérivée d'une constante",
57
+ levels: ["1reESM", "1reSpé", "1reTech", "MathComp", "1rePro"],
58
+ sections: ["Dérivation"],
59
+ isSingleStep: false,
60
+ generator: (nb) => getDistinctQuestions(getConstanteDerivative, nb),
61
+ qcmTimer: 60,
62
+ freeTimer: 60,
63
+ getPropositions: getConstanteDerivativePropositions,
64
+ isAnswerValid: isConstanteDerivativeAnswerValid,
65
+ subject: "Mathématiques",
66
+ getHint,
67
+ getCorrection,
68
+ hasHintAndCorrection: true,
69
+ getAnswer,
70
+ getInstruction,
71
+ };
@@ -0,0 +1,11 @@
1
+ import { Exercise, QCMGenerator, QuestionGenerator, VEA } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ };
6
+ export declare const getFirstDegreeDerivative: QuestionGenerator<Identifiers>;
7
+ export declare const getFirstDegreeDerivativePropositions: QCMGenerator<Identifiers>;
8
+ export declare const isFirstDegreeDerivativeAnswerValid: VEA<Identifiers>;
9
+ export declare const firstDegreeDerivative: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=firstDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6CF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAenE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAkB1E,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAK/D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial } from "../../../../../math/polynomials/polynomial.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ const getAnswer = (identifiers) => {
8
+ const { a, b } = identifiers;
9
+ return a + "";
10
+ };
11
+ const getHint = (identifiers) => {
12
+ return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
13
+
14
+ On rappelle que la dérivée de la fonction $kx$ est $k$.`;
15
+ };
16
+ const getCorrection = (identifiers) => {
17
+ const { a, b } = identifiers;
18
+ const monoms = [b, a]
19
+ .map((c, i) => multiply(c, power("x", i)).simplify())
20
+ .filter((n) => n.evaluate() !== 0);
21
+ const answer = getAnswer(identifiers);
22
+ return `On dérive chacun des termes de la somme :
23
+
24
+ ${monoms
25
+ .reverse()
26
+ .map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
27
+ .join(" \n ")}
28
+
29
+ Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
30
+
31
+ $$
32
+ f'(x) = ${answer}
33
+ $$`;
34
+ };
35
+ const getInstruction = (identifiers) => {
36
+ const { a, b } = identifiers;
37
+ const polynomial = new Polynomial([b, a]);
38
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
39
+
40
+ $$
41
+ f(x) = ${polynomial.toTex()}
42
+ $$`;
43
+ };
44
+ export const getFirstDegreeDerivative = () => {
45
+ const [a, b] = [randint(-9, 10, [0]), randint(-9, 10)];
46
+ const identifiers = { a, b };
47
+ const question = {
48
+ instruction: getInstruction(identifiers),
49
+ startStatement: `f'(x)`,
50
+ answer: getAnswer(identifiers),
51
+ keys: ["x"],
52
+ answerFormat: "tex",
53
+ identifiers,
54
+ hint: getHint(identifiers),
55
+ correction: getCorrection(identifiers),
56
+ };
57
+ return question;
58
+ };
59
+ export const getFirstDegreeDerivativePropositions = (n, { answer, a, b }) => {
60
+ const propositions = [];
61
+ addValidProp(propositions, answer);
62
+ tryToAddWrongProp(propositions, new Polynomial([0, a]).toTree().toTex());
63
+ tryToAddWrongProp(propositions, "x");
64
+ tryToAddWrongProp(propositions, b + "");
65
+ while (propositions.length < n) {
66
+ const wrongAnswer = randint(-9, 10);
67
+ tryToAddWrongProp(propositions, wrongAnswer + "");
68
+ }
69
+ return shuffleProps(propositions, n);
70
+ };
71
+ export const isFirstDegreeDerivativeAnswerValid = (ans, { answer }) => {
72
+ return ans === answer;
73
+ };
74
+ export const firstDegreeDerivative = {
75
+ id: "firstDegreeDerivative",
76
+ connector: "=",
77
+ label: "Dérivée d'une fonction affine",
78
+ isSingleStep: false,
79
+ generator: (nb) => getDistinctQuestions(getFirstDegreeDerivative, nb),
80
+ qcmTimer: 60,
81
+ freeTimer: 60,
82
+ getPropositions: getFirstDegreeDerivativePropositions,
83
+ isAnswerValid: isFirstDegreeDerivativeAnswerValid,
84
+ subject: "Mathématiques",
85
+ hasHintAndCorrection: true,
86
+ getHint,
87
+ getCorrection,
88
+ };
@@ -0,0 +1,8 @@
1
+ export { secondDegreeDerivative } from "./secondDegreeDerivative.js";
2
+ export { thirdDegreeDerivative } from "./thirdDegreeDerivative.js";
3
+ export { constanteDerivative } from "./constanteDerivative.js";
4
+ export { firstDegreeDerivative } from "./firstDegreeDerivative.js";
5
+ export * from "./usualderivative.js";
6
+ export * from "./secondDerivativeOfTrinom.js";
7
+ export * from "./secondDerivativeOfThirdDegreeFunction.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { secondDegreeDerivative } from "./secondDegreeDerivative.js";
2
+ export { thirdDegreeDerivative } from "./thirdDegreeDerivative.js";
3
+ export { constanteDerivative } from "./constanteDerivative.js";
4
+ export { firstDegreeDerivative } from "./firstDegreeDerivative.js";
5
+ export * from "./usualderivative.js";
6
+ export * from "./secondDerivativeOfTrinom.js";
7
+ export * from "./secondDerivativeOfThirdDegreeFunction.js";
@@ -0,0 +1,10 @@
1
+ import { Exercise, QCMGenerator, QuestionGenerator, VEA } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coefficients: number[];
4
+ };
5
+ export declare const getSecondDegreeDerivative: QuestionGenerator<Identifiers>;
6
+ export declare const getSecondDegreeDerivativePropositions: QCMGenerator<Identifiers>;
7
+ export declare const isSecondDegreeDerivativeAnswerValid: VEA<Identifiers>;
8
+ export declare const secondDegreeDerivative: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=secondDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA8CF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAgBpE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,YAAY,CAC9D,WAAW,CA+BZ,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,GAAG,CAAC,WAAW,CAehE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial } from "../../../../../math/polynomials/polynomial.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../../../tree/nodes/operators/powerNode.js";
7
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
8
+ import { shuffle } from "../../../../../utils/alea/shuffle.js";
9
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
10
+ const getAnswer = (identifiers) => {
11
+ const polynomial = new Polynomial(identifiers.coefficients);
12
+ const derivative = polynomial.derivate();
13
+ return derivative.toTree().toTex();
14
+ };
15
+ const getHint = (identifiers) => {
16
+ return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
17
+
18
+ On rappelle que la dérivée de la fonction $kx^n$ est :
19
+
20
+ $$
21
+ k\\times n \\times x^{n-1}
22
+ $$`;
23
+ };
24
+ const getCorrection = (identifiers) => {
25
+ const monoms = identifiers.coefficients
26
+ .map((c, i) => multiply(c, power("x", i)).simplify())
27
+ .filter((n) => n.evaluate() !== 0);
28
+ const answer = getAnswer(identifiers);
29
+ return `On dérive chacun des termes de la somme :
30
+
31
+ ${monoms
32
+ .reverse()
33
+ .map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
34
+ .join(" \n ")}
35
+
36
+ Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
37
+
38
+ $$
39
+ f'(x) = ${answer}
40
+ $$
41
+ `;
42
+ };
43
+ const getInstruction = (identifiers) => {
44
+ const polynomial = new Polynomial(identifiers.coefficients);
45
+ return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
46
+
47
+ $$
48
+ f(x) = ${polynomial.toTree().toTex()}
49
+ $$`;
50
+ };
51
+ export const getSecondDegreeDerivative = () => {
52
+ const coefficients = [randint(-9, 10), randint(-9, 10), randint(-9, 10, [0])];
53
+ const identifiers = { coefficients };
54
+ const question = {
55
+ instruction: getInstruction(identifiers),
56
+ startStatement: `f'(x)`,
57
+ answer: getAnswer(identifiers),
58
+ keys: ["x"],
59
+ answerFormat: "tex",
60
+ identifiers,
61
+ hint: getHint(identifiers),
62
+ correction: getCorrection(identifiers),
63
+ };
64
+ return question;
65
+ };
66
+ export const getSecondDegreeDerivativePropositions = (n, { answer, coefficients }) => {
67
+ const propositions = [];
68
+ addValidProp(propositions, answer);
69
+ if (coefficients[1] !== 0)
70
+ tryToAddWrongProp(propositions, new Polynomial([coefficients[0], coefficients[1]]).toTree().toTex());
71
+ if (coefficients[1] !== 0)
72
+ tryToAddWrongProp(propositions, new Polynomial([coefficients[0] + coefficients[1], coefficients[1]])
73
+ .toTree()
74
+ .toTex());
75
+ while (propositions.length < n) {
76
+ const randomCoefficients = [
77
+ randint(-9, 10),
78
+ coefficients[1] + randint(-3, 4),
79
+ coefficients[2] + randint(-3, 4, [0, -coefficients[2]]),
80
+ ];
81
+ const randomPolynomial = new Polynomial(randomCoefficients);
82
+ tryToAddWrongProp(propositions, randomPolynomial.derivate().toTree().toTex());
83
+ }
84
+ return shuffle(propositions);
85
+ };
86
+ export const isSecondDegreeDerivativeAnswerValid = (ans, { answer, coefficients }) => {
87
+ try {
88
+ const parsed = parseAlgebraic(ans);
89
+ if (!parsed)
90
+ return false;
91
+ return (parsed
92
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
93
+ .toTex() === answer);
94
+ }
95
+ catch (err) {
96
+ return handleVEAError(err);
97
+ }
98
+ };
99
+ export const secondDegreeDerivative = {
100
+ id: "secondDegreeDerivative",
101
+ connector: "=",
102
+ label: "Dérivée d'un polynôme de degré $2$",
103
+ isSingleStep: false,
104
+ generator: (nb) => getDistinctQuestions(getSecondDegreeDerivative, nb),
105
+ qcmTimer: 60,
106
+ freeTimer: 60,
107
+ getPropositions: getSecondDegreeDerivativePropositions,
108
+ isAnswerValid: isSecondDegreeDerivativeAnswerValid,
109
+ subject: "Mathématiques",
110
+ getHint,
111
+ getCorrection,
112
+ hasHintAndCorrection: true,
113
+ getInstruction,
114
+ getAnswer,
115
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ d: number;
7
+ };
8
+ export declare const secondDerivativeOfThridDegreeFunction: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=secondDerivativeOfThirdDegreeFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDerivativeOfThirdDegreeFunction.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial, PolynomialConstructor, } from "../../../../../math/polynomials/polynomial.js";
4
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
5
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
6
+ const getInstruction = (identifiers) => {
7
+ const { a, b, c, d } = identifiers;
8
+ const funct = new Polynomial([d, c, b, a]);
9
+ return `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par :
10
+
11
+ $$
12
+ f(x)=${funct.toTree().toTex()}
13
+ $$`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { a, b, c, d } = identifiers;
17
+ const funct = new Polynomial([d, c, b, a]);
18
+ const correctAnswer = funct.secondDerivate().toTree();
19
+ return correctAnswer.toTex();
20
+ };
21
+ const getSecondDerivativeOfThirdDegreeFunction = () => {
22
+ const funct = PolynomialConstructor.randomWithOrder(3, "x");
23
+ const coefficients = funct.coefficients;
24
+ const coeff = {
25
+ a: coefficients[3],
26
+ b: coefficients[2],
27
+ c: coefficients[1],
28
+ d: coefficients[0],
29
+ };
30
+ const identifiers = { ...coeff };
31
+ const question = {
32
+ answer: getAnswer(identifiers),
33
+ instruction: getInstruction(identifiers),
34
+ keys: ["x"],
35
+ answerFormat: "tex",
36
+ identifiers,
37
+ };
38
+ return question;
39
+ };
40
+ const getPropositions = (n, { answer, a, b, c, d }) => {
41
+ const propositions = [];
42
+ addValidProp(propositions, answer);
43
+ generateProposition(a, b, c, d).forEach((value) => tryToAddWrongProp(propositions, value.toTex()));
44
+ while (propositions.length < n) {
45
+ tryToAddWrongProp(propositions, PolynomialConstructor.random(1, "x").toTree().toTex());
46
+ }
47
+ return shuffleProps(propositions, n);
48
+ };
49
+ const generateProposition = (a, b, c, d) => {
50
+ const firstPropostion = new Polynomial([c, 2 * b, 3 * a], "x").toTree();
51
+ const secondProposition = new Polynomial([c + d, 2 * b, 3 * a], "x").toTree();
52
+ const thirdProposition = new Polynomial([c, 2 * b, 3 * 2 * a], "x").toTree();
53
+ return [firstPropostion, secondProposition, thirdProposition];
54
+ };
55
+ const isAnswerValid = (ans, { answer, a, b, c, d }) => {
56
+ try {
57
+ const parsed = parseAlgebraic(ans);
58
+ if (!parsed)
59
+ return false;
60
+ return (parsed
61
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
62
+ .toTex() === answer);
63
+ }
64
+ catch (err) {
65
+ return handleVEAError(err);
66
+ }
67
+ };
68
+ export const secondDerivativeOfThridDegreeFunction = {
69
+ id: "secondDerivativeOfThirdDegreeFunction",
70
+ label: "Dérivée seconde d'un polynôme de degré $3$",
71
+ isSingleStep: true,
72
+ generator: (nb) => getDistinctQuestions(getSecondDerivativeOfThirdDegreeFunction, nb),
73
+ qcmTimer: 60,
74
+ freeTimer: 60,
75
+ getPropositions,
76
+ isAnswerValid,
77
+ subject: "Mathématiques",
78
+ getInstruction,
79
+ getAnswer,
80
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const secondDerivativeOfTrinom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=secondDerivativeOfTrinom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDerivativeOfTrinom.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsEF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial, } from "../../../../../math/polynomials/polynomial.js";
4
+ import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
5
+ import { randint } from "../../../../../math/utils/random/randint.js";
6
+ import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
7
+ const getInstruction = (identifiers) => {
8
+ const { a, b, c } = identifiers;
9
+ const trinom = new Trinom(a, b, c);
10
+ const trinomTree = trinom.toTree();
11
+ return `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par :
12
+
13
+ $$
14
+ f(x)=${trinomTree.toTex()}
15
+ $$`;
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ const { a, b, c } = identifiers;
19
+ const trinom = new Trinom(a, b, c);
20
+ const correctAnswer = trinom.derivate().derivate().toTree();
21
+ return correctAnswer.toTex();
22
+ };
23
+ const getSecondDerivativeOfTrinomQuestion = () => {
24
+ const trinom = TrinomConstructor.random();
25
+ const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
26
+ const question = {
27
+ answer: getAnswer(identifiers),
28
+ instruction: getInstruction(identifiers),
29
+ keys: ["x"],
30
+ answerFormat: "tex",
31
+ identifiers,
32
+ };
33
+ return question;
34
+ };
35
+ const getPropositions = (n, { answer, a, b, c }) => {
36
+ const propositions = [];
37
+ addValidProp(propositions, answer);
38
+ generateProposition(a, b, c).forEach((value) => tryToAddWrongProp(propositions, value.toTex()));
39
+ let correctAnswer = 2 * a;
40
+ while (propositions.length < n) {
41
+ tryToAddWrongProp(propositions, randint(correctAnswer - 11, correctAnswer + 11, [correctAnswer]) + "");
42
+ }
43
+ return shuffleProps(propositions, n);
44
+ };
45
+ const isAnswerValid = (ans, { a }) => {
46
+ const correctAnswer = 2 * a;
47
+ return correctAnswer + "" === ans;
48
+ };
49
+ const generateProposition = (a, b, c) => {
50
+ const firstPropostion = new Polynomial([b, 2 * a], "x").toTree();
51
+ const secondProposition = new Polynomial([c + b, 2 * a], "x").toTree();
52
+ const thirdProposition = new NumberNode(a + b + c);
53
+ return [firstPropostion, secondProposition, thirdProposition];
54
+ };
55
+ export const secondDerivativeOfTrinom = {
56
+ id: "secondDerivativeOfTrinom",
57
+ label: "Dérivée seconde d'un trinôme",
58
+ isSingleStep: true,
59
+ generator: (nb) => getDistinctQuestions(getSecondDerivativeOfTrinomQuestion, nb),
60
+ qcmTimer: 60,
61
+ freeTimer: 60,
62
+ getPropositions,
63
+ isAnswerValid,
64
+ subject: "Mathématiques",
65
+ getInstruction,
66
+ getAnswer,
67
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise, QCMGenerator, QuestionGenerator, VEA } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coefficients: number[];
4
+ };
5
+ export declare const getThirdDegreeDerivative: QuestionGenerator<Identifiers>;
6
+ export declare const getThirdDegreeDerivativePropositions: QCMGenerator<Identifiers>;
7
+ export declare const isThirdDegreeDerivativeAnswerValid: VEA<Identifiers>;
8
+ export declare const thirdDegreeDerivative: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=thirdDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA8CF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAmBnE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAwC1E,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAe/D,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CA0BvD,CAAC"}