math-exercises 3.0.214 → 3.0.216

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 (371) hide show
  1. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
  2. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
  3. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
  4. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
  5. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
  6. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
  7. package/lib/exercises/math/arithmetic/index.d.ts +7 -0
  8. package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
  9. package/lib/exercises/math/arithmetic/index.js +7 -0
  10. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
  11. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
  12. package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
  13. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
  14. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
  15. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
  16. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
  17. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
  18. package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
  19. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
  20. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
  21. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
  22. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
  23. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
  24. package/lib/exercises/math/arithmetic/whichDayInXDays.js +82 -0
  25. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
  26. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
  28. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  29. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  31. package/lib/exercises/math/calcul/index.d.ts +1 -0
  32. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/index.js +1 -0
  34. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
  35. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
  37. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
  38. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
  40. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
  41. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
  42. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
  43. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
  44. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
  45. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
  46. package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
  47. package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calcul/ratio/index.js +1 -0
  49. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
  50. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
  51. package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
  52. package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
  53. package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
  54. package/lib/exercises/math/calcul/relatives/index.js +1 -0
  55. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
  56. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
  57. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
  58. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
  59. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
  60. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
  61. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  62. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  63. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  64. package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
  65. package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
  66. package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
  67. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
  68. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
  69. package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
  70. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
  71. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
  72. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
  73. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
  74. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
  75. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
  76. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
  77. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
  78. package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
  79. package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
  80. package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
  81. package/lib/exercises/math/complex/algebraic/index.js +10 -0
  82. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
  83. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
  84. package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
  85. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
  86. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
  87. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
  88. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
  89. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
  90. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
  91. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
  92. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
  93. package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
  94. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
  95. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
  96. package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
  97. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
  98. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
  99. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
  100. package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
  101. package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
  102. package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
  103. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
  104. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
  105. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
  106. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
  107. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
  108. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
  109. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
  110. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
  111. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
  112. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
  113. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
  114. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
  115. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
  116. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
  117. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
  118. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
  119. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
  120. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
  121. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
  122. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
  123. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
  124. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
  125. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
  126. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
  127. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
  128. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
  129. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
  130. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
  131. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
  132. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
  133. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
  134. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
  135. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
  136. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
  137. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
  138. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
  139. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
  140. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
  141. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
  142. package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
  143. package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
  144. package/lib/exercises/math/complex/geometric/index.js +19 -0
  145. package/lib/exercises/math/complex/index.d.ts +4 -10
  146. package/lib/exercises/math/complex/index.d.ts.map +1 -1
  147. package/lib/exercises/math/complex/index.js +4 -11
  148. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
  149. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
  150. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
  151. package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
  152. package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
  153. package/lib/exercises/math/complex/polynomials/index.js +3 -0
  154. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
  155. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
  156. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
  157. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
  158. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
  159. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
  160. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
  161. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
  162. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
  163. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
  164. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
  165. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
  166. package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
  167. package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
  168. package/lib/exercises/math/complex/unitRoots/index.js +2 -0
  169. package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
  170. package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
  171. package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
  172. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
  173. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
  174. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
  175. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
  176. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
  177. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
  178. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
  179. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
  180. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
  181. package/lib/exercises/math/conversion/clock/index.d.ts +2 -0
  182. package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
  183. package/lib/exercises/math/conversion/clock/index.js +4 -0
  184. package/lib/exercises/math/conversion/index.d.ts +1 -0
  185. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  186. package/lib/exercises/math/conversion/index.js +1 -0
  187. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
  188. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
  189. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
  190. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
  191. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
  192. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
  193. package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
  194. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  195. package/lib/exercises/math/geometry/angles/index.js +2 -0
  196. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
  197. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
  198. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
  199. package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
  200. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
  201. package/lib/exercises/math/geometry/circles/index.js +1 -0
  202. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
  203. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
  204. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
  205. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
  206. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
  207. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
  208. package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
  209. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  210. package/lib/exercises/math/geometry/lines/index.js +2 -0
  211. package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
  212. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  214. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
  215. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
  216. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
  217. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
  218. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
  219. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
  220. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
  221. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
  222. package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
  223. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
  224. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
  225. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
  226. package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
  227. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
  228. package/lib/exercises/math/geometry/volumes/index.js +1 -0
  229. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
  230. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
  231. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
  232. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts +10 -0
  233. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts.map +1 -0
  234. package/lib/exercises/math/graphs/adjacentMatrixPath.js +89 -0
  235. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts +7 -0
  236. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts.map +1 -0
  237. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.js +98 -0
  238. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts +8 -0
  239. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts.map +1 -0
  240. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.js +96 -0
  241. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts +15 -0
  242. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -0
  243. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +262 -0
  244. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts +11 -0
  245. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts.map +1 -0
  246. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +178 -0
  247. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +19 -0
  248. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -0
  249. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +301 -0
  250. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts +16 -0
  251. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -0
  252. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +207 -0
  253. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts +15 -0
  254. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -0
  255. package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +232 -0
  256. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts +14 -0
  257. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -0
  258. package/lib/exercises/math/graphs/graphsOrderOfGraph.js +222 -0
  259. package/lib/exercises/math/graphs/index.d.ts +10 -0
  260. package/lib/exercises/math/graphs/index.d.ts.map +1 -0
  261. package/lib/exercises/math/graphs/index.js +9 -0
  262. package/lib/exercises/math/index.d.ts +1 -0
  263. package/lib/exercises/math/index.d.ts.map +1 -1
  264. package/lib/exercises/math/index.js +1 -0
  265. package/lib/exercises/math/matrices/areMatricesInverse.d.ts +9 -0
  266. package/lib/exercises/math/matrices/areMatricesInverse.d.ts.map +1 -0
  267. package/lib/exercises/math/matrices/areMatricesInverse.js +106 -0
  268. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts +9 -0
  269. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts.map +1 -0
  270. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.js +144 -0
  271. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts +8 -0
  272. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts.map +1 -0
  273. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.js +148 -0
  274. package/lib/exercises/math/matrices/index.d.ts +12 -0
  275. package/lib/exercises/math/matrices/index.d.ts.map +1 -1
  276. package/lib/exercises/math/matrices/index.js +12 -0
  277. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts +8 -0
  278. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts.map +1 -0
  279. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.js +132 -0
  280. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts +8 -0
  281. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts.map +1 -0
  282. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.js +152 -0
  283. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts +8 -0
  284. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts.map +1 -0
  285. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.js +155 -0
  286. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts +8 -0
  287. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts.map +1 -0
  288. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.js +142 -0
  289. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts +8 -0
  290. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts.map +1 -0
  291. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.js +237 -0
  292. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts +15 -0
  293. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts.map +1 -0
  294. package/lib/exercises/math/matrices/matrixComputeLinearCombination.js +232 -0
  295. package/lib/exercises/math/matrices/matrixComputePower.d.ts +12 -0
  296. package/lib/exercises/math/matrices/matrixComputePower.d.ts.map +1 -0
  297. package/lib/exercises/math/matrices/matrixComputePower.js +230 -0
  298. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts +9 -0
  299. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts.map +1 -0
  300. package/lib/exercises/math/matrices/matrixComputeProduct.js +178 -0
  301. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts +8 -0
  302. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts.map +1 -0
  303. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.js +105 -0
  304. package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
  305. package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
  306. package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
  307. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
  308. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
  309. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
  310. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
  311. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
  312. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
  313. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  314. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  315. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  316. package/lib/exercises/vea/matrixVEA.d.ts +2 -0
  317. package/lib/exercises/vea/matrixVEA.d.ts.map +1 -0
  318. package/lib/exercises/vea/matrixVEA.js +1 -0
  319. package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
  320. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  321. package/lib/geogebra/parsers/geogebraParser.js +27 -0
  322. package/lib/index.d.ts +286 -23
  323. package/lib/index.d.ts.map +1 -1
  324. package/lib/latexTester.js +2 -0
  325. package/lib/math/geometry/angle.d.ts.map +1 -1
  326. package/lib/math/geometry/angle.js +3 -0
  327. package/lib/math/geometry/point.d.ts.map +1 -1
  328. package/lib/math/geometry/point.js +3 -1
  329. package/lib/math/geometry/segment.d.ts +1 -1
  330. package/lib/math/geometry/segment.d.ts.map +1 -1
  331. package/lib/math/geometry/segment.js +5 -2
  332. package/lib/math/graphs/graph.d.ts +43 -0
  333. package/lib/math/graphs/graph.d.ts.map +1 -0
  334. package/lib/math/graphs/graph.js +391 -0
  335. package/lib/math/matrices/matrix.d.ts +42 -3
  336. package/lib/math/matrices/matrix.d.ts.map +1 -1
  337. package/lib/math/matrices/matrix.js +173 -7
  338. package/lib/math/matrices/parseMatrix.d.ts +3 -0
  339. package/lib/math/matrices/parseMatrix.d.ts.map +1 -0
  340. package/lib/math/matrices/parseMatrix.js +22 -0
  341. package/lib/math/systems/generalSystem.d.ts +2 -0
  342. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  343. package/lib/math/systems/generalSystem.js +5 -0
  344. package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
  345. package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
  346. package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
  347. package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
  348. package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
  349. package/lib/math/utils/geometry/angleNWSE.js +56 -0
  350. package/lib/math/utils/graphs/graphRenderer.d.ts +25 -0
  351. package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -0
  352. package/lib/math/utils/graphs/graphRenderer.js +123 -0
  353. package/lib/playground.d.ts +6 -1
  354. package/lib/playground.d.ts.map +1 -1
  355. package/lib/playground.js +6 -5
  356. package/lib/tests/singleExo.test.d.ts.map +1 -1
  357. package/lib/tests/singleExo.test.js +2 -2
  358. package/lib/tree/parsers/latexParser.d.ts +1 -1
  359. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
  360. package/lib/types/keyIds.d.ts +2 -0
  361. package/lib/types/keyIds.d.ts.map +1 -1
  362. package/lib/utils/arrays/arrayChunks.d.ts +9 -0
  363. package/lib/utils/arrays/arrayChunks.d.ts.map +1 -0
  364. package/lib/utils/arrays/arrayChunks.js +34 -0
  365. package/lib/utils/strings/frenchDays.d.ts +2 -0
  366. package/lib/utils/strings/frenchDays.d.ts.map +1 -0
  367. package/lib/utils/strings/frenchDays.js +9 -0
  368. package/lib/utils/strings/ordinalSuffixed.d.ts +2 -0
  369. package/lib/utils/strings/ordinalSuffixed.d.ts.map +1 -0
  370. package/lib/utils/strings/ordinalSuffixed.js +5 -0
  371. package/package.json +7 -1
