math-exercises 1.3.41 → 1.3.43

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 (319) hide show
  1. package/lib/exercises/calcul/addAndSub.d.ts.map +1 -1
  2. package/lib/exercises/calcul/addAndSub.js +3 -0
  3. package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
  4. package/lib/exercises/calcul/addAndSubWithoutRelatives.js +3 -0
  5. package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts +4 -0
  6. package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts.map +1 -0
  7. package/lib/exercises/calcul/arithmetics/euclideanDivision.js +70 -0
  8. package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  9. package/lib/exercises/calcul/arithmetics/primeNumbers.js +4 -1
  10. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  11. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +3 -0
  12. package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  13. package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +3 -0
  14. package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
  15. package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +3 -0
  16. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  17. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +3 -0
  18. package/lib/exercises/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  19. package/lib/exercises/calcul/fractions/fractionsDivision.js +3 -0
  20. package/lib/exercises/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  21. package/lib/exercises/calcul/fractions/fractionsProduct.js +3 -0
  22. package/lib/exercises/calcul/fractions/fractionsSum.d.ts.map +1 -1
  23. package/lib/exercises/calcul/fractions/fractionsSum.js +3 -0
  24. package/lib/exercises/calcul/fractions/simplifyFraction.d.ts.map +1 -1
  25. package/lib/exercises/calcul/fractions/simplifyFraction.js +3 -0
  26. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts.map +1 -1
  27. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +3 -0
  28. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts.map +1 -1
  29. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +3 -0
  30. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts.map +1 -1
  31. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +3 -0
  32. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts.map +1 -1
  33. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +3 -0
  34. package/lib/exercises/calcul/operations/operationsPriorities.d.ts.map +1 -1
  35. package/lib/exercises/calcul/operations/operationsPriorities.js +3 -0
  36. package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  37. package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +3 -0
  38. package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  39. package/lib/exercises/calcul/proportionality/proportionalityTable.js +3 -0
  40. package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
  41. package/lib/exercises/calcul/rounding/rounding.js +6 -0
  42. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  43. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +5 -0
  44. package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  45. package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +6 -0
  46. package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  47. package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +6 -0
  48. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  49. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +6 -0
  50. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  51. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +6 -0
  52. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  53. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +12 -0
  54. package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  55. package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +3 -0
  56. package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  57. package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +3 -0
  58. package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  59. package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +3 -0
  60. package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  61. package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +3 -0
  62. package/lib/exercises/calculLitteral/equation/expEquation.d.ts +4 -0
  63. package/lib/exercises/calculLitteral/equation/expEquation.d.ts.map +1 -0
  64. package/lib/exercises/calculLitteral/equation/expEquation.js +67 -0
  65. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  66. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +3 -0
  67. package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  68. package/lib/exercises/calculLitteral/equation/fractionEquation.js +3 -0
  69. package/lib/exercises/calculLitteral/equation/logEquation.d.ts +4 -0
  70. package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -0
  71. package/lib/exercises/calculLitteral/equation/logEquation.js +67 -0
  72. package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  73. package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +3 -0
  74. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  75. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +4 -0
  76. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  77. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +5 -0
  78. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  79. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +6 -0
  80. package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  81. package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +6 -0
  82. package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  83. package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +3 -0
  84. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts +4 -0
  85. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts.map +1 -0
  86. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.js +96 -0
  87. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts +4 -0
  88. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts.map +1 -0
  89. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.js +78 -0
  90. package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
  91. package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +3 -0
  92. package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
  93. package/lib/exercises/conversion/aeraConversion.js +3 -0
  94. package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
  95. package/lib/exercises/conversion/capacityConversion.js +3 -0
  96. package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
  97. package/lib/exercises/conversion/lengthConversion.js +3 -0
  98. package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
  99. package/lib/exercises/conversion/massConversion.js +3 -0
  100. package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
  101. package/lib/exercises/conversion/volumeCapacityConversion.js +3 -0
  102. package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
  103. package/lib/exercises/conversion/volumeConversion.js +3 -0
  104. package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
  105. package/lib/exercises/derivation/derivative/constanteDerivative.js +4 -1
  106. package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts +4 -0
  107. package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -0
  108. package/lib/exercises/derivation/derivative/expDerivativeOne.js +65 -0
  109. package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts +4 -0
  110. package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -0
  111. package/lib/exercises/derivation/derivative/expDerivativeThree.js +64 -0
  112. package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts +4 -0
  113. package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -0
  114. package/lib/exercises/derivation/derivative/expDerivativeTwo.js +65 -0
  115. package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
  116. package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +3 -0
  117. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  118. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +3 -0
  119. package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts +4 -0
  120. package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -0
  121. package/lib/exercises/derivation/derivative/lnDerivativeOne.js +63 -0
  122. package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts +4 -0
  123. package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -0
  124. package/lib/exercises/derivation/derivative/lnDerivativeThree.js +68 -0
  125. package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts +4 -0
  126. package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -0
  127. package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +66 -0
  128. package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
  129. package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +3 -0
  130. package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  131. package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +4 -0
  132. package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
  133. package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +3 -0
  134. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  135. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +3 -0
  136. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts +4 -0
  137. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -0
  138. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +101 -0
  139. package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
  140. package/lib/exercises/derivation/derivativeNumberReading.js +3 -0
  141. package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts +4 -0
  142. package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts.map +1 -0
  143. package/lib/exercises/equaDiff/equaDiffGeneralForme.js +66 -0
  144. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts +4 -0
  145. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -0
  146. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.js +80 -0
  147. package/lib/exercises/exercise.d.ts +2 -0
  148. package/lib/exercises/exercise.d.ts.map +1 -1
  149. package/lib/exercises/exercises.d.ts.map +1 -1
  150. package/lib/exercises/exercises.js +66 -4
  151. package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
  152. package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +6 -0
  153. package/lib/exercises/geometry/cartesian/imageFunction.d.ts +4 -0
  154. package/lib/exercises/geometry/cartesian/imageFunction.d.ts.map +1 -0
  155. package/lib/exercises/geometry/cartesian/imageFunction.js +65 -0
  156. package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.d.ts +4 -0
  157. package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.d.ts.map +1 -0
  158. package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.js +89 -0
  159. package/lib/exercises/geometry/cartesian/inverseImageFunction.d.ts +4 -0
  160. package/lib/exercises/geometry/cartesian/inverseImageFunction.d.ts.map +1 -0
  161. package/lib/exercises/geometry/cartesian/inverseImageFunction.js +62 -0
  162. package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.d.ts +4 -0
  163. package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.d.ts.map +1 -0
  164. package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.js +154 -0
  165. package/lib/exercises/geometry/cartesian/leadingCoefficient.d.ts.map +1 -1
  166. package/lib/exercises/geometry/cartesian/leadingCoefficient.js +3 -0
  167. package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts.map +1 -1
  168. package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.js +3 -0
  169. package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts.map +1 -1
  170. package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.js +3 -0
  171. package/lib/exercises/geometry/cartesian/midpoint.d.ts.map +1 -1
  172. package/lib/exercises/geometry/cartesian/midpoint.js +3 -0
  173. package/lib/exercises/geometry/cartesian/signFunction.d.ts +4 -0
  174. package/lib/exercises/geometry/cartesian/signFunction.d.ts.map +1 -0
  175. package/lib/exercises/geometry/cartesian/signFunction.js +84 -0
  176. package/lib/exercises/geometry/euclidean/circleArea.d.ts.map +1 -1
  177. package/lib/exercises/geometry/euclidean/circleArea.js +3 -0
  178. package/lib/exercises/geometry/euclidean/circleCircumference.d.ts.map +1 -1
  179. package/lib/exercises/geometry/euclidean/circleCircumference.js +3 -0
  180. package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -1
  181. package/lib/exercises/geometry/euclidean/pythagore.js +8 -0
  182. package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -1
  183. package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +3 -0
  184. package/lib/exercises/geometry/euclidean/rectangleArea.d.ts.map +1 -1
  185. package/lib/exercises/geometry/euclidean/rectangleArea.js +3 -0
  186. package/lib/exercises/geometry/euclidean/rectanglePerimeter.d.ts.map +1 -1
  187. package/lib/exercises/geometry/euclidean/rectanglePerimeter.js +3 -0
  188. package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -1
  189. package/lib/exercises/geometry/euclidean/rightTriangleArea.js +3 -0
  190. package/lib/exercises/geometry/euclidean/squareArea.d.ts.map +1 -1
  191. package/lib/exercises/geometry/euclidean/squareArea.js +3 -0
  192. package/lib/exercises/geometry/euclidean/squarePerimeter.d.ts.map +1 -1
  193. package/lib/exercises/geometry/euclidean/squarePerimeter.js +3 -0
  194. package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
  195. package/lib/exercises/geometry/euclidean/thales.js +3 -0
  196. package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -1
  197. package/lib/exercises/geometry/euclidean/thalesCalcul.js +3 -0
  198. package/lib/exercises/geometry/euclidean/triangleArea.d.ts.map +1 -1
  199. package/lib/exercises/geometry/euclidean/triangleArea.js +3 -0
  200. package/lib/exercises/geometry/euclidean/triangleAreaV2.d.ts.map +1 -1
  201. package/lib/exercises/geometry/euclidean/triangleAreaV2.js +4 -0
  202. package/lib/exercises/geometry/euclidean/trianglePerimeter.d.ts.map +1 -1
  203. package/lib/exercises/geometry/euclidean/trianglePerimeter.js +3 -0
  204. package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -1
  205. package/lib/exercises/geometry/euclidean/trigonometry.js +3 -0
  206. package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -1
  207. package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +3 -0
  208. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -1
  209. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +3 -0
  210. package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
  211. package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +3 -0
  212. package/lib/exercises/limits/polynomeLimit.d.ts +4 -0
  213. package/lib/exercises/limits/polynomeLimit.d.ts.map +1 -0
  214. package/lib/exercises/limits/polynomeLimit.js +132 -0
  215. package/lib/exercises/percent/applyPercent.d.ts.map +1 -1
  216. package/lib/exercises/percent/applyPercent.js +3 -0
  217. package/lib/exercises/percent/averageEvolutionRate.d.ts.map +1 -1
  218. package/lib/exercises/percent/averageEvolutionRate.js +3 -0
  219. package/lib/exercises/percent/globalPercent.d.ts.map +1 -1
  220. package/lib/exercises/percent/globalPercent.js +3 -0
  221. package/lib/exercises/percent/reciprocalPercentage.d.ts.map +1 -1
  222. package/lib/exercises/percent/reciprocalPercentage.js +3 -0
  223. package/lib/exercises/powers/powersDivision.d.ts.map +1 -1
  224. package/lib/exercises/powers/powersDivision.js +3 -0
  225. package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
  226. package/lib/exercises/powers/powersOfTenToDecimal.js +3 -0
  227. package/lib/exercises/powers/powersPower.d.ts.map +1 -1
  228. package/lib/exercises/powers/powersPower.js +3 -0
  229. package/lib/exercises/powers/powersProduct.d.ts.map +1 -1
  230. package/lib/exercises/powers/powersProduct.js +3 -0
  231. package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
  232. package/lib/exercises/powers/scientificToDecimal.js +3 -0
  233. package/lib/exercises/primitve/constantPrimitive.d.ts +4 -0
  234. package/lib/exercises/primitve/constantPrimitive.d.ts.map +1 -0
  235. package/lib/exercises/primitve/constantPrimitive.js +56 -0
  236. package/lib/exercises/primitve/exponentialPrimitive.d.ts +4 -0
  237. package/lib/exercises/primitve/exponentialPrimitive.d.ts.map +1 -0
  238. package/lib/exercises/primitve/exponentialPrimitive.js +103 -0
  239. package/lib/exercises/primitve/logarithmePrimitive.d.ts +4 -0
  240. package/lib/exercises/primitve/logarithmePrimitive.d.ts.map +1 -0
  241. package/lib/exercises/primitve/logarithmePrimitive.js +74 -0
  242. package/lib/exercises/primitve/polynomialPrimitive.d.ts +4 -0
  243. package/lib/exercises/primitve/polynomialPrimitive.d.ts.map +1 -0
  244. package/lib/exercises/primitve/polynomialPrimitive.js +80 -0
  245. package/lib/exercises/primitve/sinCosPrimitive.d.ts +4 -0
  246. package/lib/exercises/primitve/sinCosPrimitive.d.ts.map +1 -0
  247. package/lib/exercises/primitve/sinCosPrimitive.js +112 -0
  248. package/lib/exercises/primitve/usualPrimitives.d.ts +4 -0
  249. package/lib/exercises/primitve/usualPrimitives.d.ts.map +1 -0
  250. package/lib/exercises/primitve/usualPrimitives.js +39 -0
  251. package/lib/exercises/probaStat/conditionalProbability.d.ts +4 -0
  252. package/lib/exercises/probaStat/conditionalProbability.d.ts.map +1 -0
  253. package/lib/exercises/probaStat/conditionalProbability.js +102 -0
  254. package/lib/exercises/probaStat/frequencyTable.d.ts +4 -0
  255. package/lib/exercises/probaStat/frequencyTable.d.ts.map +1 -0
  256. package/lib/exercises/probaStat/frequencyTable.js +76 -0
  257. package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts +4 -0
  258. package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts.map +1 -0
  259. package/lib/exercises/probaStat/marginalAndConditionalFrequency.js +109 -0
  260. package/lib/exercises/probaStat/median.d.ts +4 -0
  261. package/lib/exercises/probaStat/median.d.ts.map +1 -0
  262. package/lib/exercises/probaStat/median.js +82 -0
  263. package/lib/exercises/probaStat/medianList.d.ts +4 -0
  264. package/lib/exercises/probaStat/medianList.d.ts.map +1 -0
  265. package/lib/exercises/probaStat/medianList.js +67 -0
  266. package/lib/exercises/probaStat/probabilityTree.d.ts +4 -0
  267. package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -0
  268. package/lib/exercises/probaStat/probabilityTree.js +135 -0
  269. package/lib/exercises/probaStat/quartiles.d.ts +4 -0
  270. package/lib/exercises/probaStat/quartiles.d.ts.map +1 -0
  271. package/lib/exercises/probaStat/quartiles.js +96 -0
  272. package/lib/exercises/probaStat/quartilesList.d.ts +4 -0
  273. package/lib/exercises/probaStat/quartilesList.d.ts.map +1 -0
  274. package/lib/exercises/probaStat/quartilesList.js +81 -0
  275. package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
  276. package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +3 -0
  277. package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  278. package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +3 -0
  279. package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
  280. package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +3 -0
  281. package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
  282. package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +3 -0
  283. package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  284. package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +3 -0
  285. package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
  286. package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +3 -0
  287. package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  288. package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +3 -0
  289. package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  290. package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +4 -0
  291. package/lib/exercises/sequences/geometric/geometricFindReason.d.ts.map +1 -1
  292. package/lib/exercises/sequences/geometric/geometricFindReason.js +4 -0
  293. package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  294. package/lib/exercises/sequences/geometric/geometricReasonUsage.js +4 -0
  295. package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  296. package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +4 -0
  297. package/lib/exercises/squareRoots/simpifySquareRoot.d.ts.map +1 -1
  298. package/lib/exercises/squareRoots/simpifySquareRoot.js +3 -0
  299. package/lib/index.d.ts +2 -2
  300. package/lib/index.d.ts.map +1 -1
  301. package/lib/index.js +3 -3
  302. package/lib/math/polynomials/polynomial.d.ts +3 -1
  303. package/lib/math/polynomials/polynomial.d.ts.map +1 -1
  304. package/lib/math/polynomials/polynomial.js +48 -2
  305. package/lib/tree/nodes/functions/expNode.d.ts +10 -0
  306. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -0
  307. package/lib/tree/nodes/functions/expNode.js +21 -0
  308. package/lib/tree/nodes/functions/functionNode.d.ts +3 -1
  309. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  310. package/lib/tree/nodes/functions/functionNode.js +2 -0
  311. package/lib/tree/nodes/functions/logNode.d.ts +10 -0
  312. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -0
  313. package/lib/tree/nodes/functions/logNode.js +21 -0
  314. package/lib/tree/nodes/functions/sinNode.d.ts +9 -0
  315. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  316. package/lib/tree/nodes/functions/sinNode.js +20 -0
  317. package/lib/tree/parsers/simplify.d.ts.map +1 -1
  318. package/lib/tree/parsers/simplify.js +12 -0
  319. package/package.json +1 -1
