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,125 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Complex, ComplexConstructor } from "../../../../math/complex/complex.js";
4
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
5
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
7
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
8
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
9
+ const getInstruction = (identifiers) => {
10
+ const z1 = new Complex(identifiers.z1Re, identifiers.z1Im);
11
+ const z2 = new Complex(identifiers.z2Re, identifiers.z2Im);
12
+ return `Soit $z=${z1.toTree().toTex()}$ et $z'=${z2.toTree().toTex()}$.
13
+
14
+ Calculer $z + z'$.`;
15
+ };
16
+ const getAnswer = (identifiers) => {
17
+ const z1 = new Complex(identifiers.z1Re, identifiers.z1Im);
18
+ const z2 = new Complex(identifiers.z2Re, identifiers.z2Im);
19
+ const answer = z1.add(z2).toTree().toTex();
20
+ return answer;
21
+ };
22
+ const getHint = () => {
23
+ return `Soient deux nombres complexes $z = a+ib$ et $z' = a'+ib'$. Alors :
24
+
25
+ $$
26
+ z+z' = (a+a') + i(b+b')
27
+ $$`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { z1Re, z1Im, z2Re, z2Im } = identifiers;
31
+ const z1 = add(z1Re, multiply(z1Im, "i")).simplify({
32
+ forbidFactorize: true,
33
+ noAddOrder: true,
34
+ });
35
+ const z2 = add(z2Re, multiply(z2Im, "i")).simplify({
36
+ forbidFactorize: true,
37
+ noAddOrder: true,
38
+ });
39
+ return `Soient deux nombres complexes $z = a+ib$ et $z' = a'+ib'$. Alors :
40
+
41
+ $$
42
+ z+z' = (a+a') + i(b+b')
43
+ $$
44
+
45
+ Ici, on a donc :
46
+
47
+ ${alignTex([
48
+ ["z+ z'", "=", add(z1, z2).toTex()],
49
+ ["", "=", add(add(z1Re, z2Re), multiply("i", add(z1Im, z2Im))).toTex()],
50
+ ["", "=", getAnswer(identifiers)],
51
+ ])}`;
52
+ };
53
+ const getQuestionFromIdentifiers = (identifiers) => {
54
+ const question = {
55
+ answer: getAnswer(identifiers),
56
+ instruction: getInstruction(identifiers),
57
+ keys: ["i"],
58
+ answerFormat: "tex",
59
+ startStatement: "z+z'",
60
+ identifiers,
61
+ hint: getHint(identifiers),
62
+ correction: getCorrection(identifiers),
63
+ };
64
+ return question;
65
+ };
66
+ const getAddComplexQuestion = () => {
67
+ const z1 = ComplexConstructor.random();
68
+ let z2;
69
+ let counter = 0;
70
+ do {
71
+ counter++;
72
+ if (counter > 1000) {
73
+ throw new Error("add complex too many iterations");
74
+ }
75
+ z2 = ComplexConstructor.random();
76
+ } while (z1.im === 0 && z2.im === 0);
77
+ const identifiers = {
78
+ z1Re: z1.re,
79
+ z1Im: z1.im,
80
+ z2Re: z2.re,
81
+ z2Im: z2.im,
82
+ };
83
+ return getQuestionFromIdentifiers(identifiers);
84
+ };
85
+ const getPropositions = (n, { answer, z1Re, z1Im, z2Re, z2Im }) => {
86
+ const propositions = [];
87
+ addValidProp(propositions, answer);
88
+ const z1 = new Complex(z1Re, z1Im);
89
+ const z2 = new Complex(z2Re, z2Im);
90
+ tryToAddWrongProp(propositions, z1.add(z2.opposite()).toTree().toTex());
91
+ propWhile(propositions, n, () => {
92
+ const wrongAnswer = ComplexConstructor.random();
93
+ tryToAddWrongProp(propositions, wrongAnswer.toTree().toTex());
94
+ });
95
+ return shuffle(propositions);
96
+ };
97
+ const isAnswerValid = (ans, { answer }) => {
98
+ const parsed = parseAlgebraic(ans);
99
+ if (!parsed)
100
+ return false;
101
+ return (parsed
102
+ .simplify({
103
+ forbidFactorize: true,
104
+ })
105
+ .toTex() ===
106
+ parseAlgebraic(answer)
107
+ .simplify({
108
+ forbidFactorize: true,
109
+ })
110
+ .toTex());
111
+ };
112
+ export const addComplex = {
113
+ id: "addComplex",
114
+ connector: "=",
115
+ label: "Additionner deux nombres complexes",
116
+ isSingleStep: true,
117
+ generator: (nb) => getDistinctQuestions(getAddComplexQuestion, nb),
118
+ qcmTimer: 60,
119
+ freeTimer: 60,
120
+ getPropositions,
121
+ isAnswerValid,
122
+ subject: "Mathématiques",
123
+ getQuestionFromIdentifiers,
124
+ hasHintAndCorrection: true,
125
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ re: number;
4
+ im: number;
5
+ };
6
+ export declare const conjugateComplex: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=conjugateComplex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conjugateComplex.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/algebraic/conjugateComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Complex, ComplexConstructor } from "../../../../math/complex/complex.js";
4
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
5
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
6
+ const getInstruction = (identifiers) => {
7
+ const { re, im } = identifiers;
8
+ const complex = new Complex(re, im);
9
+ return `Déterminer le conjugué $\\overline{z}$ de :
10
+
11
+ $$
12
+ z=${complex.toTree().toTex()}
13
+ $$`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { re, im } = identifiers;
17
+ const complex = new Complex(re, im);
18
+ const answer = complex.conjugate().toTree().toTex();
19
+ return answer;
20
+ };
21
+ const getHint = () => {
22
+ return `Soit $z = a+ib$ un nombre complexe.
23
+
24
+ Le conjugué $\\overline{z}$ de $z$ est le nombre :
25
+
26
+ $$
27
+ \\overline{z} = a-ib
28
+ $$`;
29
+ };
30
+ const getCorrection = (identifiers) => {
31
+ return `Soit $z = a+ib$ un nombre complexe.
32
+
33
+ Le conjugué $\\overline{z}$ de $z$ est le nombre :
34
+
35
+ $$
36
+ \\overline{z} = a-ib
37
+ $$
38
+
39
+ Ici, on a donc :
40
+
41
+ $$
42
+ \\overline{z} = ${getAnswer(identifiers)}
43
+ $$`;
44
+ };
45
+ const getQuestionFromIdentifiers = (identifiers) => {
46
+ const question = {
47
+ answer: getAnswer(identifiers),
48
+ instruction: getInstruction(identifiers),
49
+ keys: ["i"],
50
+ answerFormat: "tex",
51
+ startStatement: "\\overline z",
52
+ identifiers,
53
+ hint: getHint(identifiers),
54
+ correction: getCorrection(identifiers),
55
+ };
56
+ return question;
57
+ };
58
+ const getConjugateComplexQuestion = () => {
59
+ const complex = ComplexConstructor.random();
60
+ const identifiers = { re: complex.re, im: complex.im };
61
+ return getQuestionFromIdentifiers(identifiers);
62
+ };
63
+ const getPropositions = (n, { answer, re, im }) => {
64
+ const propositions = [];
65
+ addValidProp(propositions, answer);
66
+ const complex = new Complex(re, im);
67
+ const opposite = complex.opposite().toTree().toTex();
68
+ tryToAddWrongProp(propositions, opposite);
69
+ const conjOpposite = complex.conjugate().opposite().toTree().toTex();
70
+ tryToAddWrongProp(propositions, conjOpposite);
71
+ propWhile(propositions, n, () => {
72
+ const wrongAnswer = ComplexConstructor.random();
73
+ tryToAddWrongProp(propositions, wrongAnswer.toTree().toTex());
74
+ });
75
+ return shuffle(propositions);
76
+ };
77
+ const isAnswerValid = (ans, { answer }) => {
78
+ const parsed = parseAlgebraic(ans);
79
+ if (!parsed)
80
+ return false;
81
+ return (parsed
82
+ .simplify({
83
+ forbidFactorize: true,
84
+ })
85
+ .toTex() ===
86
+ parseAlgebraic(answer)
87
+ .simplify({
88
+ forbidFactorize: true,
89
+ })
90
+ .toTex());
91
+ };
92
+ export const conjugateComplex = {
93
+ id: "conjugateComplex",
94
+ connector: "=",
95
+ getPropositions,
96
+ label: "Conjugué d'un nombre complexe",
97
+ isSingleStep: true,
98
+ generator: (nb) => getDistinctQuestions(getConjugateComplexQuestion, nb),
99
+ qcmTimer: 60,
100
+ freeTimer: 60,
101
+ isAnswerValid,
102
+ subject: "Mathématiques",
103
+ getQuestionFromIdentifiers,
104
+ hasHintAndCorrection: true,
105
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ z1: number[];
4
+ z2: number[];
5
+ };
6
+ export declare const conjugateDivideComplex: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=conjugateDivideComplex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conjugateDivideComplex.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/algebraic/conjugateDivideComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;CACd,CAAC;AAyIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -0,0 +1,137 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Complex, ComplexConstructor } from "../../../../math/complex/complex.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
6
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
7
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
8
+ const getInstruction = (identifiers) => {
9
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
10
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
11
+ return `Soit $z=${z1.toTree().toTex()}$ et $z'=${z2.toTree().toTex()}$.
12
+
13
+ Calculer le conjugué de $\\frac{z}{z'}$.`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
17
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
18
+ const conjz1 = z1.conjugate();
19
+ const conjz2 = z2.conjugate();
20
+ const answerTex = conjz1.divideNode(conjz2).toTex();
21
+ return answerTex;
22
+ };
23
+ const getHint = () => {
24
+ return `Pour calculer un quotient dans $\\mathbb{C}$, on multiplie le numérateur et le dénominateur par le conjugué du dénominateur.
25
+
26
+ On rappelle que le conjugué d'un nombre complexe $z$ est le nombre complexe de même partie réelle et de partie imaginaire opposée.
27
+ `;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
31
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
32
+ const z1Tree = z1.toTree();
33
+ const z2Tree = z2.toTree();
34
+ const conj = z2.conjugate().toTree();
35
+ const num = z1.multiply(z2.conjugate()).toTree();
36
+ const denum = z2.multiply(z2.conjugate()).toTree();
37
+ // const zTree = z.toTree();
38
+ // const conj = z.conjugate().toTree();
39
+ return `On a
40
+
41
+ $$
42
+ z = ${z1Tree.toTex()}
43
+ $$
44
+
45
+ $$
46
+ z' = ${z2Tree.toTex()}
47
+ $$
48
+
49
+ et on veut calculer le conjugué de $\\frac{z}{z'}$.
50
+
51
+ On commence par calculer $\\frac{z}{z'}$. Pour cela, on multiplie le numérateur et le dénominateur par le conjugué de $z'$, c'est à dire par :
52
+
53
+ $$
54
+ ${conj.toTex()}
55
+ $$
56
+
57
+ Cela donne :
58
+
59
+
60
+ ${alignTex([
61
+ ["", ` \\frac{${z1Tree.toTex()}}{${z2Tree.toTex()}} `],
62
+ [
63
+ "=",
64
+ `\\frac{(${z1Tree.toTex()})(${conj.toTex()})}{(${z2Tree.toTex()})(${conj.toTex()})}`,
65
+ ],
66
+ ["=", frac(num, denum).toTex()],
67
+ ["=", z1.divideNode(z2).toTex()],
68
+ ])}
69
+
70
+ Il suffit maintenant de prendre le conjugué de ce résultat : on obtient
71
+
72
+ $$
73
+ ${getAnswer(identifiers)}
74
+ $$
75
+ `;
76
+ };
77
+ const getQuestionFromIdentifiers = (identifiers) => {
78
+ const question = {
79
+ answer: getAnswer(identifiers),
80
+ instruction: getInstruction(identifiers),
81
+ keys: ["i"],
82
+ answerFormat: "tex",
83
+ startStatement: "\\overline{\\frac{z}{z'}}",
84
+ identifiers,
85
+ hint: getHint(identifiers),
86
+ correction: getCorrection(identifiers),
87
+ };
88
+ return question;
89
+ };
90
+ const getConjugateDivideComplexQuestion = () => {
91
+ let z1;
92
+ let z2;
93
+ let counter = 0;
94
+ do {
95
+ counter++;
96
+ if (counter > 1000) {
97
+ throw new Error("conjugate divide complex too many iterations");
98
+ }
99
+ z1 = [randint(-10, 11, [0]), randint(-10, 11, [0])];
100
+ z2 = [randint(-10, 11, [0]), randint(-10, 11, [0])];
101
+ } while (z1[0] / z2[0] === z1[1] / z2[1]);
102
+ const identifiers = {
103
+ z1,
104
+ z2,
105
+ };
106
+ return getQuestionFromIdentifiers(identifiers);
107
+ };
108
+ const getPropositions = (n, { answer }) => {
109
+ const propositions = [];
110
+ addValidProp(propositions, answer);
111
+ propWhile(propositions, n, () => {
112
+ const wrongAnswer = ComplexConstructor.random();
113
+ tryToAddWrongProp(propositions, wrongAnswer.toTree().toTex());
114
+ });
115
+ return shuffle(propositions);
116
+ };
117
+ const isAnswerValid = (ans, { z1, z2 }) => {
118
+ const complex1 = new Complex(z1[0], z1[1]).conjugate();
119
+ const complex2 = new Complex(z2[0], z2[1]).conjugate();
120
+ const divide = complex1.divideNode(complex2);
121
+ const texs = divide.toAllValidTexs({ allowFractionToDecimal: true });
122
+ return texs.includes(ans);
123
+ };
124
+ export const conjugateDivideComplex = {
125
+ id: "conjugateDivideComplex",
126
+ connector: "=",
127
+ label: "Conjugué d'une fraction de nombres complexes",
128
+ isSingleStep: true,
129
+ generator: (nb) => getDistinctQuestions(getConjugateDivideComplexQuestion, nb),
130
+ qcmTimer: 60,
131
+ freeTimer: 60,
132
+ getPropositions,
133
+ isAnswerValid,
134
+ subject: "Mathématiques",
135
+ getQuestionFromIdentifiers,
136
+ hasHintAndCorrection: true,
137
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ z1: number[];
4
+ z2: number[];
5
+ };
6
+ export declare const conjugateMultiplyComplex: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=conjugateMultiplyComplex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conjugateMultiplyComplex.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/algebraic/conjugateMultiplyComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;CACd,CAAC;AA4HF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -0,0 +1,116 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Complex, ComplexConstructor } from "../../../../math/complex/complex.js";
4
+ import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
5
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
8
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
9
+ const getInstruction = (identifiers) => {
10
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
11
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
12
+ return `Soit $z=${z1.toTree().toTex()}$ et $z'=${z2.toTree().toTex()}$.
13
+
14
+ Calculer $\\overline{z\\times z'}$.`;
15
+ };
16
+ const getAnswer = (identifiers) => {
17
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
18
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
19
+ const prod = z1.multiply(z2);
20
+ const conj = prod.conjugate();
21
+ const answer = conj.toTree().toTex();
22
+ return answer;
23
+ };
24
+ const getHint = () => {
25
+ return `Pour multiplier deux nombres complexes, on utilise la distributivité double, ainsi que le fait que $i^2 = -1$.
26
+
27
+ On rappelle que le conjugué $\\overline{z}$ d'un nombre complexe $z$ est le nombre complexe de même partie réelle et de partie imaginaire opposée.`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { z1, z2 } = identifiers;
31
+ const [a, b] = z1;
32
+ const [c, d] = z2;
33
+ const zA = add(a, multiply(b, "i"));
34
+ const zB = add(c, multiply(d, "i"));
35
+ return `On distribue comme pour des nombres réels, puis on utilise le fait que $i^2=-1$ :
36
+
37
+ ${alignTex([
38
+ ["z\\times z'", "=", multiply(zA, zB).toTex()],
39
+ [
40
+ "",
41
+ "=",
42
+ add(add(multiply(a, c), multiply(a, multiply(d, "i"))), add(multiply(multiply(b, "i"), c), multiply(multiply(b, "i"), multiply(d, "i")))).toTex(),
43
+ ],
44
+ [
45
+ "",
46
+ "=",
47
+ add(add(multiply(a, c).simplify(), multiply(a * d + b * c, "i")), multiply(multiply(b, d).simplify(), -1)).toTex(),
48
+ ],
49
+ [
50
+ "",
51
+ "=",
52
+ add(add(multiply(a, c), multiply(a * d + b * c, "i")), multiply(multiply(b, d), -1))
53
+ .simplify({ noAddOrder: true })
54
+ .toTex(),
55
+ ],
56
+ ])}
57
+
58
+ Il suffit alors de prendre le conjugué de ce résultat, on obtient :
59
+
60
+ $$
61
+ ${getAnswer(identifiers)}
62
+ $$
63
+ `;
64
+ };
65
+ const getQuestionFromIdentifiers = (identifiers) => {
66
+ const question = {
67
+ answer: getAnswer(identifiers),
68
+ instruction: getInstruction(identifiers),
69
+ keys: ["i"],
70
+ answerFormat: "tex",
71
+ startStatement: "\\overline{z\\times z'}",
72
+ identifiers,
73
+ hint: getHint(identifiers),
74
+ correction: getCorrection(identifiers),
75
+ };
76
+ return question;
77
+ };
78
+ const getConjugateMultiplyComplexQuestion = () => {
79
+ const [a, b, c, d] = randTupleInt(4, { from: -9, to: 10, elExcludes: [0] });
80
+ const identifiers = { z1: [a, b], z2: [c, d] };
81
+ return getQuestionFromIdentifiers(identifiers);
82
+ };
83
+ const getPropositions = (n, { answer, z1, z2 }) => {
84
+ const propositions = [];
85
+ addValidProp(propositions, answer);
86
+ const complex1 = new Complex(z1[0], z1[1]);
87
+ const complex2 = new Complex(z2[0], z2[1]);
88
+ const prod = complex1.multiply(complex2);
89
+ tryToAddWrongProp(propositions, prod.toTree().toTex());
90
+ propWhile(propositions, n, () => {
91
+ const wrongAnswer = ComplexConstructor.random();
92
+ tryToAddWrongProp(propositions, wrongAnswer.toTree().toTex());
93
+ });
94
+ return shuffle(propositions);
95
+ };
96
+ const isAnswerValid = (ans, { z1, z2 }) => {
97
+ const complex1 = new Complex(z1[0], z1[1]);
98
+ const complex2 = new Complex(z2[0], z2[1]);
99
+ const answer = complex1.multiply(complex2).conjugate().toTree();
100
+ const texs = answer.toAllValidTexs();
101
+ return texs.includes(ans);
102
+ };
103
+ export const conjugateMultiplyComplex = {
104
+ id: "conjugateMultiplyComplex",
105
+ connector: "=",
106
+ label: "Conjugué d'un produit de nombres complexes",
107
+ isSingleStep: true,
108
+ generator: (nb) => getDistinctQuestions(getConjugateMultiplyComplexQuestion, nb),
109
+ qcmTimer: 60,
110
+ freeTimer: 60,
111
+ getPropositions,
112
+ isAnswerValid,
113
+ subject: "Mathématiques",
114
+ getQuestionFromIdentifiers,
115
+ hasHintAndCorrection: true,
116
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ z1: number[];
4
+ z2: number[];
5
+ };
6
+ export declare const divideComplex: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=divideComplex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divideComplex.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/algebraic/divideComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;CACd,CAAC;AAyHF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Complex, ComplexConstructor } from "../../../../math/complex/complex.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
6
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
7
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
8
+ const getInstruction = (identifiers) => {
9
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
10
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
11
+ return `Soit $z=${z1.toTree().toTex()}$ et $z'=${z2.toTree().toTex()}$.
12
+
13
+ Calculer $\\frac{z}{z'}$.`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
17
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
18
+ const answerTex = z1.divideNode(z2).toTex();
19
+ return answerTex;
20
+ };
21
+ const getHint = () => {
22
+ return `Pour calculer un quotient dans $\\mathbb{C}$, on multiplie le numérateur et le dénominateur par le conjugué du dénominateur.
23
+
24
+ On rappelle que le conjugué d'un nombre complexe $z$ est le nombre complexe de même partie réelle et de partie imaginaire opposée.
25
+ `;
26
+ };
27
+ const getCorrection = (identifiers) => {
28
+ const z1 = new Complex(identifiers.z1[0], identifiers.z1[1]);
29
+ const z2 = new Complex(identifiers.z2[0], identifiers.z2[1]);
30
+ const z1Tree = z1.toTree();
31
+ const z2Tree = z2.toTree();
32
+ const conj = z2.conjugate().toTree();
33
+ const num = z1.multiply(z2.conjugate()).toTree();
34
+ const denum = z2.multiply(z2.conjugate()).toTree();
35
+ // const zTree = z.toTree();
36
+ // const conj = z.conjugate().toTree();
37
+ return `On a
38
+
39
+ $$
40
+ z = ${z1Tree.toTex()}
41
+ $$
42
+
43
+ $$
44
+ z' = ${z2Tree.toTex()}
45
+ $$
46
+
47
+ et on veut calculer $\\frac{z}{z'}$.
48
+
49
+ Pour cela, on multiplie le numérateur et le dénominateur par le conjugué de $z'$, c'est à dire par :
50
+
51
+ $$
52
+ ${conj.toTex()}
53
+ $$
54
+
55
+ Cela donne :
56
+
57
+
58
+ ${alignTex([
59
+ ["", ` \\frac{${z1Tree.toTex()}}{${z2Tree.toTex()}} `],
60
+ [
61
+ "=",
62
+ `\\frac{(${z1Tree.toTex()})(${conj.toTex()})}{(${z2Tree.toTex()})(${conj.toTex()})}`,
63
+ ],
64
+ ["=", frac(num, denum).toTex()],
65
+ ["=", getAnswer(identifiers)],
66
+ ])}`;
67
+ };
68
+ const getQuestionFromIdentifiers = (identifiers) => {
69
+ const question = {
70
+ answer: getAnswer(identifiers),
71
+ instruction: getInstruction(identifiers),
72
+ keys: ["i"],
73
+ answerFormat: "tex",
74
+ startStatement: "\\frac{z}{z'}",
75
+ identifiers,
76
+ hint: getHint(identifiers),
77
+ correction: getCorrection(identifiers),
78
+ };
79
+ return question;
80
+ };
81
+ const getDivideComplexQuestion = () => {
82
+ let z1;
83
+ let z2;
84
+ let counter = 0;
85
+ do {
86
+ counter++;
87
+ if (counter > 1000) {
88
+ throw new Error("divide complex too many iterations");
89
+ }
90
+ z1 = [randint(-10, 11, [0]), randint(-10, 11, [0])];
91
+ z2 = [randint(-10, 11, [0]), randint(-10, 11, [0])];
92
+ } while (z1[0] / z2[0] === z1[1] / z2[1]);
93
+ const identifiers = {
94
+ z1,
95
+ z2,
96
+ };
97
+ return getQuestionFromIdentifiers(identifiers);
98
+ };
99
+ const getPropositions = (n, { answer }) => {
100
+ const propositions = [];
101
+ addValidProp(propositions, answer);
102
+ propWhile(propositions, n, () => {
103
+ const wrongAnswer = ComplexConstructor.random();
104
+ tryToAddWrongProp(propositions, wrongAnswer.toTree().toTex());
105
+ });
106
+ return shuffle(propositions);
107
+ };
108
+ const isAnswerValid = (ans, { z1, z2 }) => {
109
+ const complex1 = new Complex(z1[0], z1[1]);
110
+ const complex2 = new Complex(z2[0], z2[1]);
111
+ const divide = complex1.divideNode(complex2);
112
+ const texs = divide.toAllValidTexs({ allowFractionToDecimal: true });
113
+ return texs.includes(ans);
114
+ };
115
+ export const divideComplex = {
116
+ id: "divideComplex",
117
+ connector: "=",
118
+ label: "Diviser deux nombres complexes",
119
+ isSingleStep: true,
120
+ generator: (nb) => getDistinctQuestions(getDivideComplexQuestion, nb),
121
+ qcmTimer: 60,
122
+ freeTimer: 60,
123
+ getPropositions,
124
+ isAnswerValid,
125
+ subject: "Mathématiques",
126
+ getQuestionFromIdentifiers,
127
+ hasHintAndCorrection: true,
128
+ };
@@ -0,0 +1,11 @@
1
+ export * from "./addComplex.js";
2
+ export * from "./conjugateComplex.js";
3
+ export * from "./conjugateDivideComplex.js";
4
+ export * from "./conjugateMultiplyComplex.js";
5
+ export * from "./divideComplex.js";
6
+ export * from "./inverseComplex.js";
7
+ export * from "./linearCombinaisonComplex.js";
8
+ export * from "./moduloFromAlgebraicComplex.js";
9
+ export * from "./mutiplyComplex.js";
10
+ export * from "./reAndIm.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/algebraic/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}