math-exercises 1.4.18 → 2.0.1

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 (695) hide show
  1. package/lib/exercises/calcul/addAndSub.d.ts +7 -6
  2. package/lib/exercises/calcul/addAndSub.d.ts.map +1 -1
  3. package/lib/exercises/calcul/addAndSub.js +32 -49
  4. package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts +7 -6
  5. package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
  6. package/lib/exercises/calcul/addAndSubWithoutRelatives.js +28 -45
  7. package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts +13 -3
  8. package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts.map +1 -1
  9. package/lib/exercises/calcul/arithmetics/euclideanDivision.js +38 -49
  10. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts +6 -3
  11. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -1
  12. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +39 -39
  13. package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts +10 -6
  14. package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  15. package/lib/exercises/calcul/arithmetics/primeNumbers.js +75 -64
  16. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts +14 -3
  17. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  18. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +50 -54
  19. package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts +12 -3
  20. package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  21. package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +41 -52
  22. package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts +12 -3
  23. package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
  24. package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +42 -60
  25. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts +10 -3
  26. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  27. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +55 -65
  28. package/lib/exercises/calcul/fractions/fractionsDivision.d.ts +9 -3
  29. package/lib/exercises/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  30. package/lib/exercises/calcul/fractions/fractionsDivision.js +36 -52
  31. package/lib/exercises/calcul/fractions/fractionsProduct.d.ts +9 -3
  32. package/lib/exercises/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  33. package/lib/exercises/calcul/fractions/fractionsProduct.js +34 -46
  34. package/lib/exercises/calcul/fractions/fractionsSum.d.ts +9 -3
  35. package/lib/exercises/calcul/fractions/fractionsSum.d.ts.map +1 -1
  36. package/lib/exercises/calcul/fractions/fractionsSum.js +34 -52
  37. package/lib/exercises/calcul/fractions/simplifyFraction.d.ts +7 -3
  38. package/lib/exercises/calcul/fractions/simplifyFraction.d.ts.map +1 -1
  39. package/lib/exercises/calcul/fractions/simplifyFraction.js +26 -42
  40. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts +8 -3
  41. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts.map +1 -1
  42. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +31 -51
  43. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts +7 -3
  44. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts.map +1 -1
  45. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +32 -50
  46. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts +7 -3
  47. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts.map +1 -1
  48. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +32 -47
  49. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts +8 -3
  50. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts.map +1 -1
  51. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +69 -84
  52. package/lib/exercises/calcul/operations/operationsPriorities.d.ts +7 -3
  53. package/lib/exercises/calcul/operations/operationsPriorities.d.ts.map +1 -1
  54. package/lib/exercises/calcul/operations/operationsPriorities.js +25 -43
  55. package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts +7 -3
  56. package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  57. package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +25 -43
  58. package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts +7 -3
  59. package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  60. package/lib/exercises/calcul/proportionality/proportionalityTable.js +25 -43
  61. package/lib/exercises/calcul/rounding/rounding.d.ts +14 -10
  62. package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
  63. package/lib/exercises/calcul/rounding/rounding.js +52 -82
  64. package/lib/exercises/calculLitteral/distributivity/allIdentities.d.ts +12 -3
  65. package/lib/exercises/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
  66. package/lib/exercises/calculLitteral/distributivity/allIdentities.js +34 -11
  67. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts +9 -3
  68. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  69. package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +37 -64
  70. package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts +11 -3
  71. package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  72. package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +35 -66
  73. package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts +11 -3
  74. package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  75. package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +36 -67
  76. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts +10 -3
  77. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  78. package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +33 -66
  79. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts +11 -3
  80. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  81. package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +38 -68
  82. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts +9 -3
  83. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  84. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +59 -132
  85. package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts +9 -3
  86. package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  87. package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +30 -54
  88. package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts +9 -3
  89. package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  90. package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +28 -49
  91. package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts +10 -3
  92. package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  93. package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +28 -48
  94. package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts +11 -3
  95. package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  96. package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +27 -47
  97. package/lib/exercises/calculLitteral/equation/expEquation.d.ts +7 -3
  98. package/lib/exercises/calculLitteral/equation/expEquation.d.ts.map +1 -1
  99. package/lib/exercises/calculLitteral/equation/expEquation.js +27 -45
  100. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts +9 -3
  101. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  102. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +26 -48
  103. package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts +7 -3
  104. package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  105. package/lib/exercises/calculLitteral/equation/fractionEquation.js +32 -50
  106. package/lib/exercises/calculLitteral/equation/logEquation.d.ts +7 -3
  107. package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -1
  108. package/lib/exercises/calculLitteral/equation/logEquation.js +27 -45
  109. package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts +7 -3
  110. package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  111. package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +33 -52
  112. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts +9 -3
  113. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  114. package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +29 -51
  115. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts +9 -3
  116. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  117. package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +30 -58
  118. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts +9 -3
  119. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  120. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +34 -66
  121. package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts +9 -3
  122. package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  123. package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +32 -65
  124. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts +10 -3
  125. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  126. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +28 -51
  127. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts +10 -3
  128. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
  129. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.js +28 -50
  130. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts +10 -3
  131. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
  132. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.js +28 -50
  133. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts +10 -3
  134. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  135. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.js +28 -50
  136. package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts +7 -3
  137. package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  138. package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +28 -46
  139. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts +8 -3
  140. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts.map +1 -1
  141. package/lib/exercises/calculLitteral/simplifying/expSimplifiying.js +44 -61
  142. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts +8 -3
  143. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts.map +1 -1
  144. package/lib/exercises/calculLitteral/simplifying/logSimplifiying.js +29 -48
  145. package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts +9 -3
  146. package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
  147. package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +29 -46
  148. package/lib/exercises/combinatory/anagrams.d.ts +8 -3
  149. package/lib/exercises/combinatory/anagrams.d.ts.map +1 -1
  150. package/lib/exercises/combinatory/anagrams.js +29 -49
  151. package/lib/exercises/combinatory/ballsCounting.d.ts +11 -3
  152. package/lib/exercises/combinatory/ballsCounting.d.ts.map +1 -1
  153. package/lib/exercises/combinatory/ballsCounting.js +55 -74
  154. package/lib/exercises/combinatory/diceCounting.d.ts +8 -3
  155. package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -1
  156. package/lib/exercises/combinatory/diceCounting.js +64 -80
  157. package/lib/exercises/complex/addComplex.d.ts +11 -3
  158. package/lib/exercises/complex/addComplex.d.ts.map +1 -1
  159. package/lib/exercises/complex/addComplex.js +31 -52
  160. package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts +10 -0
  161. package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -0
  162. package/lib/exercises/complex/argumentFromAlgebraicComplex.js +37 -0
  163. package/lib/exercises/complex/conjugateComplex.ts.d.ts +9 -3
  164. package/lib/exercises/complex/conjugateComplex.ts.d.ts.map +1 -1
  165. package/lib/exercises/complex/conjugateComplex.ts.js +30 -59
  166. package/lib/exercises/complex/conjugateDivideComplex.d.ts +7 -3
  167. package/lib/exercises/complex/conjugateDivideComplex.d.ts.map +1 -1
  168. package/lib/exercises/complex/conjugateDivideComplex.js +26 -44
  169. package/lib/exercises/complex/conjugateMultiplyComplex.d.ts +9 -3
  170. package/lib/exercises/complex/conjugateMultiplyComplex.d.ts.map +1 -1
  171. package/lib/exercises/complex/conjugateMultiplyComplex.js +32 -52
  172. package/lib/exercises/complex/divideComplex.d.ts +7 -3
  173. package/lib/exercises/complex/divideComplex.d.ts.map +1 -1
  174. package/lib/exercises/complex/divideComplex.js +26 -44
  175. package/lib/exercises/complex/inverseComplex.d.ts +9 -3
  176. package/lib/exercises/complex/inverseComplex.d.ts.map +1 -1
  177. package/lib/exercises/complex/inverseComplex.js +30 -59
  178. package/lib/exercises/complex/linearCombinaisonComplex.d.ts +7 -3
  179. package/lib/exercises/complex/linearCombinaisonComplex.d.ts.map +1 -1
  180. package/lib/exercises/complex/linearCombinaisonComplex.js +28 -46
  181. package/lib/exercises/complex/moduloFromAlgebraicComplex.d.ts +10 -0
  182. package/lib/exercises/complex/moduloFromAlgebraicComplex.d.ts.map +1 -0
  183. package/lib/exercises/complex/moduloFromAlgebraicComplex.js +43 -0
  184. package/lib/exercises/complex/mutiplyComplex.d.ts +9 -3
  185. package/lib/exercises/complex/mutiplyComplex.d.ts.map +1 -1
  186. package/lib/exercises/complex/mutiplyComplex.js +30 -52
  187. package/lib/exercises/complex/reAndIm.d.ts +10 -3
  188. package/lib/exercises/complex/reAndIm.d.ts.map +1 -1
  189. package/lib/exercises/complex/reAndIm.js +28 -63
  190. package/lib/exercises/conversion/aeraConversion.d.ts +10 -3
  191. package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
  192. package/lib/exercises/conversion/aeraConversion.js +29 -46
  193. package/lib/exercises/conversion/capacityConversion.d.ts +10 -3
  194. package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
  195. package/lib/exercises/conversion/capacityConversion.js +28 -45
  196. package/lib/exercises/conversion/lengthConversion.d.ts +10 -3
  197. package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
  198. package/lib/exercises/conversion/lengthConversion.js +28 -44
  199. package/lib/exercises/conversion/massConversion.d.ts +10 -3
  200. package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
  201. package/lib/exercises/conversion/massConversion.js +28 -44
  202. package/lib/exercises/conversion/volumeCapacityConversion.d.ts +7 -3
  203. package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
  204. package/lib/exercises/conversion/volumeCapacityConversion.js +29 -45
  205. package/lib/exercises/conversion/volumeConversion.d.ts +10 -3
  206. package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
  207. package/lib/exercises/conversion/volumeConversion.js +29 -45
  208. package/lib/exercises/derivation/derivative/constanteDerivative.d.ts +10 -3
  209. package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
  210. package/lib/exercises/derivation/derivative/constanteDerivative.js +33 -50
  211. package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts +9 -3
  212. package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
  213. package/lib/exercises/derivation/derivative/expDerivativeOne.js +32 -36
  214. package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts +9 -3
  215. package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
  216. package/lib/exercises/derivation/derivative/expDerivativeThree.js +27 -34
  217. package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts +9 -3
  218. package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -1
  219. package/lib/exercises/derivation/derivative/expDerivativeTwo.js +30 -48
  220. package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts +11 -3
  221. package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
  222. package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +31 -48
  223. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts +8 -3
  224. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  225. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +28 -47
  226. package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts +9 -3
  227. package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
  228. package/lib/exercises/derivation/derivative/lnDerivativeOne.js +31 -36
  229. package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts +9 -3
  230. package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
  231. package/lib/exercises/derivation/derivative/lnDerivativeThree.js +36 -53
  232. package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts +9 -3
  233. package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -1
  234. package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +30 -49
  235. package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts +9 -3
  236. package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
  237. package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +30 -49
  238. package/lib/exercises/derivation/derivative/productDerivative.d.ts +9 -3
  239. package/lib/exercises/derivation/derivative/productDerivative.d.ts.map +1 -1
  240. package/lib/exercises/derivation/derivative/productDerivative.js +28 -45
  241. package/lib/exercises/derivation/derivative/quotientDerivative.d.ts +10 -3
  242. package/lib/exercises/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  243. package/lib/exercises/derivation/derivative/quotientDerivative.js +28 -45
  244. package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts +8 -3
  245. package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  246. package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +34 -59
  247. package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts +10 -3
  248. package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
  249. package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +37 -54
  250. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts +10 -3
  251. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  252. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +34 -52
  253. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts +9 -3
  254. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
  255. package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +31 -66
  256. package/lib/exercises/derivation/derivative/usualderivative.d.ts +12 -3
  257. package/lib/exercises/derivation/derivative/usualderivative.d.ts.map +1 -1
  258. package/lib/exercises/derivation/derivative/usualderivative.js +48 -19
  259. package/lib/exercises/derivation/derivativeNumberCalcul.d.ts +8 -0
  260. package/lib/exercises/derivation/derivativeNumberCalcul.d.ts.map +1 -0
  261. package/lib/exercises/derivation/derivativeNumberCalcul.js +42 -0
  262. package/lib/exercises/derivation/derivativeNumberReading.d.ts +9 -3
  263. package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
  264. package/lib/exercises/derivation/derivativeNumberReading.js +35 -47
  265. package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts +7 -3
  266. package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  267. package/lib/exercises/equaDiff/equaDiffGeneralForme.js +28 -45
  268. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts +7 -3
  269. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  270. package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.js +36 -53
  271. package/lib/exercises/exercise.d.ts +12 -6
  272. package/lib/exercises/exercise.d.ts.map +1 -1
  273. package/lib/exercises/exercise.js +19 -1
  274. package/lib/exercises/exercises.d.ts +2 -2
  275. package/lib/exercises/exercises.d.ts.map +1 -1
  276. package/lib/exercises/exercises.js +8 -0
  277. package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts +9 -3
  278. package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts.map +1 -1
  279. package/lib/exercises/functions/absolute/absoluteValueEquations.js +36 -55
  280. package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts +9 -3
  281. package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
  282. package/lib/exercises/functions/absolute/absoluteValueInequations.js +27 -47
  283. package/lib/exercises/functions/affines/leadingCoefficient.d.ts +11 -3
  284. package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
  285. package/lib/exercises/functions/affines/leadingCoefficient.js +34 -46
  286. package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts +11 -3
  287. package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
  288. package/lib/exercises/functions/affines/leadingCoefficientCalculV1.js +27 -43
  289. package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts +11 -3
  290. package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
  291. package/lib/exercises/functions/affines/leadingCoefficientCalculV2.js +26 -43
  292. package/lib/exercises/functions/affines/signFunction.d.ts +7 -3
  293. package/lib/exercises/functions/affines/signFunction.d.ts.map +1 -1
  294. package/lib/exercises/functions/affines/signFunction.js +30 -48
  295. package/lib/exercises/functions/basics/imageFunction.d.ts +7 -3
  296. package/lib/exercises/functions/basics/imageFunction.d.ts.map +1 -1
  297. package/lib/exercises/functions/basics/imageFunction.js +28 -46
  298. package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts +7 -3
  299. package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  300. package/lib/exercises/functions/basics/imageFunctionGeogebra.js +28 -45
  301. package/lib/exercises/functions/basics/inverseImageFunction.d.ts +7 -3
  302. package/lib/exercises/functions/basics/inverseImageFunction.d.ts.map +1 -1
  303. package/lib/exercises/functions/basics/inverseImageFunction.js +30 -46
  304. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts +10 -3
  305. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  306. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +36 -52
  307. package/lib/exercises/functions/cube/cubicEquation.d.ts +8 -3
  308. package/lib/exercises/functions/cube/cubicEquation.d.ts.map +1 -1
  309. package/lib/exercises/functions/cube/cubicEquation.js +26 -51
  310. package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.d.ts +12 -0
  311. package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -0
  312. package/lib/exercises/functions/rationalFraction/rationalFractionForbiddenValue.js +56 -0
  313. package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts +7 -3
  314. package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts.map +1 -1
  315. package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.js +25 -45
  316. package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts +11 -3
  317. package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts.map +1 -1
  318. package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.js +31 -66
  319. package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts +8 -3
  320. package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
  321. package/lib/exercises/functions/trinoms/canonicalFromDevForm.js +25 -42
  322. package/lib/exercises/functions/trinoms/deltaTrinom.d.ts +10 -3
  323. package/lib/exercises/functions/trinoms/deltaTrinom.d.ts.map +1 -1
  324. package/lib/exercises/functions/trinoms/deltaTrinom.js +28 -58
  325. package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts +10 -3
  326. package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts.map +1 -1
  327. package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.js +31 -69
  328. package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts +8 -3
  329. package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts.map +1 -1
  330. package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.js +24 -45
  331. package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts +7 -3
  332. package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts.map +1 -1
  333. package/lib/exercises/functions/trinoms/niceRootsFromDevForm.js +26 -45
  334. package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts +7 -3
  335. package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts.map +1 -1
  336. package/lib/exercises/functions/trinoms/rootsFromDevForm.js +26 -45
  337. package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts +10 -3
  338. package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts.map +1 -1
  339. package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.js +38 -75
  340. package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts +8 -3
  341. package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts.map +1 -1
  342. package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.js +23 -44
  343. package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts +9 -3
  344. package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
  345. package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +44 -59
  346. package/lib/exercises/geometry/cartesian/midpoint.d.ts +7 -3
  347. package/lib/exercises/geometry/cartesian/midpoint.d.ts.map +1 -1
  348. package/lib/exercises/geometry/cartesian/midpoint.js +30 -47
  349. package/lib/exercises/geometry/euclidean/circleArea.d.ts +7 -3
  350. package/lib/exercises/geometry/euclidean/circleArea.d.ts.map +1 -1
  351. package/lib/exercises/geometry/euclidean/circleArea.js +26 -43
  352. package/lib/exercises/geometry/euclidean/circleCircumference.d.ts +7 -3
  353. package/lib/exercises/geometry/euclidean/circleCircumference.d.ts.map +1 -1
  354. package/lib/exercises/geometry/euclidean/circleCircumference.js +26 -43
  355. package/lib/exercises/geometry/euclidean/pythagore.d.ts +10 -3
  356. package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -1
  357. package/lib/exercises/geometry/euclidean/pythagore.js +33 -71
  358. package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts +7 -3
  359. package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -1
  360. package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +30 -46
  361. package/lib/exercises/geometry/euclidean/rectangleArea.d.ts +7 -3
  362. package/lib/exercises/geometry/euclidean/rectangleArea.d.ts.map +1 -1
  363. package/lib/exercises/geometry/euclidean/rectangleArea.js +24 -40
  364. package/lib/exercises/geometry/euclidean/rectanglePerimeter.d.ts +7 -3
  365. package/lib/exercises/geometry/euclidean/rectanglePerimeter.d.ts.map +1 -1
  366. package/lib/exercises/geometry/euclidean/rectanglePerimeter.js +24 -40
  367. package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts +7 -3
  368. package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -1
  369. package/lib/exercises/geometry/euclidean/rightTriangleArea.js +27 -43
  370. package/lib/exercises/geometry/euclidean/squareArea.d.ts +7 -3
  371. package/lib/exercises/geometry/euclidean/squareArea.d.ts.map +1 -1
  372. package/lib/exercises/geometry/euclidean/squareArea.js +23 -39
  373. package/lib/exercises/geometry/euclidean/squarePerimeter.d.ts +8 -3
  374. package/lib/exercises/geometry/euclidean/squarePerimeter.d.ts.map +1 -1
  375. package/lib/exercises/geometry/euclidean/squarePerimeter.js +23 -39
  376. package/lib/exercises/geometry/euclidean/thales.d.ts +8 -3
  377. package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
  378. package/lib/exercises/geometry/euclidean/thales.js +41 -59
  379. package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts +7 -3
  380. package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -1
  381. package/lib/exercises/geometry/euclidean/thalesCalcul.js +27 -43
  382. package/lib/exercises/geometry/euclidean/triangleArea.d.ts +7 -3
  383. package/lib/exercises/geometry/euclidean/triangleArea.d.ts.map +1 -1
  384. package/lib/exercises/geometry/euclidean/triangleArea.js +27 -43
  385. package/lib/exercises/geometry/euclidean/triangleAreaV2.d.ts +8 -3
  386. package/lib/exercises/geometry/euclidean/triangleAreaV2.d.ts.map +1 -1
  387. package/lib/exercises/geometry/euclidean/triangleAreaV2.js +44 -64
  388. package/lib/exercises/geometry/euclidean/trianglePerimeter.d.ts +7 -3
  389. package/lib/exercises/geometry/euclidean/trianglePerimeter.d.ts.map +1 -1
  390. package/lib/exercises/geometry/euclidean/trianglePerimeter.js +24 -40
  391. package/lib/exercises/geometry/euclidean/trigonometry.d.ts +10 -3
  392. package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -1
  393. package/lib/exercises/geometry/euclidean/trigonometry.js +46 -67
  394. package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts +7 -3
  395. package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -1
  396. package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +27 -43
  397. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts +7 -3
  398. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -1
  399. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +27 -43
  400. package/lib/exercises/geometry/vectors/chasles.d.ts +8 -3
  401. package/lib/exercises/geometry/vectors/chasles.d.ts.map +1 -1
  402. package/lib/exercises/geometry/vectors/chasles.js +28 -46
  403. package/lib/exercises/geometry/vectors/coordinatesReading.d.ts +11 -3
  404. package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  405. package/lib/exercises/geometry/vectors/coordinatesReading.js +29 -48
  406. package/lib/exercises/geometry/vectors/determinant.d.ts +9 -3
  407. package/lib/exercises/geometry/vectors/determinant.d.ts.map +1 -1
  408. package/lib/exercises/geometry/vectors/determinant.js +30 -52
  409. package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts +7 -3
  410. package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
  411. package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +26 -43
  412. package/lib/exercises/geometry/vectors/scalarProductViaNorms.js +1 -1
  413. package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts +9 -3
  414. package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  415. package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.js +27 -47
  416. package/lib/exercises/limits/polynomLimit.d.ts +8 -3
  417. package/lib/exercises/limits/polynomLimit.d.ts.map +1 -1
  418. package/lib/exercises/limits/polynomLimit.js +28 -47
  419. package/lib/exercises/limits/polynomLimitNoFI.d.ts +8 -3
  420. package/lib/exercises/limits/polynomLimitNoFI.d.ts.map +1 -1
  421. package/lib/exercises/limits/polynomLimitNoFI.js +28 -48
  422. package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts +8 -3
  423. package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
  424. package/lib/exercises/limits/rationalFracForbiddenValueLimit.js +28 -48
  425. package/lib/exercises/limits/rationalFracLimit.d.ts +8 -3
  426. package/lib/exercises/limits/rationalFracLimit.d.ts.map +1 -1
  427. package/lib/exercises/limits/rationalFracLimit.js +28 -48
  428. package/lib/exercises/limits/sequenceGeometricLimit.d.ts +9 -3
  429. package/lib/exercises/limits/sequenceGeometricLimit.d.ts.map +1 -1
  430. package/lib/exercises/limits/sequenceGeometricLimit.js +26 -33
  431. package/lib/exercises/limits/sequencePolynomLimit.d.ts +8 -3
  432. package/lib/exercises/limits/sequencePolynomLimit.d.ts.map +1 -1
  433. package/lib/exercises/limits/sequencePolynomLimit.js +28 -47
  434. package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts +8 -3
  435. package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
  436. package/lib/exercises/limits/sequencePolynomNoFILimit.js +28 -48
  437. package/lib/exercises/limits/sequencePolynomProductLimit.d.ts +8 -3
  438. package/lib/exercises/limits/sequencePolynomProductLimit.d.ts.map +1 -1
  439. package/lib/exercises/limits/sequencePolynomProductLimit.js +28 -48
  440. package/lib/exercises/limits/sequenceRationalFracLimit.d.ts +8 -3
  441. package/lib/exercises/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  442. package/lib/exercises/limits/sequenceRationalFracLimit.js +28 -48
  443. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts +8 -3
  444. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts.map +1 -1
  445. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.js +27 -47
  446. package/lib/exercises/percent/applyPercent.d.ts +7 -3
  447. package/lib/exercises/percent/applyPercent.d.ts.map +1 -1
  448. package/lib/exercises/percent/applyPercent.js +32 -49
  449. package/lib/exercises/percent/averageEvolutionRate.d.ts +7 -3
  450. package/lib/exercises/percent/averageEvolutionRate.d.ts.map +1 -1
  451. package/lib/exercises/percent/averageEvolutionRate.js +31 -48
  452. package/lib/exercises/percent/evolutionToCM.d.ts +9 -3
  453. package/lib/exercises/percent/evolutionToCM.d.ts.map +1 -1
  454. package/lib/exercises/percent/evolutionToCM.js +34 -53
  455. package/lib/exercises/percent/globalPercent.d.ts +7 -3
  456. package/lib/exercises/percent/globalPercent.d.ts.map +1 -1
  457. package/lib/exercises/percent/globalPercent.js +30 -48
  458. package/lib/exercises/percent/reciprocalPercentage.d.ts +7 -3
  459. package/lib/exercises/percent/reciprocalPercentage.d.ts.map +1 -1
  460. package/lib/exercises/percent/reciprocalPercentage.js +32 -49
  461. package/lib/exercises/powers/calculateNegativePower.d.ts +9 -3
  462. package/lib/exercises/powers/calculateNegativePower.d.ts.map +1 -1
  463. package/lib/exercises/powers/calculateNegativePower.js +38 -57
  464. package/lib/exercises/powers/calculatePower.d.ts +9 -3
  465. package/lib/exercises/powers/calculatePower.d.ts.map +1 -1
  466. package/lib/exercises/powers/calculatePower.js +43 -62
  467. package/lib/exercises/powers/decimalToScientific.d.ts +8 -3
  468. package/lib/exercises/powers/decimalToScientific.d.ts.map +1 -1
  469. package/lib/exercises/powers/decimalToScientific.js +34 -54
  470. package/lib/exercises/powers/powerDefinition.d.ts +9 -3
  471. package/lib/exercises/powers/powerDefinition.d.ts.map +1 -1
  472. package/lib/exercises/powers/powerDefinition.js +27 -46
  473. package/lib/exercises/powers/powersDivision.d.ts +11 -4
  474. package/lib/exercises/powers/powersDivision.d.ts.map +1 -1
  475. package/lib/exercises/powers/powersDivision.js +33 -50
  476. package/lib/exercises/powers/powersOfTenToDecimal.d.ts +8 -3
  477. package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
  478. package/lib/exercises/powers/powersOfTenToDecimal.js +30 -46
  479. package/lib/exercises/powers/powersPower.d.ts +11 -4
  480. package/lib/exercises/powers/powersPower.d.ts.map +1 -1
  481. package/lib/exercises/powers/powersPower.js +40 -58
  482. package/lib/exercises/powers/powersProduct.d.ts +11 -4
  483. package/lib/exercises/powers/powersProduct.d.ts.map +1 -1
  484. package/lib/exercises/powers/powersProduct.js +34 -50
  485. package/lib/exercises/powers/scientificToDecimal.d.ts +9 -3
  486. package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
  487. package/lib/exercises/powers/scientificToDecimal.js +30 -48
  488. package/lib/exercises/primitve/constantPrimitive.d.ts +9 -3
  489. package/lib/exercises/primitve/constantPrimitive.d.ts.map +1 -1
  490. package/lib/exercises/primitve/constantPrimitive.js +29 -44
  491. package/lib/exercises/primitve/exponentialPrimitive.d.ts +12 -3
  492. package/lib/exercises/primitve/exponentialPrimitive.d.ts.map +1 -1
  493. package/lib/exercises/primitve/exponentialPrimitive.js +64 -72
  494. package/lib/exercises/primitve/logarithmePrimitive.d.ts +10 -3
  495. package/lib/exercises/primitve/logarithmePrimitive.d.ts.map +1 -1
  496. package/lib/exercises/primitve/logarithmePrimitive.js +41 -55
  497. package/lib/exercises/primitve/polynomialPrimitive.d.ts +10 -3
  498. package/lib/exercises/primitve/polynomialPrimitive.d.ts.map +1 -1
  499. package/lib/exercises/primitve/polynomialPrimitive.js +30 -45
  500. package/lib/exercises/primitve/sinCosPrimitive.d.ts +12 -3
  501. package/lib/exercises/primitve/sinCosPrimitive.d.ts.map +1 -1
  502. package/lib/exercises/primitve/sinCosPrimitive.js +54 -68
  503. package/lib/exercises/primitve/usualPrimitives.d.ts +12 -3
  504. package/lib/exercises/primitve/usualPrimitives.d.ts.map +1 -1
  505. package/lib/exercises/primitve/usualPrimitives.js +55 -21
  506. package/lib/exercises/probaStat/averageWithTable.d.ts +7 -3
  507. package/lib/exercises/probaStat/averageWithTable.d.ts.map +1 -1
  508. package/lib/exercises/probaStat/averageWithTable.js +28 -44
  509. package/lib/exercises/probaStat/ballsBasicProbas.d.ts +9 -3
  510. package/lib/exercises/probaStat/ballsBasicProbas.d.ts.map +1 -1
  511. package/lib/exercises/probaStat/ballsBasicProbas.js +30 -49
  512. package/lib/exercises/probaStat/cardBasicProbas.d.ts +8 -3
  513. package/lib/exercises/probaStat/cardBasicProbas.d.ts.map +1 -1
  514. package/lib/exercises/probaStat/cardBasicProbas.js +36 -55
  515. package/lib/exercises/probaStat/conditionalProbability.d.ts +7 -3
  516. package/lib/exercises/probaStat/conditionalProbability.d.ts.map +1 -1
  517. package/lib/exercises/probaStat/conditionalProbability.js +25 -43
  518. package/lib/exercises/probaStat/diceBasicProbas.d.ts +10 -3
  519. package/lib/exercises/probaStat/diceBasicProbas.d.ts.map +1 -1
  520. package/lib/exercises/probaStat/diceBasicProbas.js +36 -55
  521. package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts +11 -3
  522. package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts.map +1 -1
  523. package/lib/exercises/probaStat/marginalAndConditionalFrequency.js +47 -59
  524. package/lib/exercises/probaStat/median.d.ts +8 -3
  525. package/lib/exercises/probaStat/median.d.ts.map +1 -1
  526. package/lib/exercises/probaStat/median.js +30 -47
  527. package/lib/exercises/probaStat/medianList.d.ts +8 -3
  528. package/lib/exercises/probaStat/medianList.d.ts.map +1 -1
  529. package/lib/exercises/probaStat/medianList.js +27 -46
  530. package/lib/exercises/probaStat/probabilityTree.d.ts +16 -3
  531. package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -1
  532. package/lib/exercises/probaStat/probabilityTree.js +50 -58
  533. package/lib/exercises/probaStat/quartiles.d.ts +8 -3
  534. package/lib/exercises/probaStat/quartiles.d.ts.map +1 -1
  535. package/lib/exercises/probaStat/quartiles.js +30 -47
  536. package/lib/exercises/probaStat/quartilesList.d.ts +8 -3
  537. package/lib/exercises/probaStat/quartilesList.d.ts.map +1 -1
  538. package/lib/exercises/probaStat/quartilesList.js +36 -56
  539. package/lib/exercises/probaStat/stats2var/averagePoint.d.ts +8 -0
  540. package/lib/exercises/probaStat/stats2var/averagePoint.d.ts.map +1 -0
  541. package/lib/exercises/probaStat/stats2var/averagePoint.js +55 -0
  542. package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts +10 -3
  543. package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
  544. package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +27 -44
  545. package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts +9 -3
  546. package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  547. package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +26 -44
  548. package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts +7 -3
  549. package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
  550. package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +27 -44
  551. package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts +7 -3
  552. package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
  553. package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +27 -44
  554. package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts +7 -3
  555. package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  556. package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +27 -44
  557. package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts +10 -3
  558. package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
  559. package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +27 -44
  560. package/lib/exercises/sequences/arithmetic/firstIntegersSum.d.ts +8 -3
  561. package/lib/exercises/sequences/arithmetic/firstIntegersSum.d.ts.map +1 -1
  562. package/lib/exercises/sequences/arithmetic/firstIntegersSum.js +26 -53
  563. package/lib/exercises/sequences/explicitFormulaUsage.d.ts +9 -21
  564. package/lib/exercises/sequences/explicitFormulaUsage.d.ts.map +1 -1
  565. package/lib/exercises/sequences/explicitFormulaUsage.js +29 -65
  566. package/lib/exercises/sequences/genericSequenceVariations.d.ts +8 -3
  567. package/lib/exercises/sequences/genericSequenceVariations.d.ts.map +1 -1
  568. package/lib/exercises/sequences/genericSequenceVariations.js +27 -34
  569. package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts +10 -3
  570. package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  571. package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +27 -44
  572. package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts +9 -3
  573. package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  574. package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +28 -51
  575. package/lib/exercises/sequences/geometric/geometricFindReason.d.ts +9 -3
  576. package/lib/exercises/sequences/geometric/geometricFindReason.d.ts.map +1 -1
  577. package/lib/exercises/sequences/geometric/geometricFindReason.js +29 -51
  578. package/lib/exercises/sequences/geometric/geometricFirstTermsSum.d.ts +9 -3
  579. package/lib/exercises/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  580. package/lib/exercises/sequences/geometric/geometricFirstTermsSum.js +27 -55
  581. package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts +9 -3
  582. package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  583. package/lib/exercises/sequences/geometric/geometricReasonUsage.js +29 -51
  584. package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts +9 -3
  585. package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  586. package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +28 -50
  587. package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts +10 -3
  588. package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  589. package/lib/exercises/sequences/recurrenceFormulaUsage.js +28 -46
  590. package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +9 -3
  591. package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  592. package/lib/exercises/sets/intervals/inequalityToInterval.js +67 -105
  593. package/lib/exercises/sets/intervals/intervalBelonging.d.ts +0 -3
  594. package/lib/exercises/sets/intervals/intervalBelonging.d.ts.map +1 -1
  595. package/lib/exercises/sets/intervals/intervalBelonging.js +64 -68
  596. package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +9 -3
  597. package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  598. package/lib/exercises/sets/intervals/intervalsIntersection.js +28 -51
  599. package/lib/exercises/sets/intervals/intervalsUnion.d.ts +9 -3
  600. package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
  601. package/lib/exercises/sets/intervals/intervalsUnion.js +28 -50
  602. package/lib/exercises/sets/setBelonging.d.ts +7 -3
  603. package/lib/exercises/sets/setBelonging.d.ts.map +1 -1
  604. package/lib/exercises/sets/setBelonging.js +27 -45
  605. package/lib/exercises/squareRoots/simpifySquareRoot.d.ts +7 -3
  606. package/lib/exercises/squareRoots/simpifySquareRoot.d.ts.map +1 -1
  607. package/lib/exercises/squareRoots/simpifySquareRoot.js +32 -48
  608. package/lib/exercises/squareRoots/squareRootEquation.d.ts +8 -3
  609. package/lib/exercises/squareRoots/squareRootEquation.d.ts.map +1 -1
  610. package/lib/exercises/squareRoots/squareRootEquation.js +28 -56
  611. package/lib/exercises/trigonometry/mainRemarkableValues.d.ts +7 -3
  612. package/lib/exercises/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  613. package/lib/exercises/trigonometry/mainRemarkableValues.js +36 -45
  614. package/lib/exercises/trigonometry/remarkableValues.d.ts +7 -3
  615. package/lib/exercises/trigonometry/remarkableValues.d.ts.map +1 -1
  616. package/lib/exercises/trigonometry/remarkableValues.js +38 -50
  617. package/lib/exercises/utils/getDistinctQuestions.d.ts +1 -1
  618. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  619. package/lib/index.d.ts +1 -1
  620. package/lib/index.d.ts.map +1 -1
  621. package/lib/math/complex/complex.d.ts +7 -2
  622. package/lib/math/complex/complex.d.ts.map +1 -1
  623. package/lib/math/complex/complex.js +41 -7
  624. package/lib/math/numbers/nombre.d.ts +6 -1
  625. package/lib/math/numbers/nombre.d.ts.map +1 -1
  626. package/lib/math/numbers/rationals/rational.d.ts +6 -1
  627. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  628. package/lib/math/numbers/rationals/rational.js +3 -3
  629. package/lib/math/numbers/reals/real.d.ts +3 -3
  630. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  631. package/lib/math/numbers/reals/real.js +8 -5
  632. package/lib/math/sequences/geometricSequence.d.ts.map +1 -1
  633. package/lib/math/sequences/geometricSequence.js +3 -1
  634. package/lib/math/utils/latex/frenchify.d.ts +2 -0
  635. package/lib/math/utils/latex/frenchify.d.ts.map +1 -0
  636. package/lib/math/utils/latex/frenchify.js +7 -0
  637. package/lib/server.js +21 -1
  638. package/lib/tree/nodes/complex/complexNode.d.ts +2 -0
  639. package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
  640. package/lib/tree/nodes/complex/complexNode.js +24 -0
  641. package/lib/tree/nodes/functions/cosNode.d.ts +2 -0
  642. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  643. package/lib/tree/nodes/functions/cosNode.js +11 -0
  644. package/lib/tree/nodes/functions/expNode.d.ts +8 -1
  645. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  646. package/lib/tree/nodes/functions/expNode.js +17 -1
  647. package/lib/tree/nodes/functions/logNode.d.ts +2 -0
  648. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  649. package/lib/tree/nodes/functions/logNode.js +11 -0
  650. package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -0
  651. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  652. package/lib/tree/nodes/functions/oppositeNode.js +11 -0
  653. package/lib/tree/nodes/functions/sinNode.d.ts +2 -0
  654. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  655. package/lib/tree/nodes/functions/sinNode.js +11 -0
  656. package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -0
  657. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  658. package/lib/tree/nodes/functions/sqrtNode.js +11 -0
  659. package/lib/tree/nodes/node.d.ts +2 -0
  660. package/lib/tree/nodes/node.d.ts.map +1 -1
  661. package/lib/tree/nodes/numbers/constantNode.d.ts +2 -0
  662. package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
  663. package/lib/tree/nodes/numbers/constantNode.js +6 -0
  664. package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
  665. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  666. package/lib/tree/nodes/numbers/numberNode.js +11 -0
  667. package/lib/tree/nodes/operators/addNode.d.ts +2 -0
  668. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  669. package/lib/tree/nodes/operators/addNode.js +19 -1
  670. package/lib/tree/nodes/operators/divideNode.d.ts +2 -0
  671. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  672. package/lib/tree/nodes/operators/divideNode.js +32 -15
  673. package/lib/tree/nodes/operators/equalNode.d.ts +8 -1
  674. package/lib/tree/nodes/operators/equalNode.d.ts.map +1 -1
  675. package/lib/tree/nodes/operators/equalNode.js +20 -1
  676. package/lib/tree/nodes/operators/fractionNode.d.ts +8 -1
  677. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  678. package/lib/tree/nodes/operators/fractionNode.js +29 -1
  679. package/lib/tree/nodes/operators/multiplyNode.d.ts +8 -2
  680. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  681. package/lib/tree/nodes/operators/multiplyNode.js +22 -4
  682. package/lib/tree/nodes/operators/powerNode.d.ts +8 -1
  683. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  684. package/lib/tree/nodes/operators/powerNode.js +27 -1
  685. package/lib/tree/nodes/operators/substractNode.d.ts +2 -0
  686. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  687. package/lib/tree/nodes/operators/substractNode.js +14 -0
  688. package/lib/tree/nodes/variables/variableNode.d.ts +2 -0
  689. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  690. package/lib/tree/nodes/variables/variableNode.js +6 -0
  691. package/lib/utils/average.d.ts +2 -0
  692. package/lib/utils/average.d.ts.map +1 -0
  693. package/lib/utils/average.js +9 -0
  694. package/lib/utils/coinFlip.d.ts +1 -1
  695. package/package.json +2 -1