@@ -37,6 +37,7 @@ function getArithmeticThresholdFind() {
37
37
  id: (0, uuid_1.v4)() + '',
38
38
  statement: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
39
39
  isRightAnswer: true,
40
+ format: 'tex',
40
41
  });
41
42
  for (let i = 0; i < n - 1; i++) {
42
43
  let isDuplicate;
@@ -46,6 +47,7 @@ function getArithmeticThresholdFind() {
46
47
  id: (0, uuid_1.v4)() + '',
47
48
  statement: (Math.floor((randValue - firstValue) / reason) + (0, randint_1.randint)(-5, 6, [1])).toString(),
48
49
  isRightAnswer: false,
50
+ format: 'tex',
49
51
  };
50
52
  isDuplicate = res.some((p) => p.statement === proposition.statement);
51
53
  } while (isDuplicate);
@@ -59,6 +61,7 @@ function getArithmeticThresholdFind() {
59
61
  answer: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
60
62
  keys: ['r', 'n', 'u', 'underscore', 'inf', 'sup', 'approx'],
61
63
  getPropositions,
64
+ answerFormat: 'tex',
62
65
  };
63
66
  return question;
64
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CAgD3D"}
1
+ {"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CAmD3D"}
@@ -33,6 +33,7 @@ function getGeometricExplicitFormulaUsage() {
33
33
  id: (0, uuid_1.v4)() + '',
34
34
  statement: (firstValue * Math.pow(reason, askedRank)).toString(),
35
35
  isRightAnswer: true,
36
+ format: 'tex',
36
37
  });
