math-exercises 3.0.170 → 3.0.172

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 (276) hide show
  1. package/lib/exercises/math/derivation/variations/signVarTable3dDegree.js +38 -10
  2. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -1
  3. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +7 -4
  4. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -1
  5. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +2 -3
  6. package/lib/exercises/math/functions/trinoms/problems/index.d.ts +1 -0
  7. package/lib/exercises/math/functions/trinoms/problems/index.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/trinoms/problems/index.js +1 -0
  9. package/lib/exercises/math/functions/trinoms/problems/rectangleSizesFromPerimeterAndArea.d.ts +9 -0
  10. package/lib/exercises/math/functions/trinoms/problems/rectangleSizesFromPerimeterAndArea.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/trinoms/problems/rectangleSizesFromPerimeterAndArea.js +202 -0
  12. package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -1
  13. package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +2 -1
  14. package/lib/exercises/math/functions/variations/varTableFromGraph.d.ts.map +1 -1
  15. package/lib/exercises/math/functions/variations/varTableFromGraph.js +2 -1
  16. package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
  17. package/lib/exercises/math/functions/variations/varTableFromSentences.js +2 -1
  18. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -1
  19. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +0 -2
  20. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -1
  21. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +64 -60
  22. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +1 -0
  23. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
  24. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +173 -47
  25. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -1
  26. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +112 -46
  27. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +1 -1
  28. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -1
  29. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +6 -0
  30. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -1
  31. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +60 -82
  32. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +92 -6
  34. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +6 -1
  35. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
  36. package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +6 -1
  37. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -1
  38. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +6 -0
  39. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +1 -1
  40. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -1
  41. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +15 -5
  42. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -1
  43. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +18 -14
  44. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -1
  45. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +15 -5
  46. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
  47. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +38 -4
  48. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -1
  49. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +77 -26
  50. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -1
  51. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +6 -7
  52. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +1 -1
  53. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -16
  55. package/lib/exercises/math/probaStat/randomVariable/calculateProbaFromVATableLaw.d.ts +11 -0
  56. package/lib/exercises/math/probaStat/randomVariable/calculateProbaFromVATableLaw.d.ts.map +1 -0
  57. package/lib/exercises/math/probaStat/randomVariable/calculateProbaFromVATableLaw.js +232 -0
  58. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts +14 -0
  59. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -0
  60. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +167 -0
  61. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
  62. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +29 -56
  63. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +8 -0
  64. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  65. package/lib/exercises/math/probaStat/randomVariable/index.js +9 -0
  66. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -1
  67. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +6 -6
  68. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
  69. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts +9 -0
  70. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts.map +1 -0
  71. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.js +116 -0
  72. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +11 -0
  73. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -0
  74. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.js +112 -0
  75. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +9 -0
  76. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -0
  77. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.js +176 -0
  78. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +8 -0
  79. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
  80. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.js +94 -0
  81. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +9 -0
  82. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
  83. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +162 -0
  84. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +8 -0
  85. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -0
  86. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.js +133 -0
  87. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +8 -0
  88. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -0
  89. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.js +211 -0
  90. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +8 -0
  91. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -0
  92. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.js +113 -0
  93. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
  94. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +1 -1
  95. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts +31 -0
  96. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts.map +1 -0
  97. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.js +192 -0
  98. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +40 -11
  99. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  100. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +172 -30
  101. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  102. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +16 -2
  103. package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.js +1 -1
  104. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -1
  105. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +0 -2
  106. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  107. package/lib/exercises/vea/rationalVEA.js +7 -3
  108. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  109. package/lib/exercises/vea/varLineVEA.js +2 -1
  110. package/lib/exercises/vea/varSignTableVEA.d.ts +8 -0
  111. package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -1
  112. package/lib/exercises/vea/varSignTableVEA.js +8 -0
  113. package/lib/exercises/vea/xTableLineVEA.d.ts +1 -0
  114. package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -1
  115. package/lib/exercises/vea/xTableLineVEA.js +1 -0
  116. package/lib/index.d.ts +86 -3
  117. package/lib/index.d.ts.map +1 -1
  118. package/lib/latexTester.d.ts.map +1 -1
  119. package/lib/latexTester.js +3 -1
  120. package/lib/math/geometry/angle.d.ts +2 -0
  121. package/lib/math/geometry/angle.d.ts.map +1 -1
  122. package/lib/math/geometry/angle.js +17 -0
  123. package/lib/math/geometry/point.js +2 -2
  124. package/lib/math/geometry/segment.js +1 -1
  125. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  126. package/lib/math/numbers/reals/real.js +4 -0
  127. package/lib/math/probability/randomVariable.d.ts +2 -1
  128. package/lib/math/probability/randomVariable.d.ts.map +1 -1
  129. package/lib/math/probability/randomVariable.js +7 -1
  130. package/lib/math/utils/arithmetic/primeFactors.d.ts +1 -1
  131. package/lib/math/utils/arithmetic/primeFactors.d.ts.map +1 -1
  132. package/lib/math/utils/arithmetic/primeFactors.js +23 -9
  133. package/lib/math/utils/random/randTupleInt.d.ts +1 -0
  134. package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
  135. package/lib/math/utils/random/randTupleInt.js +3 -0
  136. package/lib/tests/exosTest.d.ts.map +1 -1
  137. package/lib/tests/exosTest.js +2 -0
  138. package/lib/tests/pdfs/mdTableToLatexTabular.js +1 -1
  139. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  140. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  141. package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
  142. package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
  143. package/lib/tree/nodes/complex/complexNode.js +3 -0
  144. package/lib/tree/nodes/equations/equalNode.d.ts +1 -0
  145. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  146. package/lib/tree/nodes/equations/equalNode.js +3 -0
  147. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
  148. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  149. package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
  150. package/lib/tree/nodes/equations/multiEqualNode.d.ts +1 -0
  151. package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
  153. package/lib/tree/nodes/equations/notEqualNode.d.ts +1 -0
  154. package/lib/tree/nodes/equations/notEqualNode.d.ts.map +1 -1
  155. package/lib/tree/nodes/equations/notEqualNode.js +3 -0
  156. package/lib/tree/nodes/functions/absNode.d.ts +1 -0
  157. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/functions/absNode.js +7 -0
  159. package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
  160. package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
  161. package/lib/tree/nodes/functions/arcSinNode.js +7 -0
  162. package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
  163. package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
  164. package/lib/tree/nodes/functions/arccosNode.js +7 -0
  165. package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
  166. package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
  167. package/lib/tree/nodes/functions/arctanNode.js +7 -0
  168. package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
  169. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  170. package/lib/tree/nodes/functions/cosNode.js +7 -0
  171. package/lib/tree/nodes/functions/expNode.d.ts +1 -0
  172. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  173. package/lib/tree/nodes/functions/expNode.js +7 -0
  174. package/lib/tree/nodes/functions/factorialNode.d.ts +30 -0
  175. package/lib/tree/nodes/functions/factorialNode.d.ts.map +1 -0
  176. package/lib/tree/nodes/functions/factorialNode.js +79 -0
  177. package/lib/tree/nodes/functions/functionNode.d.ts +2 -1
  178. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  179. package/lib/tree/nodes/functions/functionNode.js +1 -0
  180. package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
  181. package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
  182. package/lib/tree/nodes/functions/integralNode.js +7 -0
  183. package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
  184. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  185. package/lib/tree/nodes/functions/log10Node.js +7 -0
  186. package/lib/tree/nodes/functions/logNode.d.ts +1 -0
  187. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  188. package/lib/tree/nodes/functions/logNode.js +9 -0
  189. package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
  190. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  191. package/lib/tree/nodes/functions/oppositeNode.js +7 -0
  192. package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
  193. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  194. package/lib/tree/nodes/functions/sinNode.js +7 -0
  195. package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
  196. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  197. package/lib/tree/nodes/functions/sqrtNode.js +7 -0
  198. package/lib/tree/nodes/functions/tanNode.d.ts +1 -0
  199. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  200. package/lib/tree/nodes/functions/tanNode.js +7 -0
  201. package/lib/tree/nodes/geometry/degree.d.ts +1 -0
  202. package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
  203. package/lib/tree/nodes/geometry/degree.js +7 -0
  204. package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
  205. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  206. package/lib/tree/nodes/geometry/lengthNode.js +7 -0
  207. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
  208. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  209. package/lib/tree/nodes/geometry/pointNode.js +7 -0
  210. package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
  211. package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
  212. package/lib/tree/nodes/geometry/vectorNode.js +7 -0
  213. package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
  214. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  215. package/lib/tree/nodes/inequations/inequationNode.js +7 -0
  216. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
  217. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  218. package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -0
  219. package/lib/tree/nodes/node.d.ts +2 -1
  220. package/lib/tree/nodes/node.d.ts.map +1 -1
  221. package/lib/tree/nodes/node.js +2 -0
  222. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  223. package/lib/tree/nodes/nodeConstructor.js +4 -0
  224. package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
  225. package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
  226. package/lib/tree/nodes/numbers/percentNode.js +7 -0
  227. package/lib/tree/nodes/operators/addNode.d.ts +1 -0
  228. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  229. package/lib/tree/nodes/operators/addNode.js +7 -0
  230. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +2 -1
  231. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  232. package/lib/tree/nodes/operators/binomialCoefficientNode.js +18 -2
  233. package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
  234. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  235. package/lib/tree/nodes/operators/divideNode.js +7 -0
  236. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
  237. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  238. package/lib/tree/nodes/operators/fractionNode.js +7 -0
  239. package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
  240. package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
  241. package/lib/tree/nodes/operators/limitNode.js +7 -0
  242. package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
  243. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  244. package/lib/tree/nodes/operators/multiplyNode.js +7 -0
  245. package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
  246. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  247. package/lib/tree/nodes/operators/powerNode.js +7 -0
  248. package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
  249. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  250. package/lib/tree/nodes/operators/substractNode.js +7 -0
  251. package/lib/tree/nodes/polynomials/monomNode.d.ts +1 -0
  252. package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
  253. package/lib/tree/nodes/polynomials/monomNode.js +7 -0
  254. package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
  255. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
  256. package/lib/tree/nodes/polynomials/trinomNode.js +7 -0
  257. package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
  258. package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
  259. package/lib/tree/nodes/sets/belongsNode.js +7 -0
  260. package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
  261. package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
  262. package/lib/tree/nodes/sets/discreteSetNode.js +7 -0
  263. package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
  264. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  265. package/lib/tree/nodes/sets/intervalNode.js +7 -0
  266. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
  267. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  268. package/lib/tree/nodes/sets/unionIntervalNode.js +7 -0
  269. package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
  270. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  271. package/lib/tree/nodes/variables/variableNode.js +7 -0
  272. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
  273. package/lib/tree/utilities/nodeShuffler.js +3 -0
  274. package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
  275. package/lib/tree/utilities/nodeSimplifier.js +3 -0
  276. package/package.json +1 -1
