math-exercises 3.0.158 → 3.0.160

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 (268) hide show
  1. package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +7 -6
  2. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -1
  3. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +88 -9
  4. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +8 -2
  6. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  7. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  9. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  10. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +27 -2
  11. package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.js +1 -3
  13. package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +0 -1
  15. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -1
  16. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +11 -4
  17. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +11 -5
  19. package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
  20. package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
  22. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  23. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +91 -21
  24. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
  25. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +63 -43
  26. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
  27. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +72 -49
  28. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
  29. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -19
  30. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -1
  31. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +26 -14
  32. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +1 -0
  33. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -1
  34. package/lib/exercises/math/derivation/derivative/exp/index.js +1 -0
  35. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  36. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  37. package/lib/exercises/math/derivation/variations/index.js +1 -0
  38. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts +7 -0
  39. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +174 -0
  41. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +30 -3
  43. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +12 -7
  45. package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +1 -1
  46. package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +2 -2
  47. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -1
  48. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +33 -44
  49. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -1
  50. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +80 -8
  51. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -1
  52. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +80 -25
  53. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -1
  54. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +6 -15
  55. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  56. package/lib/exercises/math/functions/exponential/expFactorization.js +54 -42
  57. package/lib/exercises/math/functions/exponential/index.d.ts +2 -0
  58. package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
  59. package/lib/exercises/math/functions/exponential/index.js +2 -0
  60. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +3 -0
  61. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts +1 -0
  62. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -1
  63. package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
  64. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts +13 -0
  65. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts.map +1 -0
  66. package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.js +147 -0
  67. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +96 -0
  69. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +95 -1
  71. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts +9 -0
  72. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts.map +1 -0
  73. package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.js +173 -0
  74. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +2 -0
  75. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -1
  76. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +2 -0
  77. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +1 -1
  78. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts +9 -0
  79. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.js +97 -0
  81. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +18 -23
  83. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +24 -26
  85. package/lib/exercises/math/functions/variations/index.d.ts +1 -0
  86. package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/variations/index.js +1 -0
  88. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
  89. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
  90. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
  91. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
  92. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
  93. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
  94. package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
  95. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  96. package/lib/exercises/math/geometry/cartesian/index.js +3 -0
  97. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
  98. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
  99. package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
  100. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts +10 -0
  101. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts.map +1 -0
  102. package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.js +174 -0
  103. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts +12 -0
  104. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -0
  105. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +161 -0
  106. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts +9 -0
  107. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts.map +1 -0
  108. package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.js +145 -0
  109. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts +13 -0
  110. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts.map +1 -0
  111. package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.js +181 -0
  112. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts +11 -0
  113. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts.map +1 -0
  114. package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.js +191 -0
  115. package/lib/exercises/math/geometry/circles/index.d.ts +7 -0
  116. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
  117. package/lib/exercises/math/geometry/circles/index.js +6 -0
  118. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
  119. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
  120. package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
  121. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
  122. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
  123. package/lib/exercises/math/geometry/index.d.ts +1 -0
  124. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/index.js +1 -0
  126. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts +10 -0
  127. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts.map +1 -0
  128. package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.js +181 -0
  129. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts +4 -1
  130. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +23 -3
  132. package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
  133. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  134. package/lib/exercises/math/geometry/lines/index.js +1 -0
  135. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts +4 -0
  136. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
  137. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
  138. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
  139. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
  140. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
  141. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
  142. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
  143. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
  144. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
  145. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
  146. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
  147. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
  148. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
  149. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
  150. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
  151. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
  152. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
  153. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
  154. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
  155. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
  156. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
  157. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
  158. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
  159. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts +6 -0
  160. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
  161. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
  162. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
  163. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
  164. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
  165. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
  166. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
  167. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
  168. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
  169. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
  170. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
  171. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
  172. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
  173. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
  174. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
  175. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
  176. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
  177. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
  178. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
  179. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
  180. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
  181. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
  182. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
  183. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
  184. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
  185. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
  186. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +9 -0
  187. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
  188. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
  189. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
  190. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
  191. package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
  192. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
  193. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  194. package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
  195. package/lib/exercises/math/sequences/generation/index.d.ts +2 -0
  196. package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
  197. package/lib/exercises/math/sequences/generation/index.js +1 -0
  198. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
  199. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
  200. package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
  201. package/lib/exercises/math/sequences/graph/index.d.ts +2 -0
  202. package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
  203. package/lib/exercises/math/sequences/graph/index.js +1 -0
  204. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
  205. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
  206. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
  207. package/lib/exercises/math/sequences/index.d.ts +2 -0
  208. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  209. package/lib/exercises/math/sequences/index.js +2 -0
  210. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
  211. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
  212. package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
  213. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
  214. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
  215. package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
  216. package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
  217. package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
  218. package/lib/exercises/math/sequences/notation/index.js +2 -0
  219. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
  220. package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
  221. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
  222. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
  223. package/lib/exercises/vea/cartesianLineVEA.d.ts +2 -0
  224. package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
  225. package/lib/exercises/vea/cartesianLineVEA.js +1 -0
  226. package/lib/exercises/vea/pointVEA.d.ts +2 -0
  227. package/lib/exercises/vea/pointVEA.d.ts.map +1 -0
  228. package/lib/exercises/vea/pointVEA.js +7 -0
  229. package/lib/index.d.ts +164 -1
  230. package/lib/index.d.ts.map +1 -1
  231. package/lib/math/geometry/circle.d.ts +6 -0
  232. package/lib/math/geometry/circle.d.ts.map +1 -1
  233. package/lib/math/geometry/circle.js +16 -0
  234. package/lib/math/geometry/line.d.ts +2 -0
  235. package/lib/math/geometry/line.d.ts.map +1 -1
  236. package/lib/math/geometry/line.js +7 -0
  237. package/lib/math/geometry/point.d.ts +1 -0
  238. package/lib/math/geometry/point.d.ts.map +1 -1
  239. package/lib/math/geometry/point.js +5 -0
  240. package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
  241. package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
  242. package/lib/math/geometry/polygons/relationPP.js +41 -0
  243. package/lib/math/polynomials/trinom.d.ts +1 -1
  244. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  245. package/lib/math/polynomials/trinom.js +15 -6
  246. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  247. package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
  248. package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
  249. package/lib/math/utils/geometry/randomVecs2.js +34 -0
  250. package/lib/tests/questionTest.d.ts.map +1 -1
  251. package/lib/tests/questionTest.js +2 -2
  252. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
  253. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  254. package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
  255. package/lib/tree/nodes/functions/expNode.d.ts +1 -1
  256. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  257. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
  258. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  259. package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
  260. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  261. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  262. package/lib/tree/nodes/operators/fractionNode.js +6 -4
  263. package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
  264. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  265. package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
  266. package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
  267. package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
  268. package/package.json +1 -1