37
38
  for (let i = 0; i < n - 1; i++) {
38
39
  let isDuplicate;
@@ -42,6 +43,7 @@ function getGeometricExplicitFormulaUsage() {
42
43
  id: (0, uuid_1.v4)() + '',
43
44
  statement: (firstValue * Math.pow(reason, (0, randint_1.randint)(0, 9, [askedRank]))).toString(),
44
45
  isRightAnswer: false,
46
+ format: 'tex',
45
47
  };
46
48
  isDuplicate = res.some((p) => p.statement === proposition.statement);
47
49
  } while (isDuplicate);
@@ -55,6 +57,7 @@ function getGeometricExplicitFormulaUsage() {
55
57
  answer: (firstValue * Math.pow(reason, askedRank)).toString(),
56
58
  keys: ['n', 'u', 'underscore'],
57
59
  getPropositions,
60
+ answerFormat: 'tex',
58
61
  };
59
62
  return question;
60
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,4BAA4B,EAAE,QAU1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CA2D1D"}
1
+ {"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,4BAA4B,EAAE,QAU1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CA+D1D"}
@@ -32,11 +32,13 @@ function getGeometricFindExplicitFormula() {
32
32
  id: (0, uuid_1.v4)() + '',
33
33
  statement: (0, simplify_1.simplifyNode)(formula).toTex(),
34
34
  isRightAnswer: true,
35
+ format: 'tex',
35
36
  });