@@ -9,6 +9,7 @@ import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
9
9
  import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { degreeParser } from "../../../../../tree/parsers/degreeParser.js";
11
11
  import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
12
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
12
13
  const getPoints = (identifiers) => {
13
14
  return identifiers.pointsIdentifiers.map(PointConstructor.fromIdentifiers);
14
15
  };
@@ -38,8 +39,92 @@ const getInstruction = (identifiers) => {
38
39
 
39
40
  Donner une mesure, arrondie au degré, de l'angle $\\widehat{${names.join("")}}$.`;
40
41
  };
41
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
42
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
42
+ const getHint = (identifiers) => {
43
+ const points = getPoints(identifiers);
44
+ const names = points.map((p) => p.name);
45
+ const [nA, nB, nC] = names;
46
+ const u = `\\overrightarrow{${nB}${nA}}`;
47
+ const v = `\\overrightarrow{${nB}${nC}}`;
48
+ return `L'angle $\\widehat{${nA}${nB}${nC}}$ est formé par les vecteurs $${u}$ et $${v}$.
49
+ Calcule leur produit scalaire puis utilise sa définition :
50
+
51
+ $$
52
+ ${u} \\cdot ${v} = \\lVert{${nB}${nA}}\\rVert \\times \\lVert{${nB}${nC}}\\rVert \\times \\cos(\\widehat{${nA}${nB}${nC}})
53
+ $$
54
+
55
+ Tu pourras alors déterminer $\\cos(\\widehat{${nA}${nB}${nC}})$ et en déduire une mesure de l'angle $\\widehat{${nA}${nB}${nC}}$.`;
56
+ };
57
+ const getCorrection = (identifiers) => {
58
+ const points = getPoints(identifiers);
59
+ const names = points.map((p) => p.name);
60
+ const u = `\\overrightarrow{${names[1]}${names[0]}}`;
61
+ const v = `\\overrightarrow{${names[1]}${names[2]}}`;
62
+ const vecURaw = VectorConstructor.fromPointsRaw(points[1], points[0]);
63
+ const vecVRaw = VectorConstructor.fromPointsRaw(points[1], points[2]);
64
+ const vecU = vecURaw.simplify();
65
+ const vecV = vecVRaw.simplify();
66
+ const nodeNormU = vecU.getNorm();
67
+ const nodeNormV = vecV.getNorm();
68
+ const nodeScalarProduct = vecU.scalarProduct(vecV);
69
+ const nodeNormUSimplified = nodeNormU.simplify();
70
+ const nodeNormVSimplified = nodeNormV.simplify();
71
+ const nodeScalarProductSimplified = nodeScalarProduct.simplify();
72
+ const angleName = `\\widehat{${names.join("")}}`;
73
+ return `D'après la définition du produit scalaire :
74
+
75
+ $$
76
+ ${u} \\cdot ${v} = \\lVert ${u} \\rVert \\times \\lVert ${v} \\rVert \\times \\cos(${angleName})
77
+ $$
78
+
79
+ Or :
80
+
81
+ $$
82
+ ${u} = ${vecURaw.toCoords()} = ${vecU.toCoords()}
83
+ $$
84
+
85
+ $$
86
+ ${v} = ${vecVRaw.toCoords()} = ${vecV.toCoords()}
87
+ $$
88
+
89
+ Ainsi :
90
+
91
+ ${alignTex([
92
+ [`${u} \\cdot ${v}`, "=", nodeScalarProduct.toTex()],
93
+ ["", "=", nodeScalarProductSimplified.toTex()],
94
+ ])}
95
+
96
+ On calcule ensuite les normes des vecteurs :
97
+
98
+ ${alignTex([
99
+ [`\\lVert ${u} \\rVert`, "=", nodeNormU.toTex()],
100
+ ["", "=", nodeNormUSimplified.toTex()],
101
+ ])}
102
+
103
+ ${alignTex([
104
+ [`\\lVert ${v} \\rVert`, "=", nodeNormV.toTex()],
105
+ ["", "=", nodeNormVSimplified.toTex()],
106
+ ])}
107
+
108
+ On remplace alors ces valeurs dans l’égalité du produit scalaire :
109
+
110
+ $$
111
+ ${nodeScalarProductSimplified.toTex()} = ${nodeNormUSimplified.toTex()} \\times ${nodeNormVSimplified.toTex()} \\times \\cos(${angleName})
112
+ $$
113
+
114
+ D’où:
115
+
116
+ $$
117
+ \\cos(${angleName}) = \\frac{${nodeScalarProductSimplified.toTex()}}{${nodeNormUSimplified.toTex()} \\times ${nodeNormVSimplified.toTex()}}
118
+ $$
119
+
120
+ Enfin, on utilise la fonction $\\cos^{-1}$ de la calculatrice pour en déduire une mesure de $${angleName}$ :
121
+
122
+ $$
123
+ ${angleName} \\approx ${getAnswer(identifiers)}
124
+ $$
125
+
126
+ `;
127
+ };
43
128
  const getKeys = () => {
44
129
  return ["degree"];
45
130
  };