@@ -0,0 +1,174 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { CircleConstructor } from "../../../../math/geometry/circle.js";
4
+ import { Point, PointConstructor } from "../../../../math/geometry/point.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { equal } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
8
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
9
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
10
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
11
+ import { square } from "../../../../tree/nodes/operators/powerNode.js";
12
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
13
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
14
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
15
+ import { randomInt } from "crypto";
16
+ const getPropositions = (n, { answer }) => {
17
+ const propositions = [];
18
+ addValidProp(propositions, answer);
19
+ propWhile(propositions, n, () => {
20
+ const fakeCenter = PointConstructor.random("C");
21
+ const fakeRadius = randomInt(1, 10);
22
+ tryToAddWrongProp(propositions, CircleConstructor.cartesianEquation(fakeCenter, fakeRadius).toTex());
23
+ });
24
+ return shuffleProps(propositions, n);
25
+ };
26
+ const getAnswerNode = (identifiers) => {
27
+ const { aIds, bIds, cIds } = identifiers;
28
+ const a = reifyAlgebraic(aIds);
29
+ const b = reifyAlgebraic(bIds);
30
+ const c = reifyAlgebraic(cIds);
31
+ const abscisse = frac(a, -2).simplify();
32
+ const ordonne = frac(b, -2).simplify();
33
+ const radiusSquared = substract(add(square(abscisse), square(ordonne)), c).simplify();
34
+ return equal(add(square(substract("x", abscisse).simplify()), square(substract("y", ordonne).simplify())), radiusSquared.simplify());
35
+ };
36
+ const getAnswer = (identifiers) => {
37
+ return getAnswerNode(identifiers).toTex();
38
+ };
39
+ const getInstruction = (identifiers) => {
40
+ const { aIds, bIds, cIds } = identifiers;
41
+ const a = reifyAlgebraic(aIds);
42
+ const b = reifyAlgebraic(bIds);
43
+ const c = reifyAlgebraic(cIds);
44
+ return `Soit $\\mathcal{C}$ le cercle dont une équation cartésienne sous forme développée est :
45
+
46
+ $$
47
+ ${add(add(square("x"), multiply(a, "x")), add(add(square("y"), multiply(b, "y")), c))
48
+ .simplify({
49
+ towardsDistribute: true,
50
+ forbidFactorize: true,
51
+ })
52
+ .toTex()} = 0
53
+ $$
54
+
55
+ Donner l'équation cartésienne de $\\mathcal{C}$ sous forme canonique.`;
56
+ };
57
+ const getHint = (identifiers) => {
58
+ const { aIds, bIds } = identifiers;
59
+ const a = reifyAlgebraic(aIds);
60
+ const b = reifyAlgebraic(bIds);
61
+ const aIsPos = a.evaluate() > 0;
62
+ const bIsPos = b.evaluate() > 0;
63
+ return `Réécrit l'équation en faisant apparaître des identités remarquables.
64
+
65
+ Pour cela, tu peux compléter les égalités suivantes :
66
+
67
+ $$
68
+ ${add(square("x"), multiply(a, "x")).toTex()} = ${square((aIsPos ? add : substract)("x", "\\ldots")).toTex()} - \\ldots
69
+ $$
70
+
71
+ et
72
+
73
+ $$
74
+ ${add(square("y"), multiply(b, "y")).toTex()} = ${square((bIsPos ? add : substract)("y", "\\ldots")).toTex()} - \\ldots
75
+ $$
76
+ `;
77
+ };
78
+ const getCorrection = (identifiers) => {
79
+ const { aIds, bIds, cIds } = identifiers;
80
+ const a = reifyAlgebraic(aIds);
81
+ const b = reifyAlgebraic(bIds);
82
+ const c = reifyAlgebraic(cIds);
83
+ const abscisse = frac(a, -2).simplify();
84
+ const ordonne = frac(b, -2).simplify();
85
+ const firstId = substract(square(substract("x", abscisse).simplify()), square(abscisse).simplify());
86
+ const secondId = substract(square(substract("y", ordonne).simplify()), square(ordonne).simplify());
87
+ return `On réécrit l'équation en faisant apparaître des identités remarquables. Pour cela, on remarque que :
88
+
89
+ $$
90
+ ${add(square("x"), multiply(a, "x")).toTex()} = ${firstId.toTex()}
91
+ $$
92
+
93
+ et :
94
+
95
+ $$
96
+ ${add(square("y"), multiply(b, "y")).toTex()} = ${secondId.toTex()}
97
+ $$
98
+
99
+ L'équation peut donc se réécrire :
100
+
101
+ $$
102
+ ${add(add(firstId, secondId), c).toTex()} = 0
103
+ $$
104
+
105
+ La forme canonique est donc :
106
+
107
+ $$
108
+ ${getAnswer(identifiers)}
109
+ $$
110
+
111
+ `;
112
+ };
113
+ const getKeys = () => {
114
+ return ["x", "y", "equal"];
115
+ };
116
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
117
+ try {
118
+ const split = ans.split("=");
119
+ if (split.length !== 2)
120
+ return false;
121
+ const left = parseAlgebraic(split[0]);
122
+ const right = parseAlgebraic(split[1]);
123
+ const studentEq = substract(left, right).simplify();
124
+ const eqNode = getAnswerNode(identifiers);
125
+ const ansNode = substract(eqNode.leftChild, eqNode.rightChild).simplify();
126
+ return studentEq.toTex() === ansNode.toTex();
127
+ }
128
+ catch (err) {
129
+ return handleVEAError(err);
130
+ }
131
+ };
132
+ const getCircleCanonicalEquationFromDevEquationQuestion = () => {
133
+ const radius = randint(1, 10).toTree();
134
+ const centerx = randint(-9, 10, [0]);
135
+ const centery = randint(-9, 10, [0]);
136
+ const center = new Point("C", centerx, centery);
137
+ const identifiers = {
138
+ aIds: multiply(-2, center.x).simplify().toIdentifiers(),
139
+ bIds: multiply(-2, center.y).simplify().toIdentifiers(),
140
+ cIds: substract(add(square(center.x), square(center.y)), square(radius))
141
+ .simplify()
142
+ .toIdentifiers(),
143
+ };
144
+ return getQuestionFromIdentifiers(identifiers);
145
+ };
146
+ const getQuestionFromIdentifiers = (identifiers) => {
147
+ return {
148
+ answer: getAnswer(identifiers),
149
+ instruction: getInstruction(identifiers),
150
+ keys: getKeys(identifiers),
151
+ answerFormat: "tex",
152
+ identifiers,
153
+ hint: getHint(identifiers),
154
+ correction: getCorrection(identifiers),
155
+ };
156
+ };
157
+ export const circleCanonicalEquationFromDevEquation = {
158
+ id: "circleCanonicalEquationFromDevEquation",
159
+ connector: "\\iff",
160
+ label: "Donner l'équation cartésienne canonique d'un cercle à partir d'une équation développée",
161
+ isSingleStep: true,
162
+ generator: (nb, opts) => getDistinctQuestions(() => getCircleCanonicalEquationFromDevEquationQuestion(opts), nb),
163
+ qcmTimer: 60,
164
+ freeTimer: 60,
165
+ getPropositions,
166
+ isAnswerValid,
167
+ subject: "Mathématiques",
168
+ getInstruction,
169
+ getHint,
170
+ getCorrection,
171
+ getAnswer,
172
+ getQuestionFromIdentifiers,
173
+ hasHintAndCorrection: true,
174
+ };
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { EqualNodeIdentifiers } from "../../../../tree/nodes/equations/equalNode.js";
3
+ type Identifiers = {
4
+ isAskingRadius: boolean;
5
+ equationIds: EqualNodeIdentifiers;
6
+ };
7
+ type Options = {
8
+ askedParameter: string;
9
+ };
10
+ export declare const circleCenterAndRadiusFromEquation: Exercise<Identifiers, Options>;
11
+ export {};
12
+ //# sourceMappingURL=circleCenterAndRadiusFromEquation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circleCenterAndRadiusFromEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,oBAAoB,EACrB,MAAM,yCAAyC,CAAC;AAWjD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAqJF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAWF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB1E,CAAC"}
@@ -0,0 +1,161 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { pointVEA } from "../../../../exercises/vea/pointVEA.js";
4
+ import { sqrtVEA } from "../../../../exercises/vea/sqrtVEA.js";
5
+ import { CircleConstructor } from "../../../../math/geometry/circle.js";
6
+ import { Point, PointConstructor } from "../../../../math/geometry/point.js";
7
+ import { SquareRootConstructor } from "../../../../math/numbers/reals/real.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
10
+ import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
11
+ import { reifyAlgebraic } from "../../../../tree/nodes/nodeConstructor.js";
12
+ import { square } from "../../../../tree/nodes/operators/powerNode.js";
13
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
14
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
15
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ const getPropositions = (n, { answer, isAskingRadius }) => {
17
+ const propositions = [];
18
+ addValidProp(propositions, answer);
19
+ propWhile(propositions, n, () => {
20
+ if (isAskingRadius)
21
+ tryToAddWrongProp(propositions, coinFlip()
22
+ ? randint(1, 10) + ""
23
+ : SquareRootConstructor.randomIrreductible(20).toTex());
24
+ else
25
+ tryToAddWrongProp(propositions, PointConstructor.random("A").toCoords());
26
+ });
27
+ return shuffleProps(propositions, n);
28
+ };
29
+ const getAnswer = (identifiers) => {
30
+ const { equationIds, isAskingRadius } = identifiers;
31
+ const equation = reifyAlgebraic(equationIds);
32
+ console.log(equation.toTex());
33
+ if (isAskingRadius)
34
+ return sqrt(equation.rightChild).simplify().toTex();
35
+ const left = equation.leftChild;
36
+ const xNode = left.leftChild;
37
+ const abscisse = opposite(xNode.leftChild.toDetailedEvaluation({ x: (0).toTree() })).simplify();
38
+ const yNode = left.rightChild;
39
+ const ordonnee = opposite(yNode.leftChild.toDetailedEvaluation({ y: (0).toTree() })).simplify();
40
+ return new Point("O", abscisse, ordonnee).toCoords();
41
+ };
42
+ const getInstruction = (identifiers) => {
43
+ const { equationIds, isAskingRadius } = identifiers;
44
+ const equation = reifyAlgebraic(equationIds);
45
+ return `Soit $\\mathcal{C}$ le cercle dont une équation cartésienne est :
46
+
47
+ $$
48
+ ${equation.toTex()}
49
+ $$
50
+
51
+ ${isAskingRadius
52
+ ? "Quel est le rayon de $\\mathcal{C}$ ?"
53
+ : "Quelles sont les coordonnées du centre de $\\mathcal{C}$ ?"}`;
54
+ };
55
+ const getHint = () => {
56
+ return `Si $A(x_A;y_A)$ est le centre d'un cercle $\\mathcal{C}$ de rayon $R$, alors une équation cartésienne de $\\mathcal{C}$ est :
57
+
58
+ $$
59
+ (x-x_A)^2+(y-y_A)^2 = R^2
60
+ $$`;
61
+ };
62
+ const getCorrection = (identifiers) => {
63
+ const { isAskingRadius, equationIds } = identifiers;
64
+ const radius = getAnswer({ equationIds, isAskingRadius: true });
65
+ const coords = getAnswer({ equationIds, isAskingRadius: false });
66
+ const coordsTrimed = coords
67
+ .replaceAll("\\left", "")
68
+ .replaceAll("\\right", "")
69
+ .replaceAll("(", "")
70
+ .replaceAll(")", "");
71
+ const abscisse = coordsTrimed.split(";")[0].unfrenchify();
72
+ const ordonnee = coordsTrimed.split(";")[1].unfrenchify();
73
+ return `Si $A(x_A;y_A)$ est le centre d'un cercle $\\mathcal{C}$ de rayon $R$, alors une équation cartésienne de $R$ est :
74
+
75
+ $$
76
+ (x-x_A)^2+(y-y_A)^2 = R^2
77
+ $$
78
+
79
+ Ici, on peut donc réécrire l'équation pour faire apparaître les coordonnées du centre et le rayon :
80
+
81
+ $$
82
+ (${substract("x", abscisse).toTex()})^2 + (${substract("y", ordonnee).toTex()})^2 = ${square(radius).toTex()}
83
+ $$
84
+
85
+ ${isAskingRadius
86
+ ? `Le rayon de $\\mathcal{C}$ est donc $${radius}$.`
87
+ : `Les coordonnées du centre de $\\mathcal{C}$ sont donc $${coords}$.`}`;
88
+ };
89
+ const getKeys = () => {
90
+ return ["semicolon"];
91
+ };
92
+ const isAnswerValid = (ans, { answer, isAskingRadius }) => {
93
+ try {
94
+ if (isAskingRadius)
95
+ return sqrtVEA(ans, answer);
96
+ else {
97
+ return pointVEA(ans, answer);
98
+ }
99
+ }
100
+ catch (err) {
101
+ return handleVEAError(err);
102
+ }
103
+ };
104
+ const getCircleCenterAndRadiusFromEquationQuestion = (opts) => {
105
+ const isAskingRadius = opts?.askedParameter === "Rayon"
106
+ ? true
107
+ : opts?.askedParameter === "Coordonnées du centre"
108
+ ? false
109
+ : coinFlip();
110
+ const center = PointConstructor.random("O");
111
+ const radius = coinFlip()
112
+ ? randint(1, 10).toTree()
113
+ : SquareRootConstructor.randomIrreductible(20).toTree();
114
+ const eq = CircleConstructor.cartesianEquation(center, radius);
115
+ console.log("rad ", radius.toTex(), "eq ", eq.toTex());
116
+ const identifiers = {
117
+ isAskingRadius,
118
+ equationIds: eq.toIdentifiers(),
119
+ };
120
+ return getQuestionFromIdentifiers(identifiers);
121
+ };
122
+ const getQuestionFromIdentifiers = (identifiers) => {
123
+ return {
124
+ answer: getAnswer(identifiers),
125
+ instruction: getInstruction(identifiers),
126
+ keys: getKeys(identifiers),
127
+ answerFormat: "tex",
128
+ identifiers,
129
+ hint: getHint(identifiers),
130
+ correction: getCorrection(identifiers),
131
+ };
132
+ };
133
+ const options = [
134
+ {
135
+ id: "askedParameter",
136
+ label: "Paramètre demandé",
137
+ target: GeneratorOptionTarget.generation,
138
+ type: GeneratorOptionType.select,
139
+ values: ["Rayon", "Coordonnées du centre", "L'un ou l'autre aléatoirement"],
140
+ defaultValue: "L'un ou l'autre aléatoirement",
141
+ },
142
+ ];
143
+ export const circleCenterAndRadiusFromEquation = {
144
+ id: "circleCenterAndRadiusFromEquation",
145
+ connector: "=",
146
+ label: "Déterminer le centre ou le rayon d'un cercle dans son équation canonique",
147
+ isSingleStep: true,
148
+ generator: (nb, opts) => getDistinctQuestions(() => getCircleCenterAndRadiusFromEquationQuestion(opts), nb),
149
+ qcmTimer: 60,
150
+ freeTimer: 60,
151
+ getPropositions,
152
+ isAnswerValid,
153
+ subject: "Mathématiques",
154
+ getInstruction,
155
+ getHint,
156
+ getCorrection,
157
+ getAnswer,
158
+ getQuestionFromIdentifiers,
159
+ hasHintAndCorrection: true,
160
+ options,
161
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ type Identifiers = {
4
+ AIds: PointIdentifiers;
5
+ BIds: PointIdentifiers;
6
+ };
7
+ export declare const circleEquationFromDiameter: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=circleEquationFromDiameter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circleEquationFromDiameter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/circleEquationFromDiameter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAStC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AA+JF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
@@ -0,0 +1,145 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { PointConstructor, } from "../../../../math/geometry/point.js";
4
+ import { Vector } from "../../../../math/geometry/vector.js";
5
+ import { equal } from "../../../../tree/nodes/equations/equalNode.js";
6
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
7
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
8
+ import { doWhile } from "../../../../utils/doWhile.js";
9
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
10
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
11
+ const getPropositions = (n, { answer }) => {
12
+ const propositions = [];
13
+ addValidProp(propositions, answer);
14
+ propWhile(propositions, n, () => {
15
+ const [A, B] = PointConstructor.randomDifferent(2, {});
16
+ tryToAddWrongProp(propositions, getAnswer({
17
+ AIds: A.toIdentifiers(),
18
+ BIds: B.toIdentifiers(),
19
+ }));
20
+ });
21
+ return shuffleProps(propositions, n);
22
+ };
23
+ const getAnswerNode = (identifiers) => {
24
+ // const { AIds, BIds } = identifiers;
25
+ // const A = PointConstructor.fromIdentifiers(AIds);
26
+ // const B = PointConstructor.fromIdentifiers(BIds);
27
+ // const center = A.midpoint(B).simplify();
28
+ // const radius = frac(A.distanceToNode(B), 2).simplify();
29
+ // return CircleConstructor.cartesianEquation(center, radius);
30
+ const { AIds, BIds } = identifiers;
31
+ const A = PointConstructor.fromIdentifiers(AIds);
32
+ const B = PointConstructor.fromIdentifiers(BIds);
33
+ const AM = new Vector("AM", substract("x", A.x), substract("y", A.y)).simplify();
34
+ const BM = new Vector("BM", substract("x", B.x), substract("y", B.y)).simplify();
35
+ return equal(AM.scalarProduct(BM)
36
+ .simplify({ forbidFactorize: true, towardsDistribute: true })
37
+ .toTex(), 0);
38
+ };
39
+ const getAnswer = (identifiers) => {
40
+ return getAnswerNode(identifiers).toTex();
41
+ };
42
+ const getInstruction = (identifiers) => {
43
+ const { AIds, BIds } = identifiers;
44
+ const A = PointConstructor.fromIdentifiers(AIds);
45
+ const B = PointConstructor.fromIdentifiers(BIds);
46
+ return `Soit $\\mathcal{C}$ le cercle de diamètre $[AB]$, avec $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$.
47
+
48
+ Donner une équation cartésienne du cercle $\\mathcal{C}$.`;
49
+ };
50
+ const getHint = () => {
51
+ return `Si $[AB]$ est le diamètre d'un cercle $\\mathcal{C}$, alors tout point de $C$ est tel que $ABC$ est un triangle rectangle en $C$.
52
+
53
+ Cela signifie donc qu'un point $C(x;y)$ est sur le cercle $\\mathcal{C}$ si et seulement si les vecteurs $\\overrightarrow{AC}$ et $\\overrightarrow{BC}$ sont orthogonaux.`;
54
+ };
55
+ const getCorrection = (identifiers) => {
56
+ const { AIds, BIds } = identifiers;
57
+ const A = PointConstructor.fromIdentifiers(AIds);
58
+ const B = PointConstructor.fromIdentifiers(BIds);
59
+ const AM = new Vector("AM", substract("x", A.x), substract("y", A.y)).simplify();
60
+ const BM = new Vector("BM", substract("x", B.x), substract("y", B.y)).simplify();
61
+ // const center = A.midpoint(B).simplify();
62
+ // const radius = frac(A.distanceToNode(B), 2).simplify();
63
+ // const canoEq = CircleConstructor.cartesianEquation(center, radius).toTex();
64
+ return `On considère un point $M(x;y)$.
65
+
66
+ Le point $M$ appartient à $\\mathcal{C}$ si seulement si le triangle $ABM$ est rectangle en $M$, c'est à dire si $\\overrightarrow{AM}$ et $\\overrightarrow{BM}$ sont orthogonaux.
67
+
68
+ Donc le point $M$ appartient à $\\mathcal{C}$ si et seulement si :
69
+
70
+ ${alignTex([
71
+ ["", "\\overrightarrow{AM}\\cdot \\overrightarrow{BM}=0"],
72
+ ["\\iff", `${AM.scalarProduct(BM).toTex()} = 0`],
73
+ [
74
+ "\\iff",
75
+ `${AM.scalarProduct(BM)
76
+ .simplify({ forbidFactorize: true, towardsDistribute: true })
77
+ .toTex()} = 0`,
78
+ ],
79
+ ])}
80
+
81
+ Une équation cartésienne du cercle $\\mathcal{C}$ est donc :
82
+
83
+ $$
84
+ ${getAnswer(identifiers)}
85
+ $$`;
86
+ };
87
+ const getKeys = () => {
88
+ return ["x", "y", "equal"];
89
+ };
90
+ const isAnswerValid = (ans, { answer: _answer, ...identifiers }) => {
91
+ try {
92
+ const split = ans.split("=");
93
+ if (split.length !== 2)
94
+ return false;
95
+ const left = parseAlgebraic(split[0]);
96
+ const right = parseAlgebraic(split[1]);
97
+ const studentEq = substract(left, right).simplify({
98
+ towardsDistribute: true,
99
+ forbidFactorize: true,
100
+ });
101
+ const ansNodeDev = getAnswerNode(identifiers).leftChild;
102
+ return studentEq.toTex() === ansNodeDev.toTex();
103
+ }
104
+ catch (err) {
105
+ return handleVEAError(err);
106
+ }
107
+ };
108
+ const getCircleEquationFromDiameterQuestion = () => {
109
+ const A = PointConstructor.random("A");
110
+ const B = doWhile(() => PointConstructor.random("B"), (p) => p.equals(A));
111
+ const identifiers = {
112
+ AIds: A.toIdentifiers(),
113
+ BIds: B.toIdentifiers(),
114
+ };
115
+ return getQuestionFromIdentifiers(identifiers);
116
+ };
117
+ const getQuestionFromIdentifiers = (identifiers) => {
118
+ return {
119
+ answer: getAnswer(identifiers),
120
+ instruction: getInstruction(identifiers),
121
+ keys: getKeys(identifiers),
122
+ answerFormat: "tex",
123
+ identifiers,
124
+ hint: getHint(identifiers),
125
+ correction: getCorrection(identifiers),
126
+ };
127
+ };
128
+ export const circleEquationFromDiameter = {
129
+ id: "circleEquationFromDiameter",
130
+ connector: "\\iff",
131
+ label: "Déterminer une équation cartésienne d'un cercle en connaissant son diamètre",
132
+ isSingleStep: true,
133
+ generator: (nb, opts) => getDistinctQuestions(() => getCircleEquationFromDiameterQuestion(opts), nb),
134
+ qcmTimer: 60,
135
+ freeTimer: 60,
136
+ getPropositions,
137
+ isAnswerValid,
138
+ subject: "Mathématiques",
139
+ getInstruction,
140
+ getHint,
141
+ getCorrection,
142
+ getAnswer,
143
+ getQuestionFromIdentifiers,
144
+ hasHintAndCorrection: true,
145
+ };
@@ -0,0 +1,13 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ centerIds: PointIdentifiers;
6
+ radiusIds: NodeIdentifiers;
7
+ };
8
+ type Options = {
9
+ equationType: string;
10
+ };
11
+ export declare const circleEquationFromPointAndRadius: Exercise<Identifiers, Options>;
12
+ export {};
13
+ //# sourceMappingURL=circleEquationFromPointAndRadius.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circleEquationFromPointAndRadius.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/circleEquationFromPointAndRadius.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAwMF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAYF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBzE,CAAC"}