36
37
  res.push({
37
38
  id: (0, uuid_1.v4)() + '',
38
39
  statement: (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(reason), new powerNode_1.PowerNode(new numberNode_1.NumberNode(firstValue), new variableNode_1.VariableNode('n')))).toTex(),
39
40
  isRightAnswer: false,
41
+ format: 'tex',
40
42
  });
41
43
  for (let i = 0; i < n - 2; i++) {
42
44
  let isDuplicate;
@@ -47,6 +49,7 @@ function getGeometricFindExplicitFormula() {
47
49
  id: (0, uuid_1.v4)() + '',
48
50
  statement: (0, simplify_1.simplifyNode)(wrongAnswer).toTex(),
49
51
  isRightAnswer: false,
52
+ format: 'tex',
50
53
  };
51
54
  isDuplicate = res.some((p) => p.statement === proposition.statement);
52
55
  } while (isDuplicate);
@@ -60,6 +63,7 @@ function getGeometricFindExplicitFormula() {
60
63
  answer: (0, simplify_1.simplifyNode)(formula).toTex(),
61
64
  keys: ['q', 'n', 'u', 'underscore'],
62
65
  getPropositions,
66
+ answerFormat: 'tex',
63
67
  };
64
68
  return question;
65
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,mBAAmB,EAAE,QAUjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAmDjD"}
1
+ {"version":3,"file":"geometricFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,mBAAmB,EAAE,QAUjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAuDjD"}
@@ -28,12 +28,14 @@ function getGeometricFindReason() {
28
28
  id: (0, uuid_1.v4)() + '',
29
29
  statement: reason + '',
30
30
  isRightAnswer: true,
31
+ format: 'tex',
31
32
  });