@@ -70,8 +155,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
70
155
  keys: getKeys(identifiers),
71
156
  answerFormat: "tex",
72
157
  identifiers,
73
- // hint: getHint(identifiers),
74
- // correction: getCorrection(identifiers),
158
+ hint: getHint(identifiers),
159
+ correction: getCorrection(identifiers),
75
160
  };
76
161
  };
77
162
  export const angleFromScalarProduct = {
@@ -86,8 +171,9 @@ export const angleFromScalarProduct = {
86
171
  isAnswerValid,
87
172
  subject: "Mathématiques",
88
173
  getInstruction,
89
- // getHint,
90
- // getCorrection,
174
+ getHint,
175
+ getCorrection,
176
+ hasHintAndCorrection: true,
91
177
  getAnswer,
92
178
  getQuestionFromIdentifiers,
93
179
  };
@@ -2,7 +2,12 @@ export * from "./scalarProductViaCoords.js";
2
2
  export * from "./scalarProductViaCos.js";
3
3
  export * from "./scalarProductOrthoInSquare.js";
4
4
  export * from "./scalarProductViaNorms.js";
5
- export * from "./scalarProductIdentities.js";
6
5
  export * from "./angleFromScalarProduct.js";
7
6
  export * from "./findCoordinatesToOrthogonalize.js";
7
+ export * from "./scalarProductOfVectsOnGrid1.js";
8
+ export * from "./scalarProductComputeBH.js";
9
+ export * from "./scalarProductParallelogramDiagonalPlus.js";
10
+ export * from "./alg/index.js";
11
+ export * from "./orth/index.js";
12
+ export * from "./alKashi/index.js";
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6CAA6C,CAAC;AAE5D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -2,6 +2,11 @@ export * from "./scalarProductViaCoords.js";
2
2
  export * from "./scalarProductViaCos.js";
3
3
  export * from "./scalarProductOrthoInSquare.js";
4
4
  export * from "./scalarProductViaNorms.js";
5
- export * from "./scalarProductIdentities.js";
6
5
  export * from "./angleFromScalarProduct.js";
7
6
  export * from "./findCoordinatesToOrthogonalize.js";
7
+ export * from "./scalarProductOfVectsOnGrid1.js";
8
+ export * from "./scalarProductComputeBH.js";
9
+ export * from "./scalarProductParallelogramDiagonalPlus.js";
10
+ export * from "./alg/index.js";
11
+ export * from "./orth/index.js";
12
+ export * from "./alKashi/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductIsOrthogonalVecsBasisIJ.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B,CAAC;AAqNF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAsBtE,CAAC"}
1
+ {"version":3,"file":"scalarProductIsOrthogonalVecsBasisIJ.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B,CAAC;AA2NF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAsBtE,CAAC"}
@@ -123,6 +123,12 @@ $$
123
123
  ${i} \\cdot ${j} = ${j} \\cdot ${i} = 0