@@ -2,10 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Complex = exports.ComplexConstructor = void 0;
4
4
  const complexNode_1 = require("../../tree/nodes/complex/complexNode");
5
+ const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
6
+ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
7
+ const piNode_1 = require("../../tree/nodes/numbers/piNode");
5
8
  const addNode_1 = require("../../tree/nodes/operators/addNode");
9
+ const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
6
10
  const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
7
11
  const variableNode_1 = require("../../tree/nodes/variables/variableNode");
8
12
  const rational_1 = require("../numbers/rationals/rational");
13
+ const real_1 = require("../numbers/reals/real");
9
14
  const randint_1 = require("../utils/random/randint");
10
15
  class ComplexConstructor {
11
16
  static random() {
@@ -39,22 +44,22 @@ class Complex {
39
44
  const conj = this.conjugate();
40
45
  const invRe = new rational_1.Rational(conj.re, moduleSq).simplify().toTree();
41
46
  const invIm = new rational_1.Rational(conj.im, moduleSq).simplify().toTree();
42
- return new addNode_1.AddNode(invRe, new multiplyNode_1.MultiplyNode(invIm, new variableNode_1.VariableNode('i')));
47
+ return new addNode_1.AddNode(invRe, new multiplyNode_1.MultiplyNode(invIm, new variableNode_1.VariableNode("i")));
43
48
  }
44
49
  divideNode(z) {
45
50
  const moduleSq = z.moduleSquared();
46
51
  const newRe = new rational_1.Rational(this.re * z.re + this.im * z.im, moduleSq).simplify().toTree();
47
52
  const newIm = new rational_1.Rational(this.im * z.re - z.im * this.re, moduleSq).simplify().toTree();
48
53
  let imNode;
49
- if (newIm.toTex() === '0')
54
+ if (newIm.toTex() === "0")
50
55
  return newRe;
51
- if (newIm.toTex() === '1')
52
- imNode = new variableNode_1.VariableNode('i');
56
+ if (newIm.toTex() === "1")
57
+ imNode = new variableNode_1.VariableNode("i");
53
58
  else
54
- imNode = new multiplyNode_1.MultiplyNode(newIm, new variableNode_1.VariableNode('i'));
55
- if (newRe.toTex() === '0')
59
+ imNode = new multiplyNode_1.MultiplyNode(newIm, new variableNode_1.VariableNode("i"));
60
+ if (newRe.toTex() === "0")
56
61
  return imNode;
57
- return new addNode_1.AddNode(newRe, new multiplyNode_1.MultiplyNode(newIm, new variableNode_1.VariableNode('i')));
62
+ return new addNode_1.AddNode(newRe, new multiplyNode_1.MultiplyNode(newIm, new variableNode_1.VariableNode("i")));
58
63
  }
59
64
  multiply(z) {
60
65
  return new Complex(this.re * z.re - this.im * z.im, this.re * z.im + this.im * z.re);
@@ -65,6 +70,35 @@ class Complex {
65
70
  conjugate() {
66
71
  return new Complex(this.re, -this.im);
67
72
  }
73
+ toArgumentTree() {
74
+ if (this.re === 0 && this.im === 0)
75
+ throw Error("0 n'a pas d'argument");
76
+ if (this.re === 0) {
77
+ const piOver2 = new fractionNode_1.FractionNode(piNode_1.PiNode, new numberNode_1.NumberNode(2));
78
+ if (this.im > 0)
79
+ return piOver2;
80
+ else
81
+ return new oppositeNode_1.OppositeNode(piOver2);
82
+ }
83
+ if (this.im === 0) {
84
+ if (this.re > 0)
85
+ return new numberNode_1.NumberNode(0);
86
+ else
87
+ return piNode_1.PiNode;
88
+ }
89
+ if (this.re > 0) {
90
+ //arctan(b/a)
91
+ }
92
+ if (this.im > 0) {
93
+ //arctan(b/a)+pi
94
+ }
95
+ if (this.im < 0) {
96
+ //arctan(b/a)-pi
97
+ }
98
+ }
99
+ toModuleTree() {
100
+ return new real_1.SquareRoot(this.re ** 2 + this.im ** 2).simplify().toTree();
101
+ }
68
102
  toTree() {
69
103
  return new complexNode_1.ComplexNode(this.re, this.im);
70
104
  }
@@ -1,4 +1,5 @@
1
1
  import { Node } from '../../tree/nodes/node';
2
+ import { FractionNodeOptions } from '../../tree/nodes/operators/fractionNode';
2
3
  import { Integer } from './integer/integer';
3
4
  export declare enum NumberType {
4
5
  Integer = 0,
@@ -6,13 +7,17 @@ export declare enum NumberType {
6
7
  Rational = 2,
7
8
  Real = 3
8
9
  }
10
+ type ToTreeOpts = {
11
+ FractionNodeOpts?: FractionNodeOptions;
12
+ };
9
13
  export interface Nombre {
10
14
  value: number;
11
15
  tex: string;
12
16
  type: NumberType;
13
- toTree: () => Node;
17
+ toTree: (opts?: ToTreeOpts) => Node;
14
18
  }
15
19
  export declare abstract class NombreConstructor {
16
20
  static random(): import("./decimals/decimal").Decimal | Integer | import("./rationals/rational").Rational | import("./reals/real").Real;
17
21
  }
22
+ export {};
18
23
  //# sourceMappingURL=nombre.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AACD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM;CAad"}
1
+ {"version":3,"file":"nombre.d.ts","sourceRoot":"","sources":["../../../src/math/numbers/nombre.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAI9E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AAED,KAAK,UAAU,GAAG;IAChB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACxC,CAAC;AACF,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC;AAED,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM;CAad"}
@@ -1,5 +1,9 @@
1
1
  import { Node } from '../../../tree/nodes/node';
2
+ import { FractionNodeOptions } from '../../../tree/nodes/operators/fractionNode';
2
3
  import { Nombre, NumberType } from '../nombre';
4
+ type ToTreeOpts = {
5
+ FractionNodeOpts?: FractionNodeOptions;
6
+ };
3
7
  export declare abstract class RationalConstructor {
4
8
  /**
5
9
  * @param maxGcd max number by which the fraction is simplifiable
@@ -21,7 +25,8 @@ export declare class Rational implements Nombre {
21
25
  multiply(nb: Nombre): Nombre;
22
26
  divide(nb: Nombre): Nombre;
23
27
  opposite(): Rational;
24
- toTree(): Node;
28
+ toTree(opts?: ToTreeOpts): Node;
25
29
  simplify(): Nombre;
26
30
  }
31
+ export {};
27
32
  //# sourceMappingURL=rational.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW;IAO1C,MAAM,CAAC,0BAA0B,CAAC,GAAG,GAAE,MAAW;CAQnD;AAED,qBAAa,QAAS,YAAW,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAUlD,KAAK;IAIL,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB5B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,IAAI,IAAI;IAKd,QAAQ,IAAI,MAAM;CAMnB"}
1
+ {"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAM5F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,KAAK,UAAU,GAAG;IAChB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACxC,CAAC;AACF,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW;IAO1C,MAAM,CAAC,0BAA0B,CAAC,GAAG,GAAE,MAAW;CAQnD;AAED,qBAAa,QAAS,YAAW,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAUlD,KAAK;IAIL,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB5B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAQ/B,QAAQ,IAAI,MAAM;CAMnB"}
@@ -110,10 +110,10 @@ class Rational {
110
110
  opposite() {
111
111
  return new Rational(-this.num, this.denum);
112
112
  }
113
- toTree() {
113
+ toTree(opts) {
114
114
  if (this.num < 0)
115
- return new oppositeNode_1.OppositeNode(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-this.num), new numberNode_1.NumberNode(this.denum)));
116
- return new fractionNode_1.FractionNode(new numberNode_1.NumberNode(this.num), new numberNode_1.NumberNode(this.denum));
115
+ return new oppositeNode_1.OppositeNode(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-this.num), new numberNode_1.NumberNode(this.denum), opts?.FractionNodeOpts));
116
+ return new fractionNode_1.FractionNode(new numberNode_1.NumberNode(this.num), new numberNode_1.NumberNode(this.denum), opts?.FractionNodeOpts);
117
117
  }
118
118
  simplify() {
119
119
  const sign = (this.num > 0 && this.denum > 0) || (this.num < 0 && this.denum < 0) ? 1 : -1;
@@ -1,5 +1,5 @@
1
- import { Node } from '../../../tree/nodes/node';
2
- import { Nombre, NumberType } from '../nombre';
1
+ import { Node } from "../../../tree/nodes/node";
2
+ import { Nombre, NumberType } from "../nombre";
3
3
  export declare abstract class RealConstructor {
4
4
  static random(): Real;
5
5
  }
@@ -24,7 +24,7 @@ export declare class SquareRoot extends Real {
24
24
  operand: number;
25
25
  constructor(operand: number);
26
26
  getSimplifiedCoeffs(): [number, number];
27
- simplify(): Real;
27
+ simplify(): Nombre;
28
28
  toTex(): string;
29
29
  toTree(): Node;
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"real.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/real.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM;CAUd;AACD,qBAAa,IAAK,YAAW,MAAM;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBACL,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKtC,MAAM,IAAI,IAAI;CAIf;AAED,8BAAsB,qBAAqB;IACzC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,EAAE,kBAA0B,EAAE,SAAc,EAAE;;;KAAA,GAAG,UAAU;IASrF,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW,GAAG,UAAU;CAIxD;AAED,qBAAa,UAAW,SAAQ,IAAI;IAClC,OAAO,EAAE,MAAM,CAAC;gBACJ,OAAO,EAAE,MAAM;IAK3B,mBAAmB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAevC,QAAQ,IAAI,IAAI;IAoBhB,KAAK,IAAI,MAAM;IAIf,MAAM,IAAI,IAAI;CAGf"}
1
+ {"version":3,"file":"real.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/reals/real.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM;CAUd;AACD,qBAAa,IAAK,YAAW,MAAM;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBACL,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKtC,MAAM,IAAI,IAAI;CAIf;AAED,8BAAsB,qBAAqB;IACzC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,EAAE,kBAA0B,EAAE,SAAc,EAAE;;;KAAA,GAAG,UAAU;IASrF,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW,GAAG,UAAU;CAIxD;AAED,qBAAa,UAAW,SAAQ,IAAI;IAClC,OAAO,EAAE,MAAM,CAAC;gBACJ,OAAO,EAAE,MAAM;IAK3B,mBAAmB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAevC,QAAQ,IAAI,MAAM;IAqBlB,KAAK,IAAI,MAAM;IAIf,MAAM,IAAI,IAAI;CAGf"}
@@ -10,6 +10,7 @@ const piNode_1 = require("../../../tree/nodes/numbers/piNode");
10
10
  const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
11
11
  const diceFlip_1 = require("../../../utils/diceFlip");
12
12
  const random_1 = require("../../../utils/random");
13
+ const integer_1 = require("../integer/integer");
13
14
  const primes_1 = require("../integer/primes");
14
15
  const nombre_1 = require("../nombre");
15
16
  class RealConstructor {
@@ -17,11 +18,11 @@ class RealConstructor {
17
18
  const dice = (0, diceFlip_1.diceFlip)(2);
18
19
  switch (dice) {
19
20
  case 0:
20
- return new Real(Math.PI, '\\pi');
21
+ return new Real(Math.PI, "\\pi");
21
22
  case 1:
22
23
  return SquareRootConstructor.randomIrreductible();
23
24
  }
24
- return new Real(Math.PI, '\\pi');
25
+ return new Real(Math.PI, "\\pi");
25
26
  }
26
27
  }
27
28
  exports.RealConstructor = RealConstructor;
@@ -32,7 +33,7 @@ class Real {
32
33
  this.type = nombre_1.NumberType.Real;
33
34
  }
34
35
  toTree() {
35
- if (this.tex === '\\pi')
36
+ if (this.tex === "\\pi")
36
37
  return piNode_1.PiNode;
37
38
  return new numberNode_1.NumberNode(this.value);
38
39
  }
@@ -78,10 +79,12 @@ class SquareRoot extends Real {
78
79
  return [outsideSqrt, insideSqrt];
79
80
  }
80
81
  simplify() {
82
+ if (this.operand === 0)
83
+ return new integer_1.Integer(0);
81
84
  const [outsideSqrt, insideSqrt] = this.getSimplifiedCoeffs();
82
85
  const simplified = insideSqrt !== 1
83
- ? new Real(outsideSqrt * Math.sqrt(insideSqrt), `${outsideSqrt === 1 ? '' : `${outsideSqrt}`}\\sqrt{${insideSqrt}}`)
84
- : new Real(outsideSqrt, outsideSqrt + '');
86
+ ? new Real(outsideSqrt * Math.sqrt(insideSqrt), `${outsideSqrt === 1 ? "" : `${outsideSqrt}`}\\sqrt{${insideSqrt}}`)
87
+ : new Real(outsideSqrt, outsideSqrt + "");
85
88
  simplified.toTree = () => {
86
89
  return insideSqrt !== 1
87
90
  ? outsideSqrt === 1
@@ -1 +1 @@
1
- {"version":3,"file":"geometricSequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/geometricSequence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAOvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIvD,8BAAsB,4BAA4B;IAChD,MAAM,CAAC,MAAM,CAAC,UAAU,GAAE,UAA+B;IAkBzD,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,UAAU;CAsB/C;AAED,qBAAa,iBAAiB;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;gBAEH,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK7C,QAAQ;IAMR,MAAM;CAGP"}
1
+ {"version":3,"file":"geometricSequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/geometricSequence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAOvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIvD,8BAAsB,4BAA4B;IAChD,MAAM,CAAC,MAAM,CAAC,UAAU,GAAE,UAA+B;IAkBzD,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,UAAU;CAsB/C;AAED,qBAAa,iBAAiB;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;gBAEH,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK7C,QAAQ;IAMR,MAAM;CAKP"}
@@ -68,7 +68,9 @@ class GeometricSequence {
68
68
  return '0';
69
69
  }
70
70
  toTree() {
71
- return new multiplyNode_1.MultiplyNode(this.firstTerm.toTree(), new powerNode_1.PowerNode(this.reason.toTree(), new variableNode_1.VariableNode('n')), true);
71
+ return new multiplyNode_1.MultiplyNode(this.firstTerm.toTree(), new powerNode_1.PowerNode(this.reason.toTree(), new variableNode_1.VariableNode('n')), {
72
+ forceTimesSign: true,
73
+ });
72
74
  }
73
75
  }
74
76
  exports.GeometricSequence = GeometricSequence;
@@ -0,0 +1,2 @@
1
+ export declare const frenchify: (s: string) => string;
2
+ //# sourceMappingURL=frenchify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frenchify.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/latex/frenchify.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,MAAO,MAAM,WAElC,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.frenchify = void 0;
4
+ const frenchify = (s) => {
5
+ return s.replace('.', ',');
6
+ };
7
+ exports.frenchify = frenchify;
package/lib/server.js CHANGED
@@ -5,8 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const exercises_1 = require("./exercises/exercises");
7
7
  const express_1 = __importDefault(require("express"));
8
+ const body_parser_1 = __importDefault(require("body-parser"));
8
9
  const dotenv_1 = __importDefault(require("dotenv"));
9
10
  const cors_1 = __importDefault(require("cors"));
11
+ const jsonParser = body_parser_1.default.json();
10
12
  const allExercises = [...exercises_1.exercises];
11
13
  const runServer = () => {
12
14
  dotenv_1.default.config();
@@ -37,7 +39,7 @@ const runServer = () => {
37
39
  res.send('Exo not found');
38
40
  const questions = exo?.generator(10);
39
41
  const populatedQuestions = questions?.map((q) => {
40
- return { ...q, propositions: q.getPropositions?.(4) };
42
+ return { ...q, propositions: exo.getPropositions?.(4, q.qcmGeneratorProps) };
41
43
  });
42
44
  res.json({
43
45
  exercise: exo,
@@ -46,6 +48,24 @@ const runServer = () => {
46
48
  prevId: allExercises[(exoIndex - 1 + allExercises.length) % allExercises.length].id,
47
49
  });
48
50
  });
51
+ app.post('/vea', jsonParser, (req, res) => {
52
+ const exoId = req.query.exoId;
53
+ const { ans, veaProps } = req.body;
54
+ const exoIndex = allExercises.findIndex((exo) => exo.id == exoId);
55
+ const exo = allExercises[exoIndex];
56
+ if (!exo) {
57
+ res.send('Exo not found');
58
+ return;
59
+ }
60
+ if (!exo.isAnswerValid) {
61
+ res.send('No VEA implemented');
62
+ return;
63
+ }
64
+ const result = exo.isAnswerValid(ans, veaProps) ?? false;
65
+ res.json({
66
+ result,
67
+ });
68
+ });
49
69
  app.listen('5000', () => {
50
70
  console.log(`[server]: Server is running at http://localhost:5000`);
51
71
  });
@@ -7,6 +7,8 @@ export declare class ComplexNode implements Node {
7
7
  im: number;
8
8
  type: NodeType;
9
9
  constructor(re: number, im: number, tex?: string, mathString?: string);
10
+ toEquivalentNodes(): Node[];
11
+ toAllValidTexs(): string[];
10
12
  toMathString(): string;
11
13
  toTex(): string;
12
14
  toMathjs(): import("mathjs").Complex;
@@ -1 +1 @@
1
- {"version":3,"file":"complexNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/complex/complexNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,qBAAa,WAAY,YAAW,IAAI;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAmB;gBAErB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAyBrE,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,SAAS;CAGV"}
1
+ {"version":3,"file":"complexNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/complex/complexNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAOrD,qBAAa,WAAY,YAAW,IAAI;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAmB;gBAErB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAwBrE,iBAAiB,IAAI,IAAI,EAAE;IAqB3B,cAAc,IAAI,MAAM,EAAE;IAG1B,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,SAAS;CAGV"}
@@ -4,6 +4,11 @@ exports.ComplexNode = void 0;
4
4
  const mathjs_1 = require("mathjs");
5
5
  const node_1 = require("../node");
6
6
  const complex_1 = require("../../../math/complex/complex");
7
+ const numberNode_1 = require("../numbers/numberNode");
8
+ const variableNode_1 = require("../variables/variableNode");
9
+ const oppositeNode_1 = require("../functions/oppositeNode");
10
+ const multiplyNode_1 = require("../operators/multiplyNode");
11
+ const addNode_1 = require("../operators/addNode");
7
12
  class ComplexNode {
8
13
  constructor(re, im, tex, mathString) {
9
14
  this.type = node_1.NodeType.number;
@@ -27,6 +32,25 @@ class ComplexNode {
27
32
  this.tex = tex || formatedTex;
28
33
  this.mathString = mathString || this.tex;
29
34
  }
35
+ toEquivalentNodes() {
36
+ const res = [];
37
+ if (this.im === 0) {
38
+ return [new numberNode_1.NumberNode(this.re)];
39
+ }
40
+ if (this.re === 0) {
41
+ if (this.im === 1) {
42
+ return [new variableNode_1.VariableNode('i')];
43
+ }
44
+ if (this.im === -1) {
45
+ return [new oppositeNode_1.OppositeNode(new variableNode_1.VariableNode('i'))];
46
+ }
47
+ return new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(this.im), new variableNode_1.VariableNode('i')).toEquivalentNodes();
48
+ }
49
+ return new addNode_1.AddNode(new numberNode_1.NumberNode(this.re), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(this.im), new variableNode_1.VariableNode('i'))).toEquivalentNodes();
50
+ }
51
+ toAllValidTexs() {
52
+ return this.toEquivalentNodes().map((node) => node.toTex());
53
+ }
30
54
  toMathString() {
31
55
  return `${this.mathString ? this.mathString : this.tex}`;
32
56
  }
@@ -4,6 +4,8 @@ export declare class CosNode extends FunctionNode implements Node {
4
4
  type: NodeType;
5
5
  constructor(child: Node);
6
6
  toMathString(): string;
7
+ toEquivalentNodes(): Node[];
8
+ toAllValidTexs(): string[];
7
9
  toTex(): string;
8
10
  toMathjs(): number;
9
11
  simplify(): Node;
@@ -1 +1 @@
1
- {"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AACA,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;IAIR,QAAQ,IAAI,IAAI;CAGjB"}
1
+ {"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AACA,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,iBAAiB,IAAI,IAAI,EAAE;IAS3B,cAAc,IAAI,MAAM,EAAE;IAI1B,KAAK,IAAI,MAAM;IAIf,QAAQ;IAIR,QAAQ,IAAI,IAAI;CAGjB"}
@@ -12,6 +12,17 @@ class CosNode extends functionNode_1.FunctionNode {
12
12
  toMathString() {
13
13
  return `cos(${this.child.toMathString()})`;
14
14
  }
15
+ toEquivalentNodes() {
16
+ const res = [];
17
+ const childNodes = this.child.toEquivalentNodes();
18
+ childNodes.forEach((childNode) => {
19
+ res.push(new CosNode(childNode));
20
+ });
21
+ return res;
22
+ }
23
+ toAllValidTexs() {
24
+ return this.toEquivalentNodes().map((node) => node.toTex());
25
+ }
15
26
  toTex() {
16
27
  return `\\cos\\left(${this.child.toTex()}\\right)`;
17
28
  }
@@ -1,11 +1,18 @@
1
1
  import { Node, NodeType } from '../node';
2
2
  import { FunctionNode } from './functionNode';
3
+ type ExpNodeOptions = {
4
+ useExpNotation: boolean;
5
+ };
3
6
  export declare class ExpNode extends FunctionNode implements Node {
7
+ opts?: ExpNodeOptions;
4
8
  type: NodeType;
5
- constructor(child: Node);
9
+ constructor(child: Node, opts?: ExpNodeOptions);
6
10
  toMathString(): string;
7
11
  toTex(): string;
8
12
  toMathjs(): number;
13
+ toEquivalentNodes(): Node[];
14
+ toAllValidTexs(): string[];
9
15
  simplify(): Node;
10
16
  }
17
+ export {};
11
18
  //# sourceMappingURL=expNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,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;IAMf,QAAQ;IAIR,QAAQ,IAAI,IAAI;CAGjB"}
1
+ {"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,KAAK,cAAc,GAAG;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AACF,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,cAAc;IAK9C,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IASf,QAAQ;IAIR,iBAAiB,IAAI,IAAI,EAAE;IAU3B,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,IAAI,IAAI;CAGjB"}
@@ -5,15 +5,19 @@ const mathjs_1 = require("mathjs");
5
5
  const node_1 = require("../node");
6
6
  const functionNode_1 = require("./functionNode");
7
7
  class ExpNode extends functionNode_1.FunctionNode {
8
- constructor(child) {
8
+ constructor(child, opts) {
9
9
  super(functionNode_1.FunctionsIds.exp, child, '\\exp');
10
10
  this.type = node_1.NodeType.function;
11
+ this.opts = opts;
11
12
  }
12
13
  toMathString() {
13
14
  return `e^(${this.child.toMathString()})`;
14
15
  }
15
16
  toTex() {
16
17
  const tex = this.child.toTex();
18
+ if (this.opts?.useExpNotation) {
19
+ return `exp\\left(${this.child.toTex}\\right)`;
20
+ }
17
21
  const needBraces = tex.length > 1;
18
22
  if (needBraces)
19
23
  return `e^{${this.child.toTex()}}`;
@@ -22,6 +26,18 @@ class ExpNode extends functionNode_1.FunctionNode {
22
26
  toMathjs() {
23
27
  return (0, mathjs_1.exp)(this.child.toMathjs());
24
28
  }
29
+ toEquivalentNodes() {
30
+ const res = [];
31
+ const childNodes = this.child.toEquivalentNodes();
32
+ childNodes.forEach((childNode) => {
33
+ res.push(new ExpNode(childNode));
34
+ res.push(new ExpNode(childNode, { useExpNotation: true }));
35
+ });
36
+ return res;
37
+ }
38
+ toAllValidTexs() {
39
+ return this.toEquivalentNodes().map((node) => node.toTex());
40
+ }
25
41
  simplify() {
26
42
  return this;
27
43
  }
@@ -6,6 +6,8 @@ export declare class LogNode extends FunctionNode implements Node {
6
6
  toMathString(): string;
7
7
  toTex(): string;
8
8
  toMathjs(): any;
9
+ toEquivalentNodes(): Node[];
10
+ toAllValidTexs(): string[];
9
11
  simplify(): Node;
10
12
  }
11
13
  //# sourceMappingURL=logNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,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;IAGf,QAAQ;IAGR,QAAQ,IAAI,IAAI;CAGjB"}
1
+ {"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,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;IAGf,QAAQ;IAIR,iBAAiB,IAAI,IAAI,EAAE;IAS3B,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,IAAI;CAGjB"}
@@ -18,6 +18,17 @@ class LogNode extends functionNode_1.FunctionNode {
18
18
  toMathjs() {
19
19
  return (0, mathjs_1.log)(this.child.toMathjs());
20
20
  }
21
+ toEquivalentNodes() {
22
+ const res = [];
23
+ const childNodes = this.child.toEquivalentNodes();
24
+ childNodes.forEach((childNode) => {
25
+ res.push(new LogNode(childNode));
26
+ });
27
+ return res;
28
+ }
29
+ toAllValidTexs() {
30
+ return this.toEquivalentNodes().map((node) => node.toTex());
31
+ }
21
32
  simplify() {
22
33
  return this;
23
34
  }
@@ -4,6 +4,8 @@ export declare class OppositeNode extends FunctionNode implements Node {
4
4
  constructor(child: Node);
5
5
  toMathString(): string;
6
6
  toTex(): string;
7
+ toEquivalentNodes(): Node[];
8
+ toAllValidTexs(): string[];
7
9
  toMathjs(): number;
8
10
  }
9
11
  //# sourceMappingURL=oppositeNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oppositeNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/oppositeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAY,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAG5D,qBAAa,YAAa,SAAQ,YAAa,YAAW,IAAI;gBAChD,KAAK,EAAE,IAAI;IAGvB,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAcf,QAAQ;CAGT"}
1
+ {"version":3,"file":"oppositeNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/oppositeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAY,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAG5D,qBAAa,YAAa,SAAQ,YAAa,YAAW,IAAI;gBAChD,KAAK,EAAE,IAAI;IAGvB,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAcf,iBAAiB,IAAI,IAAI,EAAE;IAS3B,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ;CAGT"}
@@ -26,6 +26,17 @@ class OppositeNode extends functionNode_1.FunctionNode {
26
26
  childTex = `(${childTex})`;
27
27
  return `-${childTex}`;
28
28
  }
29
+ toEquivalentNodes() {
30
+ const res = [];
31
+ const childNodes = this.child.toEquivalentNodes();
32
+ childNodes.forEach((childNode) => {
33
+ res.push(new OppositeNode(childNode));
34
+ });
35
+ return res;
36
+ }
37
+ toAllValidTexs() {
38
+ return this.toEquivalentNodes().map((node) => node.toTex());
39
+ }
29
40
  toMathjs() {
30
41
  return (0, mathjs_1.unaryMinus)(this.child.toMathjs());
31
42
  }
@@ -6,6 +6,8 @@ export declare class SinNode extends FunctionNode implements Node {
6
6
  toMathString(): string;
7
7
  toTex(): string;
8
8
  toMathjs(): number;
9
+ toEquivalentNodes(): Node[];
10
+ toAllValidTexs(): string[];
9
11
  simplify(): Node;
10
12
  }
11
13
  //# sourceMappingURL=sinNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AACA,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;IAGf,QAAQ;IAGR,QAAQ,IAAI,IAAI;CAGjB"}
1
+ {"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AACA,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;IAGf,QAAQ;IAGR,iBAAiB,IAAI,IAAI,EAAE;IAS3B,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,IAAI,IAAI;CAGjB"}
@@ -18,6 +18,17 @@ class SinNode extends functionNode_1.FunctionNode {
18
18
  toMathjs() {
19
19
  return (0, mathjs_1.sin)(this.child.toMathjs());
20
20
  }
21
+ toEquivalentNodes() {
22
+ const res = [];
23
+ const childNodes = this.child.toEquivalentNodes();
24
+ childNodes.forEach((childNode) => {
25
+ res.push(new SinNode(childNode));
26
+ });
27
+ return res;
28
+ }
29
+ toAllValidTexs() {
30
+ return this.toEquivalentNodes().map((node) => node.toTex());
31
+ }
21
32
  simplify() {
22
33
  return this;
23
34
  }
@@ -6,5 +6,7 @@ export declare class SqrtNode extends FunctionNode implements Node {
6
6
  toMathString(): string;
7
7
  toMathjs(): number | import("mathjs").Complex;
8
8
  toTex(): string;
9
+ toEquivalentNodes(): Node[];
10
+ toAllValidTexs(): string[];
9
11
  }
10
12
  //# sourceMappingURL=sqrtNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqrtNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sqrtNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,QAAS,SAAQ,YAAa,YAAW,IAAI;IACxD,IAAI,EAAE,QAAQ,CAAqB;gBACvB,KAAK,EAAE,IAAI;IAGvB,YAAY,IAAI,MAAM;IAGtB,QAAQ;IAGR,KAAK,IAAI,MAAM;CAGhB"}
1
+ {"version":3,"file":"sqrtNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sqrtNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,QAAS,SAAQ,YAAa,YAAW,IAAI;IACxD,IAAI,EAAE,QAAQ,CAAqB;gBACvB,KAAK,EAAE,IAAI;IAGvB,YAAY,IAAI,MAAM;IAGtB,QAAQ;IAGR,KAAK,IAAI,MAAM;IAIf,iBAAiB,IAAI,IAAI,EAAE;IAS3B,cAAc,IAAI,MAAM,EAAE;CAG3B"}
@@ -18,5 +18,16 @@ class SqrtNode extends functionNode_1.FunctionNode {
18
18
  toTex() {
19
19
  return `\\sqrt{${this.child.toTex()}}`;
20
20
  }
21
+ toEquivalentNodes() {
22
+ const res = [];
23
+ const childNodes = this.child.toEquivalentNodes();
24
+ childNodes.forEach((childNode) => {
25
+ res.push(new SqrtNode(childNode));
26
+ });
27
+ return res;
28
+ }
29
+ toAllValidTexs() {
30
+ return this.toEquivalentNodes().map((node) => node.toTex());
31
+ }
21
32
  }
22
33
  exports.SqrtNode = SqrtNode;
@@ -8,6 +8,8 @@ export declare enum NodeType {
8
8
  export interface Node {
9
9
  type: NodeType;
10
10
  toMathString: () => string;
11
+ toEquivalentNodes: () => Node[];
12
+ toAllValidTexs: () => string[];
11
13
  toTex: () => string;
12
14
  toMathjs: () => any;
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/node.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,CAAC;CAErB"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/node.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IAEf,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,MAAM,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,CAAC;CAErB"}
@@ -7,5 +7,7 @@ export declare class ConstantNode implements Node {
7
7
  toMathString(): string;
8
8
  toTex(): string;
9
9
  toMathjs(): import("mathjs").MathNode;
10
+ toAllValidTexs(): string[];
11
+ toEquivalentNodes(): this[];
10
12
  }
11
13
  //# sourceMappingURL=constantNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constantNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/constantNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,YAAa,YAAW,IAAI;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAK3C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;CAGT"}
1
+ {"version":3,"file":"constantNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/constantNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,YAAa,YAAW,IAAI;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAK3C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,cAAc;IAGd,iBAAiB;CAGlB"}