32
33
  if (value2 - value1 !== 2)
33
34
  res.push({
34
35
  id: (0, uuid_1.v4)() + '',
35
36
  statement: value2 - value1 + '',
36
37
  isRightAnswer: false,
38
+ format: 'tex',
37
39
  });
38
40
  for (let i = 0; i < (value2 - value1 === 2 ? n - 1 : n - 2); i++) {
39
41
  let isDuplicate;
@@ -43,6 +45,7 @@ function getGeometricFindReason() {
43
45
  id: (0, uuid_1.v4)() + '',
44
46
  statement: reason + (0, randint_1.randint)(1, 10) + '',
45
47
  isRightAnswer: false,
48
+ format: 'tex',
46
49
  };
47
50
  isDuplicate = res.some((p) => p.statement === proposition.statement);
48
51
  } while (isDuplicate);
@@ -56,6 +59,7 @@ function getGeometricFindReason() {
56
59
  answer: reason.toString(),
57
60
  keys: ['q', 'n', 'u', 'underscore'],
58
61
  getPropositions,
62
+ answerFormat: 'tex',
59
63
  };
60
64
  return question;
61
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAkDlD"}
1
+ {"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAsDlD"}
@@ -27,12 +27,14 @@ function getGeometricReasonUsage() {
27
27
  id: (0, uuid_1.v4)() + '',
28
28
  statement: (startValue * reason).toString(),
29
29
  isRightAnswer: true,
30
+ format: 'tex',
30
31
  });
31
32
  if (startValue + reason !== 4)
32
33
  res.push({
33
34
  id: (0, uuid_1.v4)() + '',
34
35
  statement: (startValue + reason).toString(),
35
36
  isRightAnswer: false,
37
+ format: 'tex',
36
38
  });
37
39
  for (let i = 0; i < (startValue + reason === 4 ? n - 1 : n - 2); i++) {
38
40
  let isDuplicate;
@@ -42,6 +44,7 @@ function getGeometricReasonUsage() {
42
44
  id: (0, uuid_1.v4)() + '',
43
45
  statement: startValue * (reason + (0, randint_1.randint)(-reason + 1, 6, [0])) + '',
44
46
  isRightAnswer: false,
47
+ format: 'tex',
45
48
  };
46
49
  isDuplicate = res.some((p) => p.statement === proposition.statement);
47
50
  } while (isDuplicate);
@@ -55,6 +58,7 @@ function getGeometricReasonUsage() {
55
58
  answer: (startValue * reason).toString(),
56
59
  keys: ['q', 'n', 'u', 'underscore'],
57
60
  getPropositions,
61
+ answerFormat: 'tex',
58
62
  };
59
63
  return question;
60
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,UAAU,sCAAuC,SAAQ,gBAAgB;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,+BAA+B,EAAE,QAY7C,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,sCAAsC,GAAG,QAAQ,CAkD5G"}
1
+ {"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,UAAU,sCAAuC,SAAQ,gBAAgB;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,+BAA+B,EAAE,QAY7C,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,sCAAsC,GAAG,QAAQ,CAsD5G"}
@@ -27,12 +27,14 @@ function getGeometricRecurrenceFormulaUsage(options) {
27
27
  id: (0, uuid_1.v4)() + '',
28
28
  statement: (firstValue * reason).toString(),
29
29
  isRightAnswer: true,
30
+ format: 'tex',
30
31
  });
31
32
  if (firstValue + reason !== 4)