@@ -0,0 +1,165 @@
1
+ import { toolBarConstructor } from "../../../../../exercises/utils/geogebra/toolBarConstructor.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueMain, greenMain, orange } from "../../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
+ import { GeogebraParser } from "../../../../../geogebra/parsers/geogebraParser.js";
6
+ import { PointConstructor, } from "../../../../../math/geometry/point.js";
7
+ import { VectorConstructor } from "../../../../../math/geometry/vector.js";
8
+ const getHydrated = (identifiers) => {
9
+ const { pointIds } = identifiers;
10
+ const points = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
11
+ const vec1 = (() => {
12
+ const vec = VectorConstructor.fromPoints(points[0], points[1]);
13
+ vec.name = "u";
14
+ return vec;
15
+ })();
16
+ const vec2 = (() => {
17
+ const vec = VectorConstructor.fromPoints(points[2], points[3]);
18
+ vec.name = "v";
19
+ return vec;
20
+ })();
21
+ const vecSum = vec1.add(vec2);
22
+ return {
23
+ points,
24
+ vec1,
25
+ vec2,
26
+ vecSum,
27
+ };
28
+ };
29
+ const getInstruction = (identifiers) => {
30
+ const { vec1, vec2 } = getHydrated(identifiers);
31
+ return `Construire le vecteur $\\overrightarrow{w}$ tel que :
32
+
33
+ $$
34
+ \\overrightarrow{w} = ${vec1.toTex()} + ${vec2.toTex()}
35
+ $$`;
36
+ };
37
+ const getGGBAnswer = (identifiers) => {
38
+ const { points, vecSum } = getHydrated(identifiers);
39
+ const pointStart = points[0];
40
+ const pointEnd = vecSum.getEndPoint(pointStart);
41
+ return [
42
+ ...getStudentGGBCommands(points),
43
+ `PEnd = Point({${pointEnd.getXnumber()},${pointEnd.getYnumber()}})`,
44
+ `w = Vector(${points[0].name}, PEnd)`,
45
+ `SetColor(w, "${greenMain}")`,
46
+ `ShowLabel(w, true)`,
47
+ ];
48
+ };
49
+ const getHint = () => {
50
+ return `Avec l'outil vecteur, choisis un point sur la grille et, en partant de ce point, déplace toi suivant le vecteur $\\overrightarrow{u}$ puis suivant le vecteur $\\overrightarrow{v}$ et clique sur le point où tu es arrivé.`;
51
+ };
52
+ const getCorrection = (_identifiers) => {
53
+ return `Avec l'outil vecteur, on choisit un point sur la grille et, en partant de ce point, on se déplace suivant le vecteur $\\overrightarrow{u}$ puis suivant le vecteur $\\overrightarrow{v}$ et on clique sur le point où l'on est arrivé.`;
54
+ };
55
+ const getCorrectionGGBOptions = (identifiers) => {
56
+ const { points, vecSum } = getHydrated(identifiers);
57
+ const pointStart = points[0];
58
+ const pointEnd = vecSum.getEndPoint(pointStart);
59
+ const commands = [
60
+ ...getStudentGGBCommands(points),
61
+ `PEnd = Point({${pointEnd.getXnumber()},${pointEnd.getYnumber()}})`,
62
+ `w = Vector(${points[0].name}, PEnd)`,
63
+ `SetColor(w, "${greenMain}")`,
64
+ `ShowLabel(w, true)`,
65
+ ];
66
+ const ggb = new GeogebraConstructor({
67
+ commands,
68
+ customToolBar: toolBarConstructor({
69
+ vector: true,
70
+ }),
71
+ hideAxes: true,
72
+ fontSize: 16,
73
+ });
74
+ return ggb.getOptions({
75
+ coords: ggb.getCoordsForPoints([...points, pointEnd]),
76
+ });
77
+ };
78
+ const getStudentGGBCommands = (points) => {
79
+ return [
80
+ ...points.flatMap((point) => point.toGGBCommand({ isFixed: true, isVisible: false })),
81
+ `u = Vector(${points[0].name}, ${points[1].name})`,
82
+ `SetColor(u, "${orange}")`,
83
+ `ShowLabel(u, true)`,
84
+ `v = Vector(${points[2].name}, ${points[3].name})`,
85
+ `SetColor(v, "${blueMain}")`,
86
+ `ShowLabel(v, true)`,
87
+ ];
88
+ };
89
+ const getStudentGGBOptions = (identifiers) => {
90
+ const { points, vecSum } = getHydrated(identifiers);
91
+ const pointStart = points[0];
92
+ const pointEnd = vecSum.getEndPoint(pointStart);
93
+ const commands = [...getStudentGGBCommands(points)];
94
+ const ggb = new GeogebraConstructor({
95
+ commands,
96
+ customToolBar: toolBarConstructor({
97
+ vector: true,
98
+ }),
99
+ hideAxes: true,
100
+ fontSize: 16,
101
+ });
102
+ return ggb.getOptions({
103
+ coords: ggb.getCoordsForPoints([...points, pointEnd]),
104
+ });
105
+ };
106
+ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
107
+ const commands = ans;
108
+ const ggbParser = new GeogebraParser(commands);
109
+ const objectDict = ggbParser.objectDict();
110
+ const arrStrVector = Object.entries(objectDict)
111
+ .filter(([_, strObj]) => strObj.startsWith("Vector"))
112
+ .map(([_, strObj]) => strObj);
113
+ //required: only one vector
114
+ if (arrStrVector.length !== 1) {
115
+ return false;
116
+ }
117
+ const [strVector] = arrStrVector;
118
+ const [namePointStart, namePointEnd] = GeogebraParser.argNamesForVectorObj(strVector);
119
+ const [pointStart, pointEnd] = [namePointStart, namePointEnd].map((namePoint) => PointConstructor.fromCoords(ggbParser.pointCoords(namePoint)));
120
+ const vecAns = VectorConstructor.fromPoints(pointStart, pointEnd);
121
+ const { vecSum } = getHydrated(identifiers);
122
+ const isSameVecs = vecAns.substract(vecSum).getNorm().evaluate() < 0.2;
123
+ return isSameVecs;
124
+ };
125
+ const getTraceVectorSumFromVecsQuestion = () => {
126
+ const names = ["A", "B", "C", "D"];
127
+ const points = PointConstructor.randomDifferent(4, {
128
+ minDistance: 2,
129
+ names,
130
+ minDistanceToOrigin: 3,
131
+ });
132
+ const identifiers = {
133
+ pointIds: points.map((point) => point.toIdentifiers()),
134
+ };
135
+ return getQuestionFromIdentifiers(identifiers);
136
+ };
137
+ const getQuestionFromIdentifiers = (identifiers) => {
138
+ const question = {
139
+ ggbAnswer: getGGBAnswer(identifiers),
140
+ instruction: getInstruction(identifiers),
141
+ studentGgbOptions: getStudentGGBOptions(identifiers),
142
+ identifiers,
143
+ hint: getHint(identifiers),
144
+ correction: getCorrection(identifiers),
145
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
146
+ };
147
+ return question;
148
+ };
149
+ export const traceVectorSumFromVecs = {
150
+ id: "traceVectorSumFromVecs",
151
+ label: "Construire un vecteur défini par une somme de vecteurs",
152
+ isSingleStep: true,
153
+ generator: (nb, opts) => getDistinctQuestions(() => getTraceVectorSumFromVecsQuestion(opts), nb),
154
+ ggbTimer: 60,
155
+ isGGBAnswerValid,
156
+ subject: "Mathématiques",
157
+ getHint,
158
+ getInstruction,
159
+ getCorrection,
160
+ getGGBAnswer,
161
+ getStudentGGBOptions,
162
+ answerType: "GGB",
163
+ getQuestionFromIdentifiers,
164
+ hasHintAndCorrection: true,
165
+ };
@@ -6,4 +6,5 @@ export * from "./coneVolume.js";
6
6
  export * from "./sphereVolume.js";