124
124
  $$
125
125
 
126
+ On a :
127
+
128
+ $$
129
+ ${i} \\cdot ${i} = ${j} \\cdot ${j} = 1
130
+ $$
131
+
126
132
  On peut donc calculer le produit scalaire en utilisant les coordonnées dans la base $(${i},${j})$ de la même manière que lorsque l'on travaille dans la base canonique du plan.
127
133
 
128
134
  ${alignTex([
@@ -27,7 +27,7 @@ $$
27
27
  ${v} = ${vecV.toCoords()}
28
28
  $$
29
29
 
30
- Les vecteurs $u$ et $v$ sont-ils orthogonaux ?`;
30
+ Les vecteurs $${u}$ et $${v}$ sont-ils orthogonaux ?`;
31
31
  };
32
32
  const getAnswerNode = (identifiers) => {
33
33
  const { vecU, vecV } = getHydrated(identifiers);
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductIsPointOnCircle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAYvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA8LF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAmB9D,CAAC"}
1
+ {"version":3,"file":"scalarProductIsPointOnCircle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAYvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA4MF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAmB9D,CAAC"}
@@ -54,9 +54,12 @@ const getAnswer = (identifiers) => {
54
54
  const isOrthogonal = answerNode.simplify().evaluate() === 0;
55
55
  return ["Oui", "Non"][isOrthogonal ? 0 : 1];
56
56
  };
57
- const getHint = () => {
58
- const [a, b] = ["a", "b"].map((letter) => `\\overrightarrow{${letter}}`);
59
- return `Deux vecteurs $${a}$ et $${b}$ sont orthogonaux si et seulement si $${a} \\cdot ${b} = 0$.`;
57
+ const getHint = (identifiers) => {
58
+ const { pointNames } = identifiers;
59
+ const [nA, nB, nC] = pointNames;
60
+ const [vecAB, vecAC] = [`${nA}${nB}`, `${nA}${nC}`].map((letter) => `\\overrightarrow{${letter}}`);
61
+ return `Un point $${nA}$ appartient à un cercle de diamètre $[${nB}${nC}]$ si et seulement si le triangle $${nA}${nB}${nC}$ est rectangle en $${nA}$,
62
+ donc si et seulement si les vecteurs $${vecAB}$ et $${vecAC}$ sont orthogonaux.`;
60
63
  };
61
64
  const getCorrection = (identifiers) => {
62
65
  const { pointNames } = identifiers;
@@ -72,7 +75,14 @@ const getCorrection = (identifiers) => {
72
75
  const vecComputationV = createVecComputation(point1, point3);
73
76
  const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
74
77
  const nodeScalarProduct = vecU.scalarProduct(vecV);
75
- return `On calcule les coordonnées des vecteurs :
78
+ return `${(() => {
79
+ const [nA, nB, nC] = pointNames;
80
+ const [vecAB, vecAC] = [`${nA}${nB}`, `${nA}${nC}`].map((letter) => `\\overrightarrow{${letter}}`);
81
+ return `Le point $${nA}$ appartient au cercle de diamètre $[${nB}${nC}]$ si et seulement si le triangle $${nA}${nB}${nC}$ est rectangle en $${nA}$,
82
+ donc si et seulement si les vecteurs $${vecAB}$ et $${vecAC}$ sont orthogonaux.`;
83
+ })()}
84
+
85
+ On calcule les coordonnées des vecteurs :
76
86
 
77
87
  ${zip([vecComputationU, vecComputationV], [vecU, vecV]).map(([vecComputation, vec]) => `
78
88
 
@@ -150,7 +160,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
150
160
  export const scalarProductIsPointOnCircle = {
151
161
  id: "scalarProductIsPointOnCircle",
152
162
  connector: "=",
153
- label: "Déterminer si un point appartient ou non à un cercle de diamètre donné",
163
+ label: "Déterminer si un point appartient ou non à un cercle de diamètre donné à l'aide du produit scalaire",
154
164
  isSingleStep: true,
155
165
  generator: (nb) => getDistinctQuestions(() => getScalarProductIsPointOnCircleQuestion(), nb),
156
166
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductIsPointOnPerpendicularBisector.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAavC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAmNF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAAC,WAAW,CAsB3E,CAAC"}
1
+ {"version":3,"file":"scalarProductIsPointOnPerpendicularBisector.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAavC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA2NF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAAC,WAAW,CAuB3E,CAAC"}
@@ -53,9 +53,13 @@ const getAnswer = (identifiers) => {
53
53
  const isOrthogonal = answerNode.simplify().evaluate() === 0;
54
54
  return ["Oui", "Non"][isOrthogonal ? 0 : 1];
55
55
  };
56
- const getHint = () => {
57
- const [a, b] = ["a", "b"].map((letter) => `\\overrightarrow{${letter}}`);
58
- return `Deux vecteurs $${a}$ et $${b}$ sont orthogonaux si et seulement si $${a} \\cdot ${b} = 0$.`;
56
+ const getHint = (identifiers) => {
57
+ const { pointNames } = identifiers;
58
+ const [nA, nB, nC] = pointNames;
59
+ const [vecCI, vecAB] = [`${nC}I`, `${nA}${nB}`].map((letter) => `\\overrightarrow{${letter}}`);
60
+ return `La médiatrice du segment $[${nA}${nB}]$ est la droite passant par le milieu $I$ de $[${nA}${nB}]$ et qui est perpendiculaire à $(${nA}${nB})$.
61
+ Un point $${nC}$ appartient donc à cette médiatrice si et seulement si $(${nC}I)$ est perpendiculaire à $(${nA}${nB})$,
62
+ c'est à dire si les vecteurs $${vecCI}$ et $${vecAB}$ sont orthognaux.`;
59
63
  };
60
64
  const getCorrection = (identifiers) => {
61
65
  const { pointNames, pointIds } = identifiers;
@@ -73,17 +77,17 @@ const getCorrection = (identifiers) => {
73
77
  const vecComputationV = createVecComputation(pointI, point3);
74
78
  const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
75
79
  const nodeScalarProduct = vecU.scalarProduct(vecV);
76
- return `On nomme $O$ l'origine du repère et $I$ le milieu de $[${point1.name}${point2.name}]$. On a :
80
+ return `${(() => {
81
+ const [nA, nB, nC] = pointNames;
82
+ const [vecCI, vecAB] = [`${nC}I`, `${nA}${nB}`].map((letter) => `\\overrightarrow{${letter}}`);
83
+ return `La médiatrice du segment $[${nA}${nB}]$ est la droite passant par le milieu $I$ de $[${nA}${nB}]$ et qui est perpendiculaire à $(${nA}${nB})$.
84
+ Le point $${nC}$ appartient donc à cette médiatrice si et seulement si $(${nC}I)$ est perpendiculaire à $(${nA}${nB})$,
85
+ c'est à dire si les vecteurs $${vecCI}$ et $${vecAB}$ sont orthognaux.`;
86
+ })()}
87
+
88
+ On détermine les coordonnées du milieu $I$ de $[${point1.name}${point2.name}]$ :
77
89
 
78
- ${alignTex([
79
- [
80
- "\\overrightarrow{OI}",
81
- "=",
82
- `\\frac{\\overrightarrow{O${point1.name}} + \\overrightarrow{O${point2.name}}}{2}`,
83
- ],
84
- ["", "=", `${vecOI.toCoords()}`],
85
- ["", "=", `${vecOI.simplify().toCoords()}`],
86
- ])}
90
+ ${alignTex([[`I${vecOI.toCoords()}`], [`I${vecOI.simplify().toCoords()}`]])}
87
91
 
88
92
  On peut calculer les coordonnées des vecteurs :
89
93
 
@@ -163,7 +167,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
163
167
  export const scalarProductIsPointOnPerpendicularBisector = {
164
168
  id: "scalarProductIsPointOnPerpendicularBisector",
165
169
  connector: "=",
166
- label: "Déterminer si un point appartient à la médiatrice d'un segment",
170
+ label: "Déterminer si un point appartient à la médiatrice d'un segment à l'aide du produit scalaire",
167
171
  isSingleStep: true,
168
172
  generator: (nb) => getDistinctQuestions(() => getScalarProductIsPointOnPerpendicularBisectorQuestion(), nb),
169
173
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductIsRightTriangleUsingPointCoords.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAYvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAiQF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAuB5E,CAAC"}
1
+ {"version":3,"file":"scalarProductIsRightTriangleUsingPointCoords.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAYvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA+QF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAuB5E,CAAC"}
@@ -61,9 +61,12 @@ const getAnswer = (identifiers) => {
61
61
  const isOrthogonal = answerNode.simplify().evaluate() === 0;
62
62
  return ["Oui", "Non"][isOrthogonal ? 0 : 1];
63
63
  };
64
- const getHint = () => {
65
- const [a, b] = ["a", "b"].map((letter) => `\\overrightarrow{${letter}}`);
66
- return `Deux vecteurs $${a}$ et $${b}$ sont orthogonaux si et seulement si $${a} \\cdot ${b} = 0$.`;
64
+ const getHint = (identifiers) => {
65
+ const { pointNames } = identifiers;
66
+ const [nA, nB, nC] = pointNames;
67
+ const [vecAB, vecBC] = [`${nA}${nB}`, `${nB}${nC}`].map((letter) => `\\overrightarrow{${letter}}`);
68
+ return `Un triangle $${nA}${nB}${nC}$ est rectangle en $${nB}$ si et seulement si les droites $(${nA}${nB})$ et $(${nB}${nC})$ sont perpendiculaires,
69
+ donc si et seulement si les vecteurs $${vecAB}$ et $${vecBC}$ sont orthognaux.`;
67
70
  };
68
71
  const getCorrection = (identifiers) => {
69
72
  const { pointNames } = identifiers;
@@ -79,7 +82,14 @@ const getCorrection = (identifiers) => {
79
82
  const vecComputationV = createVecComputation(point1, point3);
80
83
  const vecComputationW = createVecComputation(point2, point3);
81
84
  const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
82
- return `On calcule les coordonnées des vecteurs :
85
+ return `${(() => {
86
+ const [nA, nB, nC] = pointNames;
87
+ const [vecAB, vecBC] = [`${nA}${nB}`, `${nB}${nC}`].map((letter) => `\\overrightarrow{${letter}}`);
88
+ return `Le triangle $${nA}${nB}${nC}$ est rectangle en $${nB}$ si et seulement si les droites $(${nA}${nB})$ et $(${nB}${nC})$ sont perpendiculaires,
89
+ donc si et seulement si les vecteurs $${vecAB}$ et $${vecBC}$ sont orthognaux.`;
90
+ })()}
91
+
92
+ On calcule les coordonnées des vecteurs :
83
93
 
84
94
  ${zip([vecComputationU, vecComputationV, vecComputationW], [vecU, vecV, vecW]).map(([vecComputation, vec]) => `
85
95
 
@@ -218,7 +228,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
218
228
  export const scalarProductIsRightTriangleUsingPointCoords = {
219
229
  id: "scalarProductIsRightTriangleUsingPointCoords",
220
230
  connector: "=",
221
- label: "Déterminer si un triangle est rectangle à partir des coordonnées de ses sommets",
231
+ label: "Déterminer si un triangle est rectangle à partir des coordonnées de ses sommets à l'aide du produit scalaire",
222
232
  isSingleStep: true,
223
233
  generator: (nb) => getDistinctQuestions(() => getScalarProductIsRightTriangleUsingPointCoordsQuestion(), nb),
224
234
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductComputeBH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAoBtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AA+bF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AA+BF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA6BjE,CAAC"}
1
+ {"version":3,"file":"scalarProductComputeBH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAqBtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAmeF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AA+BF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA6BjE,CAAC"}
@@ -9,6 +9,7 @@ import { Segment } from "../../../../../math/geometry/segment.js";
9
9
  import { Triangle } from "../../../../../math/geometry/triangles/triangle.js";
10
10
  import { VectorConstructor } from "../../../../../math/geometry/vector.js";
11
11
  import { randint } from "../../../../../math/utils/random/randint.js";
12
+ import { round } from "../../../../../math/utils/round.js";
12
13
  import { abs } from "../../../../../tree/nodes/functions/absNode.js";
13
14
  import { add } from "../../../../../tree/nodes/operators/addNode.js";
14
15
  import { frac, isFractionNode, } from "../../../../../tree/nodes/operators/fractionNode.js";
@@ -56,6 +57,7 @@ const getCorrection = (identifiers) => {
56
57
  const nodeLengthBC = vecBC.getNorm();
57
58
  const vecBA = VectorConstructor.fromPoints(pointB, pointA);
58
59
  const nodeScalarProduct = vecBA.scalarProduct(vecBC);
60
+ const isScalarProductPositive = nodeScalarProduct.evaluate() > 0;
59
61
  return `Dans $BAC$, $H$ est le pied de la hauteur issue de $A$.
60
62
 
61
63
  Autrement dit, $H$ est le projeté orthogonal de $A$ sur $(BC)$.
@@ -66,20 +68,42 @@ $$
66
68
  \\overrightarrow{BA} \\cdot \\overrightarrow{BC} = \\overrightarrow{BH} \\cdot \\overrightarrow{BC}
67
69
  $$
68
70
 
69
- Or, puisque $B$,$C$ et $H$ sont alignés :
71
+ ${(() => {
72
+ if (isScalarProductPositive) {
73
+ return `Or, puisque $\\overrightarrow{BH}$ et $\\overrightarrow{BC}$ sont colinéaires et de même sens :
70
74
 
71
75
  $$
72
- \\lvert \\overrightarrow{BH} \\cdot \\overrightarrow{BC} \\rvert = BH \\times BC
76
+ \\overrightarrow{BH} \\cdot \\overrightarrow{BC} = BH \\times BC
73
77
  $$
74
78
 
75
79
  On a donc :
76
80
 
77
81
  $$
78
- BH = \\frac{\\lvert \\overrightarrow{BA} \\cdot \\overrightarrow{BC} \\rvert}{BC}
82
+ BH = \\frac{\\overrightarrow{BA} \\cdot \\overrightarrow{BC}}{BC}
79
83
  $$
80
84
 
85
+ `;
86
+ }
87
+ else {
88
+ return `Or, puisque $\\overrightarrow{BH}$ et $\\overrightarrow{BC}$ sont colinéaires et de sens opposés :
89
+
90
+ $$
91
+ \\overrightarrow{BH} \\cdot \\overrightarrow{BC} = - BH \\times BC
92
+ $$
93
+
94
+ On a donc :
95
+
96
+ $$
97
+ BH = \\frac{- \\overrightarrow{BA} \\cdot \\overrightarrow{BC}}{BC}
98
+ $$
99
+
100
+ `;
101
+ }
102
+ })()}
81
103
  Application numérique :
82
104
 
105
+ On calcule donc le produit scalaire $\\overrightarrow{BA} \\cdot \\overrightarrow{BC}$ :
106
+
83
107
  $$
84
108
  \\overrightarrow{BA} = ${vecBA.toCoords()}
85
109
  $$
@@ -92,10 +116,14 @@ $$
92
116
  \\overrightarrow{BA} \\cdot \\overrightarrow{BC} = ${nodeScalarProduct.toTex()}
93
117
  $$
94
118
 
119
+ Puis on calcule la longueur $BC$ :
120
+
95
121
  $$
96
122
  BC = ${nodeLengthBC.toTex()}
97
123
  $$
98
124
 
125
+ On a donc :
126
+
99
127
  $$
100
128
  BH = ${getAnswer(identifiers)}
101
129
  $$
@@ -207,7 +235,13 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
207
235
  try {
208
236
  const nodeAns = parseAlgebraic(ans);
209
237
  const nodeAnswer = getAnswerNode(identifiers);
210
- return substract(nodeAns, nodeAnswer).simplify().evaluate() === 0;
238
+ const isValidExact = () => {
239
+ return substract(nodeAns, nodeAnswer).simplify().evaluate() === 0;
240
+ };
241
+ const isValidRounded = (precision) => {
242
+ return nodeAns.evaluate() - round(nodeAnswer.evaluate(), precision) === 0;
243
+ };
244
+ return isValidExact() || isValidRounded(2);
211
245
  }
212
246
  catch (err) {
213
247
  return handleVEAError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductOfVectsOnGrid1.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAWvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAiYF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyBtE,CAAC"}
1
+ {"version":3,"file":"scalarProductOfVectsOnGrid1.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAWvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmcF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyBtE,CAAC"}