32
33
  res.push({
33
34
  id: (0, uuid_1.v4)() + '',
34
35
  statement: (firstValue + reason).toString(),
35
36
  isRightAnswer: false,
37
+ format: 'tex',
36
38
  });
37
39
  for (let i = 0; i < (firstValue + reason === 4 ? n - 1 : n - 2); i++) {
38
40
  let isDuplicate;
@@ -42,6 +44,7 @@ function getGeometricRecurrenceFormulaUsage(options) {
42
44
  id: (0, uuid_1.v4)() + '',
43
45
  statement: firstValue * (reason + (0, randint_1.randint)(-reason + 1, 6, [0])) + '',
44
46
  isRightAnswer: false,
47
+ format: 'tex',
45
48
  };
46
49
  isDuplicate = res.some((p) => p.statement === proposition.statement);
47
50
  } while (isDuplicate);
@@ -55,6 +58,7 @@ function getGeometricRecurrenceFormulaUsage(options) {
55
58
  answer: (firstValue * reason).toString(),
56
59
  keys: ['q', 'n', 'u', 'underscore'],
57
60
  getPropositions,
61
+ answerFormat: 'tex',
58
62
  };
59
63
  return question;
60
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CA+ChD"}
1
+ {"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAkDhD"}
@@ -27,6 +27,7 @@ function getSimplifySquareRoot() {
27
27
  id: (0, uuid_1.v4)() + '',
28
28
  statement: squareRoot.simplify().toTree().toTex(),
29
29
  isRightAnswer: true,
30
+ format: 'tex',
30
31
  });
31
32
  for (let i = 0; i < n - 1; i++) {
32
33
  let isDuplicate;
@@ -40,6 +41,7 @@ function getSimplifySquareRoot() {
40
41
  id: (0, uuid_1.v4)() + '',
41
42
  statement: squareRoot.simplify().toTree().toTex(),
42
43
  isRightAnswer: false,
44
+ format: 'tex',
43
45
  };
44
46
  isDuplicate = res.some((p) => p.statement === proposition.statement);
45
47
  } while (isDuplicate);
@@ -52,6 +54,7 @@ function getSimplifySquareRoot() {
52
54
  answer: squareRoot.simplify().toTree().toTex(),
53
55
  keys: [],
54
56
  getPropositions,
57
+ answerFormat: 'tex',
55
58
  };
56
59
  return question;
57
60
  }
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const allExercises: import("./exercises/exercise").Exercise[];
2
- export { allExercises };
1
+ declare const allMathExercises: import("./exercises/exercise").Exercise[];
2
+ export { allMathExercises };
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY,2CAAiB,CAAC;AAQpC,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,2CAAiB,CAAC;AAQxC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allExercises = void 0;
3
+ exports.allMathExercises = void 0;
4
4
  const exercises_1 = require("./exercises/exercises");
5
- const allExercises = [...exercises_1.exercises];
6
- exports.allExercises = allExercises;
5
+ const allMathExercises = [...exercises_1.exercises];
6
+ exports.allMathExercises = allMathExercises;
@@ -1,4 +1,5 @@
1
1
  import { Node } from '../../tree/nodes/node';