7
7
  export * from "./parallelepipedVolume.js";
8
8
  export * from "./variableVolume.js";
9
+ export * from "./volumeOfCylinder.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
@@ -6,3 +6,4 @@ export * from "./coneVolume.js";
6
6
  export * from "./sphereVolume.js";
7
7
  export * from "./parallelepipedVolume.js";
8
8
  export * from "./variableVolume.js";
9
+ export * from "./volumeOfCylinder.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ radius: number;
4
+ height: number;
5
+ };
6
+ export declare const volumeOfCylinder: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=volumeOfCylinder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volumeOfCylinder.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/volumeOfCylinder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2KF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
@@ -0,0 +1,157 @@
1
+ import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { round } from "../../../../math/utils/round.js";
6
+ import { numberParser } from "../../../../tree/parsers/numberParser.js";
7
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
8
+ const getInstruction = (identifiers) => {
9
+ const { radius, height } = identifiers;
10
+ return `Le cylindre ci-dessous a une base de rayon $${radius}$ et une hauteur de $${height}$.
11
+
12
+ Calculer son volume (arrondir au centième).`;
13
+ };
14
+ const getHint = (identifiers) => {
15
+ const { radius } = identifiers;
16
+ return `Le volume d'un cylindre se calcule avec la formule :
17
+
18
+ $$
19
+ \\mathcal{V} = \\text{aire de la base} \\times \\text{hauteur}
20
+ $$
21
+
22
+ La base est un disque de rayon $${radius}$. Il faut donc commencer par calculer son aire.
23
+ `;
24
+ };
25
+ const getCorrection = (identifiers) => {
26
+ const { radius, height } = identifiers;
27
+ round((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2).toTree();
28
+ const area = round(Math.PI * radius ** 2, 2).frenchify();
29
+ return `Le volume d'un cylindre se calcule avec la formule :
30
+
31
+ $$
32
+ \\mathcal{V} = \\text{aire de la base} \\times \\text{hauteur}
33
+ $$
34
+
35
+ Ici, la base est un disque de rayon $${radius}$. Son aire est donc :
36
+
37
+ $$
38
+ \\mathcal{A} = \\pi\\times ${radius}^2 \\approx ${area}
39
+ $$
40
+
41
+ Le volume du cylindre est donc :
42
+
43
+ ${alignTex([
44
+ [
45
+ "\\mathcal{V}",
46
+ "\\approx",
47
+ `${area} \\times ${height} = ${getAnswer(identifiers)}`,
48
+ ],
49
+ ["", "\\approx", getAnswer(identifiers)],
50
+ ])}
51
+ `;
52
+ };
53
+ const getAnswer = (identifiers) => {
54
+ const { radius, height } = identifiers;
55
+ const volume = round(Math.PI * Math.pow(radius, 2) * height, 2)
56
+ .toTree()
57
+ .toTex();
58
+ return volume;
59
+ };
60
+ const getGGBOptions = (identifiers) => {
61
+ const { radius, height } = identifiers;
62
+ const xMin = -radius - 5;
63
+ const xMax = radius + 5;
64
+ const yMin = -radius - 5;
65
+ const yMax = radius + 5;
66
+ const zMax = height + 5;
67
+ const commands = [
68
+ `A = (0, 0, 0)`,
69
+ `B = (0, 0, ${height})`,
70
+ `SetFixed(A, true, false)`,
71
+ `SetFixed(B, true, false)`,
72
+ `SetVisibleInView(A, -1, false)`,
73
+ `SetVisibleInView(B, -1, false)`,
74
+ `Cylinder(A, B, ${radius})`,
75
+ ];
76
+ const ggb = new GeogebraConstructor({
77
+ commands,
78
+ lockedAxesRatio: false,
79
+ hideAxes: true,
80
+ hideGrid: true,
81
+ is3D: true,
82
+ });
83
+ return ggb.getOptions({
84
+ coords: [xMin, xMax, yMin, yMax, 0, zMax],
85
+ });
86
+ };
87
+ const getPropositions = (n, { answer, radius, height }) => {
88
+ const propositions = [];
89
+ addValidProp(propositions, answer);
90
+ const wrongVolume1 = round(Math.PI * Math.pow(radius, 2) * height, 2)
91
+ .toTree()
92
+ .toTex();
93
+ tryToAddWrongProp(propositions, wrongVolume1);
94
+ const wrongVolume2 = round(Math.PI * radius * height, 2)
95
+ .toTree()
96
+ .toTex();
97
+ tryToAddWrongProp(propositions, wrongVolume2);
98
+ const wrongVolume3 = round((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2)
99
+ .toTree()
100
+ .toTex();
101
+ tryToAddWrongProp(propositions, wrongVolume3);
102
+ propWhile(propositions, n, () => {
103
+ let wrongRadius, wrongHeight;
104
+ do {
105
+ wrongRadius = randint(1, 5);
106
+ wrongHeight = randint(2, 10);
107
+ } while (wrongHeight <= wrongRadius);
108
+ const wrongVolume = round(Math.PI * Math.pow(wrongRadius, 2) * wrongHeight, 2)
109
+ .toTree()
110
+ .toTex();
111
+ tryToAddWrongProp(propositions, wrongVolume);
112
+ });
113
+ return shuffleProps(propositions, n);
114
+ };
115
+ const isAnswerValid = (ans, { answer }) => {
116
+ const parsed = numberParser(ans);
117
+ if (!parsed)
118
+ return false;
119
+ return parsed === answer;
120
+ };
121
+ const getVolumeOfCylinderQuestion = () => {
122
+ let radius, height;
123
+ do {
124
+ radius = randint(1, 11);
125
+ height = randint(2, 12);
126
+ } while (height <= radius);
127
+ const identifiers = { radius, height };
128
+ return getQuestionFromIdentifiers(identifiers);
129
+ };
130
+ const getQuestionFromIdentifiers = (identifiers) => {
131
+ const question = {
132
+ answer: getAnswer(identifiers),
133
+ instruction: getInstruction(identifiers),
134
+ ggbOptions: getGGBOptions(identifiers),
135
+ keys: [],
136
+ answerFormat: "tex",
137
+ identifiers,
138
+ hint: getHint(identifiers),
139
+ correction: getCorrection(identifiers),
140
+ };
141
+ return question;
142
+ };
143
+ export const volumeOfCylinder = {
144
+ id: "volumeOfCylinder",
145
+ label: "Calculer le volume d'un cylindre de hauteur et de rayon donnés",
146
+ isSingleStep: true,
147
+ generator: (nb) => getDistinctQuestions(getVolumeOfCylinderQuestion, nb),
148
+ qcmTimer: 60,
149
+ freeTimer: 60,
150
+ getPropositions,
151
+ isAnswerValid,
152
+ hasGeogebra: true,
153
+ subject: "Mathématiques",
154
+ getQuestionFromIdentifiers,
155
+ hasHintAndCorrection: true,
156
+ shouldHaveCalculator: true,
157
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
3
+ type Identifiers = {
4
+ matrixIds: MatrixIdentifiers;
5
+ startIndex: number;
6
+ endIndex: number;
7
+ };
8
+ export declare const adjacentMatrixPath: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=adjacentMatrixPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adjacentMatrixPath.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/adjacentMatrixPath.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAIvC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA6FF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAmBpD,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { MatrixConstructor, } from "../../../math/matrices/matrix.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { ordinalSuffixed } from "../../../utils/strings/ordinalSuffixed.js";
6
+ const getPropositions = (n, { answer }) => {
7
+ const propositions = [];
8
+ addValidProp(propositions, answer, "raw");
9
+ tryToAddWrongProp(propositions, "Oui", "raw");
10
+ tryToAddWrongProp(propositions, "Non", "raw");
11
+ return shuffleProps(propositions, n);
12
+ };
13
+ const getAnswer = (identifiers) => {
14
+ const { matrixIds, endIndex, startIndex } = identifiers;
15
+ const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
16
+ return matrix.elements[startIndex][endIndex].toTex() === "0" ? "Non" : "Oui";
17
+ };
18
+ const getInstruction = (identifiers) => {
19
+ const { matrixIds, endIndex, startIndex } = identifiers;
20
+ const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
21
+ const length = matrix.rows;
22
+ const summitNames = Array.from({ length: length }, (_, index) => `$${String.fromCharCode(65 + index)}$`);
23
+ return `La matrice d'adjacence d'un graphe non-orienté $G$ de sommets ${summitNames.join(", ")} est donnée ci-dessous (les sommets sont classés par ordre alphabétique).
24
+
25
+ $$
26
+ ${matrix.toTex()}
27
+ $$
28
+
29
+ Existe-t-il une arête reliant les sommets ${summitNames[startIndex]} et ${summitNames[endIndex]} ? `;
30
+ };
31
+ const getHint = () => {
32
+ return `Dans une matrice d'adjacence, le terme de la $i$-ème ligne et de la $j$-ème colonne est le nombre d'arêtes reliant les sommets $i$ et $j$.`;
33
+ };
34
+ const getCorrection = (identifiers) => {
35
+ const { matrixIds, endIndex, startIndex } = identifiers;
36
+ const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
37
+ const length = matrix.rows;
38
+ const summitNames = Array.from({ length: length }, (_, index) => `$${String.fromCharCode(65 + index)}$`);
39
+ const hasNoEdge = matrix.elements[startIndex][endIndex].toTex() === "0";
40
+ return `Dans une matrice d'adjacence d'un graphe non-orienté, le terme de la $i$-ème ligne et de la $j$-ème colonne est le nombre d'arêtes reliant les sommets $i$ et $j$.
41
+
42
+ Ici, on regarde donc le terme à la ${ordinalSuffixed(startIndex + 1)} ligne et ${ordinalSuffixed(endIndex + 1)} colonne : c'est $${matrix.elements[startIndex][endIndex].toTex()}$.
43
+
44
+ ${!hasNoEdge
45
+ ? `Il y a donc bien une arête reliant les sommets ${summitNames[startIndex]} et ${summitNames[endIndex]}.`
46
+ : `Il n'y a donc pas d'arête reliant les sommets ${summitNames[startIndex]} et ${summitNames[endIndex]}.`}
47
+ `;
48
+ };
49
+ const getAdjacentMatrixPathQuestion = () => {
50
+ const length = randint(4, 6);
51
+ const m = MatrixConstructor.randomAdjacent(length);
52
+ const startIndex = randint(0, length);
53
+ const endIndex = randint(0, length, [startIndex]);
54
+ const identifiers = {
55
+ matrixIds: m.toIdentifiers(),
56
+ startIndex,
57
+ endIndex,
58
+ };
59
+ return getQuestionFromIdentifiers(identifiers);
60
+ };
61
+ const getQuestionFromIdentifiers = (identifiers) => {
62
+ return {
63
+ answer: getAnswer(identifiers),
64
+ instruction: getInstruction(identifiers),
65
+ keys: [],
66
+ answerFormat: "raw",
67
+ identifiers,
68
+ hint: getHint(identifiers),
69
+ correction: getCorrection(identifiers),
70
+ };
71
+ };
72
+ export const adjacentMatrixPath = {
73
+ id: "adjacentMatrixPath",
74
+ connector: "=",
75
+ label: "Vérifier si deux sommets d'un graphe sont reliés grâce à la matrice d'adjacence",
76
+ isSingleStep: true,
77
+ generator: (nb, opts) => getDistinctQuestions(() => getAdjacentMatrixPathQuestion(opts), nb),
78
+ qcmTimer: 60,
79
+ freeTimer: 60,
80
+ getPropositions,
81
+ subject: "Mathématiques",
82
+ getInstruction,
83
+ getHint,
84
+ getCorrection,
85
+ getAnswer,
86
+ getQuestionFromIdentifiers,
87
+ answerType: "QCU",
88
+ hasHintAndCorrection: true,
89
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ degrees: number[];
4
+ };
5
+ export declare const edgesNumberFromSummitsDegrees: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=edgesNumberFromSummitsDegrees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edgesNumberFromSummitsDegrees.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/edgesNumberFromSummitsDegrees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA4FF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAsB/D,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { randTupleInt } from "../../../math/utils/random/randTupleInt.js";
6
+ import { AddNode } from "../../../tree/nodes/operators/addNode.js";
7
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
8
+ import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
9
+ import { doWhile } from "../../../utils/doWhile.js";
10
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
11
+ import { mdTable } from "../../../utils/markdown/mdTable.js";
12
+ const getPropositions = (n, { answer, degrees }) => {
13
+ const propositions = [];
14
+ addValidProp(propositions, answer);
15
+ tryToAddWrongProp(propositions, degrees.reduce((acc, curr) => acc + curr, 0).frenchify());
16
+ propWhile(propositions, n, () => {
17
+ tryToAddWrongProp(propositions, randint(0, 10).frenchify());
18
+ });
19
+ return shuffleProps(propositions, n);
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const { degrees } = identifiers;
23
+ const sum = degrees.reduce((acc, curr) => acc + curr, 0);
24
+ return frac(sum, 2).simplify().toTex();
25
+ };
26
+ const getInstruction = (identifiers) => {
27
+ const { degrees } = identifiers;
28
+ const summitNames = Array.from({ length: degrees.length }, (_, index) => String.fromCharCode(65 + index));
29
+ return `On considère un graphe non-orienté $G$ dont les degrés des sommets sont donnés dans le tableau suivant :
30
+
31
+ ${mdTable([
32
+ ["Sommet", ...summitNames.map((el) => `$${el}$`)],
33
+ ["Degré", ...degrees.map((el) => `$${el}$`)],
34
+ ])}
35
+
36
+ Quel est le nombre d'arêtes de $G$ ?`;
37
+ };
38
+ const getHint = () => {
39
+ return `Le degré d'un sommet est le nombre d'arêtes incidentes à ce sommet. Or, chaque arête relie deux sommets...`;
40
+ };
41
+ const getCorrection = (identifiers) => {
42
+ const { degrees } = identifiers;
43
+ return `Dans un graphe non-orienté, la somme des degrés des sommets est égale au double du nombre d'arêtes.
44
+
45
+ En effet, chaque arête possède deux extrémités, donc chaque arête est comptée deux fois dans la somme des degrés des sommets. Le raisonnement reste valable pour les boucles, qui comptent pour deux dans le degré d'un sommet.
46
+
47
+ Il suffit donc de calculer la somme des degrés et de diviser par $2$ pour obtenir le nombre d'arêtes :
48
+
49
+ $$
50
+ ${operatorComposition(AddNode, degrees.map((e) => e.toTree())).toTex()} = ${getAnswer(identifiers)}
51
+ $$`;
52
+ };
53
+ const getKeys = () => {
54
+ return [];
55
+ };
56
+ const isAnswerValid = (ans, { answer }) => {
57
+ try {
58
+ return rationalVEA(ans, answer);
59
+ }
60
+ catch (err) {
61
+ return handleVEAError(err);
62
+ }
63
+ };
64
+ const getEdgesNumberFromSummitsDegreesQuestion = () => {
65
+ const length = randint(4, 6);
66
+ const degrees = doWhile(() => randTupleInt(length, { from: 2, to: length + 2 }), (arr) => arr.filter((x) => x % 2 !== 0).length % 2 !== 0);
67
+ const identifiers = { degrees };
68
+ return getQuestionFromIdentifiers(identifiers);
69
+ };
70
+ const getQuestionFromIdentifiers = (identifiers) => {
71
+ return {
72
+ answer: getAnswer(identifiers),
73
+ instruction: getInstruction(identifiers),
74
+ keys: getKeys(identifiers),
75
+ answerFormat: "tex",
76
+ identifiers,
77
+ hint: getHint(identifiers),
78
+ correction: getCorrection(identifiers),
79
+ };
80
+ };
81
+ export const edgesNumberFromSummitsDegrees = {
82
+ id: "edgesNumberFromSummitsDegrees",
83
+ connector: "=",
84
+ label: "Déterminer le nombre d'arêtes d'un graphe non-orienté à partir du degré de ses sommets",
85
+ isSingleStep: true,
86
+ generator: (nb, opts) => getDistinctQuestions(() => getEdgesNumberFromSummitsDegreesQuestion(opts), nb),
87
+ qcmTimer: 60,
88
+ freeTimer: 60,
89
+ getPropositions,
90
+ isAnswerValid,
91
+ subject: "Mathématiques",
92
+ getInstruction,
93
+ getHint,
94
+ getCorrection,
95
+ getAnswer,
96
+ getQuestionFromIdentifiers,
97
+ hasHintAndCorrection: true,
98
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
3
+ type Identifiers = {
4
+ matrixIds: MatrixIdentifiers;
5
+ };
6
+ export declare const eulerianChainFromAdjacentMatrix: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=eulerianChainFromAdjacentMatrix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eulerianChainFromAdjacentMatrix.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/eulerianChainFromAdjacentMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAGvC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AA8FF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAqBjE,CAAC"}