2
+ export declare function createRandomPolynomialWithOrder(order: number, variable?: string): Polynomial;
2
3
  export declare class Polynomial {
3
4
  degree: number;
4
5
  variable: string;
@@ -13,12 +14,13 @@ export declare class Polynomial {
13
14
  */
14
15
  constructor(coefficients: number[], variable?: string);
15
16
  equals(P: Polynomial): boolean;
16
- getRoots(): void;
17
+ getRoots(): number[];
17
18
  add(P: Polynomial): Polynomial;
18
19
  times(nb: number): Polynomial;
19
20
  multiply(Q: Polynomial): Polynomial;
20
21
  opposite(): Polynomial;
21
22
  derivate(): Polynomial;
23
+ integrate(): Polynomial;
22
24
  calculate(x: number): number;
23
25
  toTree(): Node;
24
26
  toTex(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,QAAQ;IACR,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAc9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAM7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAkBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAQtB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM5B,MAAM,IAAI,IAAI;IAmCd,KAAK,IAAI,MAAM;IAkBf,QAAQ,IAAI,MAAM;CAGnB"}
1
+ {"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY,GAAG,UAAU,CAYjG;AAED,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,QAAQ,IAAI,MAAM,EAAE;IA8BpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAc9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAM7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAkBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAQtB,SAAS,IAAI,UAAU;IAMvB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM5B,MAAM,IAAI,IAAI;IAmCd,KAAK,IAAI,MAAM;IAkBf,QAAQ,IAAI,MAAM;CAGnB"}
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Polynomial = void 0;
3
+ exports.Polynomial = exports.createRandomPolynomialWithOrder = void 0;
4
4
  const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
5
5
  const addNode_1 = require("../../tree/nodes/operators/addNode");
6
6
  const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
7
7
  const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
8
8
  const powerNode_1 = require("../../tree/nodes/operators/powerNode");
9
9
  const variableNode_1 = require("../../tree/nodes/variables/variableNode");
10
+ const randint_1 = require("../../math/utils/random/randint");
11
+ function createRandomPolynomialWithOrder(order, variable = 'x') {
12
+ if (order < 0) {
13
+ throw Error('Order must be a non-negative integer');
14
+ }
15
+ const coefficients = [];
16
+ for (let i = 0; i <= order - 1; i++) {
17
+ coefficients.push((0, randint_1.randint)(-9, 10));
18
+ }
19
+ coefficients.push((0, randint_1.randint)(-9, 10, [0]));
20
+ return new Polynomial(coefficients, variable);
21
+ }
22
+ exports.createRandomPolynomialWithOrder = createRandomPolynomialWithOrder;
10
23
  class Polynomial {
11
24
  /**
12
25
  *
@@ -26,7 +39,35 @@ class Polynomial {
26
39
  equals(P) {
27
40
  return P.degree === this.degree && this.coefficients.every((coeff, i) => coeff === P.coefficients[i]);
28
41
  }
29
- getRoots() { }
42
+ getRoots() {
43
+ const roots = [];
44
+ if (this.degree === 1) {
45
+ // Polynôme de degré 1 : ax + b = 0
46
+ const a = this.coefficients[1];
47
+ const b = this.coefficients[0];
48
+ if (a !== 0) {
49
+ roots.push(-b / a);
50
+ }
51
+ }
52
+ else if (this.degree === 2) {
53
+ // Polynôme de degré 2 : ax^2 + bx + c = 0
54
+ const a = this.coefficients[2];
55
+ const b = this.coefficients[1];
56
+ const c = this.coefficients[0];
57
+ const delta = b * b - 4 * a * c;
58
+ if (delta > 0) {
59
+ roots.push((-b + Math.sqrt(delta)) / (2 * a));
60
+ roots.push((-b - Math.sqrt(delta)) / (2 * a));
61
+ }
62
+ else if (delta === 0) {
63
+ roots.push(-b / (2 * a));
64
+ }
65
+ }
66
+ else {
67
+ //méthode de Newton-Raphson ou des bibliothèques de calcul symbolique pour obtenir les racines.
68
+ }
69
+ return roots.sort((a, b) => a - b);
70
+ }
30
71
  add(P) {
31
72
  var _a, _b;
32
73
  if (P.variable !== this.variable)
@@ -67,6 +108,11 @@ class Polynomial {
67
108
  res.push(i * this.coefficients[i]);
68
109
  return new Polynomial(res, this.variable);
69
110
  }
111
+ integrate() {
112
+ const newCoefficients = this.coefficients.map((coeff, exp) => coeff / (exp + 1));
113
+ newCoefficients.unshift(0);
114
+ return new Polynomial(newCoefficients, this.variable);
115
+ }
70
116
  calculate(x) {
71
117
  let res = 0;
72
118
  for (let i = 0; i < this.coefficients.length; i++)
@@ -0,0 +1,10 @@
1
+ import { Node, NodeType } from '../node';
2
+ import { FunctionNode } from './functionNode';
3
+ export declare class ExpNode extends FunctionNode implements Node {
4
+ type: NodeType;
5
+ constructor(child: Node);
6
+ toMathString(): string;
7
+ toTex(): string;
8
+ simplify(): Node;
9
+ }
10
+ //# sourceMappingURL=expNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpNode = void 0;
4
+ const node_1 = require("../node");
5
+ const functionNode_1 = require("./functionNode");
6
+ class ExpNode extends functionNode_1.FunctionNode {
7
+ constructor(child) {
8
+ super(functionNode_1.FunctionsIds.exp, child, '\\exp');
9
+ this.type = node_1.NodeType.function;
10
+ }
11
+ toMathString() {
12
+ return `e^(${this.child.toMathString()})`;
13
+ }
14
+ toTex() {
15
+ return `e^{${this.child.toTex()}}`;
16
+ }
17
+ simplify() {
18
+ return this;
19
+ }
20
+ }
21
+ exports.ExpNode = ExpNode;
@@ -3,7 +3,9 @@ export declare enum FunctionsIds {
3
3
  opposite = 0,
4
4
  sqrt = 1,
5
5
  cos = 2,
6
- sin = 3
6
+ sin = 3,
7
+ log = 4,
8
+ exp = 5
7
9
  }
8
10
  export declare abstract class FunctionNode {
9
11
  id: FunctionsIds;
@@ -1 +1 @@
1
- {"version":3,"file":"functionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/functionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,GAAG,IAAA;CACJ;AAED,8BAAsB,YAAY;IAChC,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,WAAqB;IACzB,GAAG,EAAE,MAAM,CAAC;gBACA,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM;CAKvD"}
1
+ {"version":3,"file":"functionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/functionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;CACJ;AAED,8BAAsB,YAAY;IAChC,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,WAAqB;IACzB,GAAG,EAAE,MAAM,CAAC;gBACA,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM;CAKvD"}
@@ -8,6 +8,8 @@ var FunctionsIds;
8
8
  FunctionsIds[FunctionsIds["sqrt"] = 1] = "sqrt";
9
9
  FunctionsIds[FunctionsIds["cos"] = 2] = "cos";
10
10
  FunctionsIds[FunctionsIds["sin"] = 3] = "sin";
11
+ FunctionsIds[FunctionsIds["log"] = 4] = "log";
12
+ FunctionsIds[FunctionsIds["exp"] = 5] = "exp";
11
13
  })(FunctionsIds = exports.FunctionsIds || (exports.FunctionsIds = {}));
12
14
  class FunctionNode {
13
15
  constructor(id, child, tex) {
@@ -0,0 +1,10 @@
1
+ import { Node, NodeType } from '../node';
2
+ import { FunctionNode } from './functionNode';
3
+ export declare class LogNode extends FunctionNode implements Node {
4
+ type: NodeType;
5
+ constructor(child: Node);
6
+ toMathString(): string;
7
+ toTex(): string;
8
+ simplify(): Node;
9
+ }
10
+ //# sourceMappingURL=logNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogNode = void 0;
4
+ const node_1 = require("../node");
5
+ const functionNode_1 = require("./functionNode");
6
+ class LogNode extends functionNode_1.FunctionNode {
7
+ constructor(child) {
8
+ super(functionNode_1.FunctionsIds.log, child, '\\ln');
9
+ this.type = node_1.NodeType.function;
10
+ }
11
+ toMathString() {
12
+ return `log(${this.child.toMathString()})`;
13
+ }
14
+ toTex() {
15
+ return `\\ln\\left(${this.child.toTex()}\\right)`;
16
+ }
17
+ simplify() {
18
+ return this;
19
+ }
20
+ }
21
+ exports.LogNode = LogNode;
@@ -1 +1,10 @@
1
+ import { Node, NodeType } from '../node';
2
+ import { FunctionNode } from './functionNode';
3
+ export declare class SinNode extends FunctionNode implements Node {
4
+ type: NodeType;
5
+ constructor(child: Node);
6
+ toMathString(): string;
7
+ toTex(): string;
8
+ simplify(): Node;
9
+ }
1
10
  //# sourceMappingURL=sinNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
@@ -1 +1,21 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SinNode = void 0;
4
+ const node_1 = require("../node");
5
+ const functionNode_1 = require("./functionNode");
6
+ class SinNode extends functionNode_1.FunctionNode {
7
+ constructor(child) {
8
+ super(functionNode_1.FunctionsIds.sin, child, '\\sin');
9
+ this.type = node_1.NodeType.function;
10
+ }
11
+ toMathString() {
12
+ return `sin(${this.child.toMathString()})`;
13
+ }
14
+ toTex() {
15
+ return `\\sin\\left(${this.child.toTex()}\\right)`;
16
+ }
17
+ simplify() {
18
+ return this;
19
+ }
20
+ }
21
+ exports.SinNode = SinNode;
@@ -1 +1 @@
1
- {"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/simplify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAqBrC,eAAO,MAAM,YAAY,SAAU,IAAI,KAAG,IAEzC,CAAC"}
1
+ {"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/simplify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAyBrC,eAAO,MAAM,YAAY,SAAU,IAAI,KAAG,IAEzC,CAAC"}
@@ -12,6 +12,10 @@ const multiplyNode_1 = require("../nodes/operators/multiplyNode");
12
12
  const powerNode_1 = require("../nodes/operators/powerNode");
13
13
  const substractNode_1 = require("../nodes/operators/substractNode");
14
14
  const variableNode_1 = require("../nodes/variables/variableNode");
15
+ const logNode_1 = require("../nodes/functions/logNode");
16
+ const expNode_1 = require("../nodes/functions/expNode");
17
+ const cosNode_1 = require("../../tree/nodes/functions/cosNode");
18
+ const sinNode_1 = require("../../tree/nodes/functions/sinNode");
15
19
  const simplifyNode = (node) => {
16
20
  return mathjsNodeToNode((0, mathjs_1.simplify)(node.toMathString()));
17
21
  };
@@ -46,6 +50,14 @@ const mathjsNodeToNode = (mathjsNode) => {
46
50
  switch (fn.name) {
47
51
  case 'sqrt':
48
52
  return new sqrtNode_1.SqrtNode(mathjsNodeToNode(mathjsNode.args[0]));
53
+ case 'log':
54
+ return new logNode_1.LogNode(mathjsNodeToNode(mathjsNode.args[0]));
55
+ case 'exp':
56
+ return new expNode_1.ExpNode(mathjsNodeToNode(mathjsNode.args[0]));
57
+ case 'cos':
58
+ return new cosNode_1.CosNode(mathjsNodeToNode(mathjsNode.args[0]));
59
+ case 'sin':
60
+ return new sinNode_1.SinNode(mathjsNodeToNode(mathjsNode.args[0]));
49
61
  }
50
62
  }
51
63
  throw Error('unrecognized mathjs node');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "1.3.41",
3
+ "version": "1.3.43",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [