math-exercises 3.0.177 → 3.0.179

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 (255) hide show
  1. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
  2. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
  3. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
  4. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
  5. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
  6. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
  7. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
  8. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
  9. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
  10. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
  11. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
  12. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
  13. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
  14. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
  15. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
  16. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
  17. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
  18. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
  19. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
  20. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
  21. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
  22. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
  23. package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
  24. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
  25. package/lib/exercises/math/derivation/problems/index.js +4 -0
  26. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
  27. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
  28. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
  29. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
  30. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
  31. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
  32. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
  33. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
  35. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
  36. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
  38. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
  39. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
  41. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
  42. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
  44. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
  45. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
  47. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
  48. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
  50. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
  51. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
  53. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
  54. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
  56. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
  57. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
  59. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
  60. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
  62. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
  63. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
  64. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
  65. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
  66. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
  68. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
  69. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
  71. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
  72. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
  74. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
  75. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
  77. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +1 -1
  78. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
  79. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
  80. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
  81. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
  82. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
  83. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
  84. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
  85. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
  86. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
  87. package/lib/exercises/math/functions/composition/index.d.ts +0 -1
  88. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
  89. package/lib/exercises/math/functions/composition/index.js +1 -1
  90. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
  91. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
  93. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +1 -0
  94. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/trinoms/sign/index.js +1 -0
  96. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts +8 -0
  97. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -0
  98. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +226 -0
  99. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +10 -10
  101. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +8 -8
  102. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +6 -6
  103. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +8 -8
  104. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +1 -1
  105. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +2 -2
  106. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +2 -2
  107. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  108. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
  109. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
  110. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
  111. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
  112. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
  113. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  114. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
  115. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
  116. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
  117. package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
  118. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
  119. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
  120. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
  121. package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
  122. package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
  123. package/lib/exercises/math/probaStat/conditional/index.js +4 -0
  124. package/lib/exercises/math/probaStat/index.d.ts +1 -2
  125. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  126. package/lib/exercises/math/probaStat/index.js +1 -2
  127. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
  128. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
  130. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  131. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
  132. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  133. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
  134. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  135. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
  136. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  137. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
  138. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
  139. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
  140. package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
  141. package/lib/exercises/math/python/index.d.ts +1 -0
  142. package/lib/exercises/math/python/index.d.ts.map +1 -1
  143. package/lib/exercises/math/python/index.js +1 -0
  144. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -1
  145. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +11 -8
  146. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  147. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +4 -3
  148. package/lib/exercises/math/sequences/arithmetic/index.d.ts +4 -3
  149. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  150. package/lib/exercises/math/sequences/arithmetic/index.js +4 -3
  151. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -1
  152. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +3 -2
  153. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  154. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +8 -6
  155. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
  156. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +6 -5
  157. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +0 -2
  158. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
  159. package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
  160. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +1 -0
  161. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -1
  162. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +65 -14
  163. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +0 -1
  164. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -1
  165. package/lib/exercises/math/sequences/arithmetic/sum/index.js +1 -1
  166. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
  167. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  168. package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
  169. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts +14 -0
  170. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -0
  171. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +291 -0
  172. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  173. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +4 -3
  174. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts +15 -0
  175. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  176. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +249 -0
  177. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +2 -2
  178. package/lib/exercises/math/sequences/geometric/index.d.ts +3 -2
  179. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  180. package/lib/exercises/math/sequences/geometric/index.js +6 -2
  181. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
  182. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +3 -2
  183. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +1 -1
  184. package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
  185. package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
  186. package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
  187. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +2 -2
  188. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +2 -2
  189. package/lib/exercises/math/sequences/index.d.ts +1 -0
  190. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  191. package/lib/exercises/math/sequences/index.js +1 -0
  192. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
  193. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  194. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
  195. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -1
  196. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +5 -9
  197. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +1 -1
  198. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
  199. package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
  200. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
  201. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
  202. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
  203. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
  204. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +2 -2
  205. package/lib/exercises/pc/snellDescartes.js +2 -2
  206. package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
  207. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
  208. package/lib/exercises/vea/polynomialVEA.js +17 -0
  209. package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
  210. package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
  211. package/lib/exercises/vea/valueTableVEA.js +12 -0
  212. package/lib/index.d.ts +152 -41
  213. package/lib/index.d.ts.map +1 -1
  214. package/lib/latexTester.d.ts.map +1 -1
  215. package/lib/latexTester.js +9 -6
  216. package/lib/math/polynomials/affine.d.ts +1 -0
  217. package/lib/math/polynomials/affine.d.ts.map +1 -1
  218. package/lib/math/polynomials/affine.js +5 -0
  219. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  220. package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
  221. package/lib/math/utils/functions/functionComposition.js +18 -1
  222. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
  223. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
  224. package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
  225. package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
  226. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
  227. package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
  228. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +18 -4
  229. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  230. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +434 -333
  231. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
  232. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +3 -1
  233. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +5 -0
  234. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
  235. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +58 -25
  236. package/lib/prototypesEnhancement.d.ts +1 -0
  237. package/lib/prototypesEnhancement.d.ts.map +1 -1
  238. package/lib/prototypesEnhancement.js +3 -0
  239. package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
  240. package/lib/tests/pdfs/mdCodeToLatex.js +8 -15
  241. package/lib/tests/questionTest.d.ts.map +1 -1
  242. package/lib/tests/questionTest.js +6 -3
  243. package/lib/tree/nodes/geometry/degree.js +1 -1
  244. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  245. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  246. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  247. package/lib/tree/nodes/operators/substractNode.js +2 -1
  248. package/lib/tree/parsers/degreeParser.js +2 -2
  249. package/lib/tree/utilities/nodeUtils.d.ts +6 -0
  250. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
  251. package/lib/tree/utilities/nodeUtils.js +24 -0
  252. package/lib/utils/strings/prependArticle.d.ts +2 -0
  253. package/lib/utils/strings/prependArticle.d.ts.map +1 -0
  254. package/lib/utils/strings/prependArticle.js +1 -0
  255. package/package.json +1 -1
@@ -0,0 +1,226 @@
1
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
2
+ import { signTableVEA } from "../../../../../exercises/vea/signTableVEA.js";
3
+ import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
5
+ import { firstDegreeInequationResolutionTex } from "../../../../../tree/nodes/inequations/inequationNode.js";
6
+ import { MinusInfinityNode, PlusInfinityNode, } from "../../../../../tree/nodes/numbers/infiniteNode.js";
7
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { ClosureType } from "../../../../../tree/nodes/sets/closure.js";
9
+ import { IntervalNode } from "../../../../../tree/nodes/sets/intervalNode.js";
10
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
11
+ const getAnswerTable = (identifiers) => {
12
+ const fcts = buildFcts(identifiers);
13
+ const roots = [
14
+ fcts.affine.getRoot().toTree(),
15
+ ...fcts.trinom.getRootsNode(),
16
+ ].sort((a, b) => a.evaluate() - b.evaluate());
17
+ const affineRootIndex = roots.findIndex((r) => r.evaluate() === fcts.affine.getRoot().toTree().evaluate());
18
+ const startAffSign = fcts.affine.a > 0 ? "-" : "+";
19
+ const endAffSign = startAffSign === "+" ? "-" : "+";
20
+ const trinomSigns = fcts.trinom.a > 0 ? ["+", "-", "+"] : ["-", "+", "-"];
21
+ const partial = [
22
+ [
23
+ "$x$",
24
+ "-\\infty",
25
+ "\\ ",
26
+ roots[0].toTex(),
27
+ "\\ ",
28
+ roots[1].toTex(),
29
+ "\\ ",
30
+ roots[2].toTex(),
31
+ "\\ ",
32
+ "+\\infty",
33
+ ],
34
+ [
35
+ `$${fcts.affine.toTree().toTex()}$`,
36
+ "\\ ",
37
+ startAffSign,
38
+ affineRootIndex === 0 ? "0" : startAffSign,
39
+ affineRootIndex === 0 ? endAffSign : startAffSign,
40
+ affineRootIndex === 1
41
+ ? "0"
42
+ : affineRootIndex === 0
43
+ ? endAffSign
44
+ : startAffSign,
45
+ affineRootIndex < 2 ? endAffSign : startAffSign,
46
+ affineRootIndex === 2 ? "0" : endAffSign,
47
+ endAffSign,
48
+ "\\ ",
49
+ ],
50
+ [
51
+ `$${fcts.trinom.toTree().toTex()}$`,
52
+ "\\ ",
53
+ trinomSigns[0],
54
+ affineRootIndex === 0 ? trinomSigns[0] : "0",
55
+ affineRootIndex === 0 ? trinomSigns[0] : trinomSigns[1],
56
+ affineRootIndex === 1 ? trinomSigns[1] : "0",
57
+ affineRootIndex === 2 ? trinomSigns[2] : trinomSigns[1],
58
+ affineRootIndex === 2 ? trinomSigns[2] : "0",
59
+ trinomSigns[2],
60
+ "\\ ",
61
+ ],
62
+ ];
63
+ const buildSign = (sign1, sign2) => {
64
+ if (sign1 === sign2)
65
+ return "+";
66
+ return "-";
67
+ };
68
+ const thirdLine = [
69
+ `$f(x)$`,
70
+ "\\ ",
71
+ buildSign(partial[1][2], partial[2][2]),
72
+ "0",
73
+ buildSign(partial[1][4], partial[2][4]),
74
+ "0",
75
+ buildSign(partial[1][6], partial[2][6]),
76
+ "0",
77
+ buildSign(partial[1][8], partial[2][8]),
78
+ "\\ ",
79
+ ];
80
+ return [...partial, thirdLine];
81
+ };
82
+ const buildFcts = (identifiers) => {
83
+ const { affineCoeffs, trinomCoeffs } = identifiers;
84
+ const affine = new Affine(affineCoeffs[1], affineCoeffs[0]);
85
+ const trinom = new Trinom(trinomCoeffs[2], trinomCoeffs[1], trinomCoeffs[0]);
86
+ return { affine, trinom };
87
+ };
88
+ const getInstruction = (identifiers) => {
89
+ const fcts = buildFcts(identifiers);
90
+ return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
91
+
92
+ $$
93
+ f(x) = ${multiply(fcts.affine.toTree(), fcts.trinom.toTree()).toTex()}
94
+ $$
95
+
96
+ Dresser le tableau de signes de $f$.`;
97
+ };
98
+ const getHint = () => {
99
+ return `$f(x)$ est un produit de deux fonctions : une fonction affine $g$ et une fonction polynôme du second degré $h$.
100
+
101
+ Détermine le signe de la fonction affine en résolvant l'inéquation $g(x)\\geq 0$.
102
+
103
+ Puis détermine le signe de la fonction polynôme du second degré $h$ en trouvant ses racines.
104
+
105
+ Enfin, entre tes résultats dans le tableau. Le signe de $f(x)$ s'obtiendra alors en utilisant la règle des signes.`;
106
+ };
107
+ const getCorrection = (identifiers) => {
108
+ const fcts = buildFcts(identifiers);
109
+ const trinomRoots = fcts.trinom.getRootsNode();
110
+ const affRoot = fcts.affine.getRoot().toTree();
111
+ const allRoots = [affRoot, ...trinomRoots].sort((a, b) => a.evaluate() - b.evaluate());
112
+ const firstSign = fcts.affine.a * fcts.trinom.a > 0 ? "négative" : "positive";
113
+ const alternateSign = fcts.affine.a * fcts.trinom.a > 0 ? "positive" : "négative";
114
+ return `On commence par déterminer le signe de $${fcts.affine
115
+ .toTree()
116
+ .toTex()}$ :
117
+
118
+ $$
119
+ ${firstDegreeInequationResolutionTex(fcts.affine, "\\ge", (0).toTree())}
120
+ $$
121
+
122
+ Puis, on détermine le signe de $${fcts.trinom
123
+ .toTree()
124
+ .toTex()}$. Pour cela, on calcule ses racines. On trouve $\\Delta = ${fcts.trinom
125
+ .getDeltaNode()
126
+ .toTex()}$, donc cette fonction admet deux racines :
127
+
128
+ $$
129
+ x_1 = ${trinomRoots[0].toTex()}
130
+ $$
131
+
132
+ et
133
+
134
+ $$
135
+ x_2 = ${trinomRoots[1].toTex()}
136
+ $$
137
+
138
+ Cette fonction est donc ${fcts.trinom.a > 0 ? "négative" : "positive"} sur $${new IntervalNode(trinomRoots[0], trinomRoots[1], ClosureType.FF).toTex()}$, et ${fcts.trinom.a > 0 ? "positive" : "négative"} sur le reste de $\\mathbb{R}$.
139
+
140
+ On note toutes ces informations dans un tableau de signes. On applique enfin la règle des signes pour trouver le signe de $f$.
141
+
142
+ On en conclut que $f$ est ${firstSign} sur $${new IntervalNode(MinusInfinityNode, allRoots[0], ClosureType.OF).toTex()}$ et sur $${new IntervalNode(allRoots[1], allRoots[2], ClosureType.FF).toTex()}$, et elle est ${alternateSign} sur $${new IntervalNode(allRoots[0], allRoots[1], ClosureType.FF).toTex()}$ et sur $${new IntervalNode(allRoots[2], PlusInfinityNode, ClosureType.FO).toTex()}$.`;
143
+ };
144
+ const getKeys = () => {
145
+ return ["infty"];
146
+ };
147
+ const isAnswerTableValid = (ans, { answerTable }) => {
148
+ try {
149
+ return signTableVEA(ans, answerTable);
150
+ }
151
+ catch (err) {
152
+ return handleVEAError(err);
153
+ }
154
+ };
155
+ const getSignOfProductOfAffineAndTrinomQuestion = () => {
156
+ let affine;
157
+ let trinom;
158
+ do {
159
+ affine = AffineConstructor.randomNiceRoot();
160
+ trinom = TrinomConstructor.randomNiceRoots(2);
161
+ } while (trinom
162
+ .getRootsNode()
163
+ .some((root) => root.evaluate() === affine.getRoot().toTree().evaluate()));
164
+ const identifiers = {
165
+ affineCoeffs: affine.coefficients,
166
+ trinomCoeffs: trinom.coefficients,
167
+ };
168
+ return getQuestionFromIdentifiers(identifiers);
169
+ };
170
+ const getQuestionFromIdentifiers = (identifiers) => {
171
+ const fcts = buildFcts(identifiers);
172
+ return {
173
+ answerTable: getAnswerTable(identifiers),
174
+ instruction: getInstruction(identifiers),
175
+ keys: getKeys(identifiers),
176
+ answerFormat: "tex",
177
+ identifiers,
178
+ hint: getHint(identifiers),
179
+ correction: getCorrection(identifiers),
180
+ initTable: [
181
+ ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", "", "\\ ", ""],
182
+ [
183
+ `$${fcts.affine.toTree().toTex()}$`,
184
+ "\\ ",
185
+ "",
186
+ "",
187
+ "",
188
+ "",
189
+ "",
190
+ "",
191
+ "",
192
+ "\\ ",
193
+ ],
194
+ [
195
+ `$${fcts.trinom.toTree().toTex()}$`,
196
+ "\\ ",
197
+ "",
198
+ "",
199
+ "",
200
+ "",
201
+ "",
202
+ "",
203
+ "",
204
+ "\\ ",
205
+ ],
206
+ [`$f(x)$`, "\\ ", "", "", "", "", "", "", "", "\\ "],
207
+ ],
208
+ };
209
+ };
210
+ export const signOfProductOfAffineAndTrinom = {
211
+ id: "signOfProductOfAffineAndTrinom",
212
+ label: "Dresser le tableau de signes du produit d'une fonction affine et d'une fonction polynôme du second degré",
213
+ isSingleStep: true,
214
+ generator: (nb, opts) => getDistinctQuestions(() => getSignOfProductOfAffineAndTrinomQuestion(opts), nb),
215
+ qcmTimer: 60,
216
+ freeTimer: 60,
217
+ isAnswerTableValid,
218
+ subject: "Mathématiques",
219
+ getInstruction,
220
+ getHint,
221
+ getCorrection,
222
+ getAnswerTable,
223
+ getQuestionFromIdentifiers,
224
+ hasHintAndCorrection: true,
225
+ answerType: "signTable",
226
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"parallelogramFourthAngle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/parallelogramFourthAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4FF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
1
+ {"version":3,"file":"parallelogramFourthAngle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/parallelogramFourthAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
@@ -6,21 +6,21 @@ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
6
6
  const getPropositions = (n, { answer, singleAngle, doubleAngle }) => {
7
7
  const propositions = [];
8
8
  addValidProp(propositions, answer);
9
- tryToAddWrongProp(propositions, `${singleAngle}^{\\circ}`);
10
- tryToAddWrongProp(propositions, `${doubleAngle}^{\\circ}`);
11
- tryToAddWrongProp(propositions, `${360 - singleAngle}^{\\circ}`);
12
- tryToAddWrongProp(propositions, `${360 - doubleAngle}^{\\circ}`);
13
- tryToAddWrongProp(propositions, `${360 - singleAngle - doubleAngle}^{\\circ}`);
14
- tryToAddWrongProp(propositions, `${Math.abs(180 - 2 * singleAngle - doubleAngle)}^{\\circ}`);
9
+ tryToAddWrongProp(propositions, `${singleAngle}^\\circ`);
10
+ tryToAddWrongProp(propositions, `${doubleAngle}^\\circ`);
11
+ tryToAddWrongProp(propositions, `${360 - singleAngle}^\\circ`);
12
+ tryToAddWrongProp(propositions, `${360 - doubleAngle}^\\circ`);
13
+ tryToAddWrongProp(propositions, `${360 - singleAngle - doubleAngle}^\\circ`);
14
+ tryToAddWrongProp(propositions, `${Math.abs(180 - 2 * singleAngle - doubleAngle)}^\\circ`);
15
15
  return shuffleProps(propositions, n);
16
16
  };
17
17
  const getAnswer = (identifiers) => {
18
18
  const { singleAngle, doubleAngle } = identifiers;
19
19
  const fourthAngle = 360 - singleAngle - 2 * doubleAngle;
20
- return `${fourthAngle}^{\\circ}`;
20
+ return `${fourthAngle}^\\circ`;
21
21
  };
22
22
  const getInstruction = (identifiers) => {
23
- return `Un parallélogramme a deux angles de mesure $${identifiers.doubleAngle}^{\\circ}$ et un angle de mesure $${identifiers.singleAngle}^{\\circ}$.
23
+ return `Un parallélogramme a deux angles de mesure $${identifiers.doubleAngle}^\\circ$ et un angle de mesure $${identifiers.singleAngle}^\\circ$.
24
24
 
25
25
  Quelle est la mesure de son quatrième angle ?`;
26
26
  };
@@ -33,13 +33,13 @@ const getCorrection = (identifiers) => {
33
33
  return `La somme des angles d'un parallélogramme est égale à $360°$. Ici, la somme des trois angles connus vaut :
34
34
 
35
35
  $$
36
- ${singleAngle}^{\\circ} + 2\\times ${doubleAngle}^{\\circ} = ${sum}^{\\circ}
36
+ ${singleAngle}^\\circ + 2\\times ${doubleAngle}^\\circ = ${sum}^\\circ
37
37
  $$
38
38
 
39
39
  Le quatrième angle vaut donc :
40
40
 
41
41
  $$
42
- 360^{\\circ} - ${sum}^{\\circ} = ${singleAngle} ^{\\circ}
42
+ 360^\\circ - ${sum}^\\circ = ${singleAngle} ^\\circ
43
43
  $$`;
44
44
  };
45
45
  const isAnswerValid = (ans, { answer }) => {
@@ -12,11 +12,11 @@ const getPropositions = (n, { answer, ...identifiers }) => {
12
12
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
13
13
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
14
14
  addValidProp(propositions, answer);
15
- tryToAddWrongProp(propositions, "180^{\\circ}");
16
- tryToAddWrongProp(propositions, (180 - value).frenchify() + "^{\\circ}");
17
- tryToAddWrongProp(propositions, value.frenchify() + "^{\\circ}");
15
+ tryToAddWrongProp(propositions, "180^\\circ");
16
+ tryToAddWrongProp(propositions, (180 - value).frenchify() + "^\\circ");
17
+ tryToAddWrongProp(propositions, value.frenchify() + "^\\circ");
18
18
  propWhile(propositions, n, () => {
19
- tryToAddWrongProp(propositions, randint(20, 160) + "^{\\circ}");
19
+ tryToAddWrongProp(propositions, randint(20, 160) + "^\\circ");
20
20
  });
21
21
  return shuffleProps(propositions, n);
22
22
  };
@@ -24,19 +24,19 @@ const getAnswer = (identifiers) => {
24
24
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
25
25
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
26
26
  const isOpposite = identifiers.askedAngleIndex === (identifiers.givenAngleIndex + 2) % 4;
27
- return (isOpposite ? value : 180 - value).frenchify() + "^{\\circ}";
27
+ return (isOpposite ? value : 180 - value).frenchify() + "^\\circ";
28
28
  };
29
29
  const getInstruction = (identifiers) => {
30
30
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
31
31
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
32
32
  return `On considère le parallélogramme $ABCD$ ci-dessous.
33
33
 
34
- L'angle $${para.angles[identifiers.givenAngleIndex].toTex()}$ vaut $${value}^{\\circ}$.
34
+ L'angle $${para.angles[identifiers.givenAngleIndex].toTex()}$ vaut $${value}^\\circ$.
35
35
 
36
36
  Que vaut l'angle $${para.angles[identifiers.askedAngleIndex].toTex()}$ ?`;
37
37
  };
38
38
  const getHint = () => {
39
- return "Dans un parallélogramme, la somme totale des angles vaut $360^{\\circ}$. Les angles opposés sont égaux, et la somme de deux angles consécutifs est égale à $180^{\\circ}$.";
39
+ return "Dans un parallélogramme, la somme totale des angles vaut $360^\\circ$. Les angles opposés sont égaux, et la somme de deux angles consécutifs est égale à $180^\\circ$.";
40
40
  };
41
41
  const getCorrection = (identifiers) => {
42
42
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
@@ -51,7 +51,7 @@ On a donc :
51
51
  $$
52
52
  ${askedAngle.toTex()} = ${getAnswer(identifiers)}
53
53
  $$`
54
- : `Dans un parallélogramme, la somme de deux angles consécutifs vaut $180^{\\circ}$.
54
+ : `Dans un parallélogramme, la somme de deux angles consécutifs vaut $180^\\circ$.
55
55
 
56
56
  Ainsi,
57
57
 
@@ -24,8 +24,8 @@ const getInstruction = (identifiers) => {
24
24
  const { firstAngleValue, sameAngleValue, secondAngleValue, triangleNames } = identifiers;
25
25
  return `On considère deux triangles :
26
26
 
27
- - le triangle $${triangleNames[0]}$, dans lequel l'angle $\\widehat{${triangleNames[0][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^{\\circ}$ et l'angle $\\widehat{${triangleNames[0][1]}}$ a une mesure de $${firstAngleValue.frenchify()}^{\\circ}$ ;
28
- - le triangle $${triangleNames[1]}$, dans lequel l'angle $\\widehat{${triangleNames[1][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^{\\circ}$ et l'angle $\\widehat{${triangleNames[1][1]}}$ a une mesure de $${secondAngleValue.frenchify()}^{\\circ}$.
27
+ - le triangle $${triangleNames[0]}$, dans lequel l'angle $\\widehat{${triangleNames[0][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^\\circ$ et l'angle $\\widehat{${triangleNames[0][1]}}$ a une mesure de $${firstAngleValue.frenchify()}^\\circ$ ;
28
+ - le triangle $${triangleNames[1]}$, dans lequel l'angle $\\widehat{${triangleNames[1][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^\\circ$ et l'angle $\\widehat{${triangleNames[1][1]}}$ a une mesure de $${secondAngleValue.frenchify()}^\\circ$.
29
29
 
30
30
  Les triangles $${triangleNames[0]}$ et $${triangleNames[1]}$ sont-ils semblables ?`;
31
31
  };
@@ -42,25 +42,25 @@ On calcule donc la mesure du troisième angle de chacun des triangles. Pour cela
42
42
  - pour le triangle $${triangleNames[0]}$, la somme des deux angles connus vaut :
43
43
 
44
44
  $$
45
- ${sameAngleValue.frenchify()}^{\\circ} + ${firstAngleValue.frenchify()}^{\\circ} = ${round(sameAngleValue + firstAngleValue, 4).frenchify()}^{\\circ}
45
+ ${sameAngleValue.frenchify()}^\\circ + ${firstAngleValue.frenchify()}^\\circ = ${round(sameAngleValue + firstAngleValue, 4).frenchify()}^\\circ
46
46
  $$
47
47
 
48
48
  donc le troisième angle vaut :
49
49
 
50
50
  $$
51
- 180 - ${round(sameAngleValue + firstAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + firstAngleValue), 4).frenchify()}^{\\circ}
51
+ 180 - ${round(sameAngleValue + firstAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + firstAngleValue), 4).frenchify()}^\\circ
52
52
  $$
53
53
 
54
54
  - pour le triangle $${triangleNames[1]}$, la somme des deux angles connus vaut :
55
55
 
56
56
  $$
57
- ${sameAngleValue.frenchify()}^{\\circ} + ${secondAngleValue.frenchify()}^{\\circ} = ${round(sameAngleValue + secondAngleValue, 4).frenchify()}^{\\circ}
57
+ ${sameAngleValue.frenchify()}^\\circ + ${secondAngleValue.frenchify()}^\\circ = ${round(sameAngleValue + secondAngleValue, 4).frenchify()}^\\circ
58
58
  $$
59
59
 
60
60
  donc le troisième angle vaut :
61
61
 
62
62
  $$
63
- 180 - ${round(sameAngleValue + secondAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + secondAngleValue), 4).frenchify()}^{\\circ}
63
+ 180 - ${round(sameAngleValue + secondAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + secondAngleValue), 4).frenchify()}^\\circ
64
64
  $$
65
65
 
66
66
  ${isSimilar
@@ -18,10 +18,10 @@ const getPropositions = (n, { answer, angleAsked, triangleIdentifiers }) => {
18
18
  triangle.angles[(angleAsked + 2) % 3].getValueNode(true),
19
19
  ];
20
20
  const addAnglesEv = add(angles[0], angles[1]).evaluate();
21
- tryToAddWrongProp(propositions, "180^{\\circ}");
22
- tryToAddWrongProp(propositions, addAnglesEv.frenchify() + "^{\\circ}");
21
+ tryToAddWrongProp(propositions, "180^\\circ");
22
+ tryToAddWrongProp(propositions, addAnglesEv.frenchify() + "^\\circ");
23
23
  propWhile(propositions, n, () => {
24
- tryToAddWrongProp(propositions, randint(20, 160) + "^{\\circ}");
24
+ tryToAddWrongProp(propositions, randint(20, 160) + "^\\circ");
25
25
  });
26
26
  return shuffleProps(propositions, n);
27
27
  };
@@ -34,7 +34,7 @@ const getAnswer = (identifiers) => {
34
34
  ];
35
35
  const addAngles = add(angles[0], angles[1]);
36
36
  const simp = addAngles.simplify();
37
- return substract(180, simp).simplify().toTex() + "^{\\circ}";
37
+ return substract(180, simp).simplify().toTex() + "^\\circ";
38
38
  };
39
39
  const getInstruction = (identifiers) => {
40
40
  const { triangleIdentifiers, angleAsked } = identifiers;
@@ -42,10 +42,10 @@ const getInstruction = (identifiers) => {
42
42
  const angles = [
43
43
  `${triangle.angles[(angleAsked + 1) % 3].toTex()}=${triangle.angles[(angleAsked + 1) % 3]
44
44
  .getValueNode(true)
45
- .toTex()}^{\\circ}`,
45
+ .toTex()}^\\circ`,
46
46
  `${triangle.angles[(angleAsked + 2) % 3].toTex()}=${triangle.angles[(angleAsked + 2) % 3]
47
47
  .getValueNode(true)
48
- .toTex()}^{\\circ}`,
48
+ .toTex()}^\\circ`,
49
49
  ];
50
50
  return `Dans le triangle $${triangle.name}$ ci-dessous, on a $${angles[0]}$ et $${angles[1]}$.
51
51
 
@@ -68,13 +68,13 @@ const getCorrection = (identifiers) => {
68
68
  En additionnant les deux angles donnés dans l'énoncé, on obtient :
69
69
 
70
70
  $$
71
- ${angles[0].toTex()}^{\\circ} + ${angles[1].toTex()}^{\\circ} =${simp.toTex()}^{\\circ}
71
+ ${angles[0].toTex()}^\\circ + ${angles[1].toTex()}^\\circ =${simp.toTex()}^\\circ
72
72
  $$
73
73
 
74
74
  L'angle recherché a donc une mesure de :
75
75
 
76
76
  $$
77
- 180^{\\circ} - ${simp.toTex()}^{\\circ}=${getAnswer(identifiers)}
77
+ 180^\\circ - ${simp.toTex()}^\\circ=${getAnswer(identifiers)}
78
78
  $$`;
79
79
  };
80
80
  const getGGBOptions = (identifiers) => {
@@ -198,7 +198,7 @@ const getKeys = () => {
198
198
  };
199
199
  const isAnswerValid = (ans, { answer, ...identifiers }) => {
200
200
  const strForKeyIdDegreeReceivedFromTests = "^\\circ";
201
- const strForKeyIdDegreeReceivedFromFront = "^{\\circ}"; //different from strForKeyIdDegreeSent: "^\\circ"
201
+ const strForKeyIdDegreeReceivedFromFront = "^\\circ"; //different from strForKeyIdDegreeSent: "^\\circ"
202
202
  const ansRefined = ans
203
203
  .replace(strForKeyIdDegreeReceivedFromTests, "")
204
204
  .replace(strForKeyIdDegreeReceivedFromFront, "");
@@ -62,7 +62,7 @@ ${triangle.sides
62
62
 
63
63
  - $${triangle.angles[indexAngle].toTexMini()} = ${triangle.angles[indexAngle]
64
64
  .evaluate()
65
- .frenchify()} {}^{\\circ} $
65
+ .frenchify()} {}^\\circ $
66
66
 
67
67
  Calculer la longueur $${triangle.sides[indexSide].toTex()}$ (donner une valeur arrondie à $${precision}$ décimales).`;
68
68
  };
@@ -73,7 +73,7 @@ const getAnswerStuff = (identifiers) => {
73
73
  const nodeAngleInDegrees = triangle.angles[indexAngle].evaluate().toTree();
74
74
  const nodeAngleInRadians = multiply(nodeAngleInDegrees, frac(PiNode, 180));
75
75
  //"nodeStr"
76
- const nodeStrLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(multiply(nodeAngleInDegrees, "{}^{\\circ}".toTree())))));
76
+ const nodeStrLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(multiply(nodeAngleInDegrees, "{}^\\circ".toTree())))));
77
77
  const nodeStrLength = sqrt(nodeStrLengthSquared.simplify());
78
78
  //"true" nodes
79
79
  const nodeLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(nodeAngleInRadians))));
@@ -17,7 +17,7 @@ const getPropositions = (n, { answer }) => {
17
17
  const propositions = [];
18
18
  addValidProp(propositions, answer);
19
19
  propWhile(propositions, n, () => {
20
- tryToAddWrongProp(propositions, randint(0, 180) + "^{\\circ}");
20
+ tryToAddWrongProp(propositions, randint(0, 180) + "^\\circ");
21
21
  });
22
22
  return shuffleProps(propositions, n);
23
23
  };
@@ -30,7 +30,7 @@ const getAnswer = (identifiers) => {
30
30
  const normV = v.getNorm();
31
31
  const cos = frac(ps, multiply(normU, normV)).simplify();
32
32
  const arc = round((180 * Math.acos(cos.evaluate())) / Math.PI, 0);
33
- return arc.frenchify() + "^{\\circ}";
33
+ return arc.frenchify() + "^\\circ";
34
34
  };
35
35
  const getInstruction = (identifiers) => {
36
36
  const points = getPoints(identifiers);
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAkOF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
1
+ {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAoPF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
@@ -102,7 +102,7 @@ const getScalarProductOrthoInSquareQuestion = () => {
102
102
  //puis on reverse tout possiblement
103
103
  const isFirstVecOnAB = coinFlip();
104
104
  const vecs = {
105
- AB: { projLength: c, reps: ["AB", "DC"] },
105
+ AB: { projLength: c, reps: ["AB", "DC"] }, //base
106
106
  AC: { projLength: c, reps: ["AC"] },
107
107
  AD: { projLength: c, reps: ["AD", "IK", "BC"] },
108
108
  AJ: { projLength: isFirstVecOnAB ? c : c / 2, reps: ["AJ", "LC"] },
@@ -141,7 +141,7 @@ const getScalarProductOrthoInSquareQuestion = () => {
141
141
  };
142
142
  return getQuestionFromIdentifiers(identifiers);
143
143
  };
144
- // const getHint: GetHint<Identifiers> = (identifiers) => {
144
+ // const getHint: GetHint<Identifiers> = () => {
145
145
  // return `Utilise la définition du produit scalaire par projeté orthogonal : si $H$ est le projeté orthogonal du point $C$ sur la droite $(AB)$, alors :
146
146
  // $$
147
147
  // \\overline{AB}\\cdot\\overline{AC} = \\overline{AB}\\cdot\\overline{AH}
@@ -159,33 +159,48 @@ const getScalarProductOrthoInSquareQuestion = () => {
159
159
  // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
160
160
  // const { areSameDirection, vec1Name, vec2Name, c } = identifiers;
161
161
  // const vecs = [
162
- // ["AB", "DC"],
162
+ // ["AB", "DC"], //base
163
163
  // ["AC"],
164
- // ["AD", "IK", "BC"],
164
+ // ["AD", "IK", "BC"], //base
165
165
  // ["AJ", "LC"],
166
166
  // ["AO", "LK", "OC", "IJ"],
167
167
  // ["AK", "IC"],
168
- // ["AI", "IB", "LO", "OJ", "DK", "KC"],
169
- // ["AL", "LD", "IO", "OK", "BJ", "JC"],
168
+ // ["AI", "IB", "LO", "OJ", "DK", "KC"], //base
169
+ // ["AL", "LD", "IO", "OK", "BJ", "JC"], //base
170
170
  // ];
171
+ // const baseIndexes = [0, 2, 6, 7];
172
+ // if (!areSameDirection) return `plus tard`;
173
+ // const reversedVecs = vecs.map((e) =>
174
+ // e.map((f) => f.split("").reverse().join("")),
175
+ // );
176
+ // const reversedFirst = vec1Name.split("").reverse().join("");
171
177
  // const index1 = vecs.findIndex(
172
- // (e) =>
173
- // e.includes(vec1Name) || e.includes(vec1Name.split("").reverse().join("")),
178
+ // (e) => e.includes(vec1Name) || e.includes(reversedFirst),
174
179
  // );
175
180
  // const firstIsReversed = !vecs[index1].includes(vec1Name);
181
+ // const reversedSecond = vec2Name.split("").reverse().join("");
176
182
  // const index2 = vecs.findIndex(
177
- // (e) =>
178
- // e.includes(vec2Name) || e.includes(vec2Name.split("").reverse().join("")),
183
+ // (e) => e.includes(vec2Name) || e.includes(reversedSecond),
179
184
  // );
180
185
  // const secondIsReversed = !vecs[index2].includes(vec2Name);
181
- // if (vec1Name[0] === vec2Name[0]) return `immédiat`;
182
- // for (let i = 0; i < vecs[index1].length; i++) {
183
- // const rep = vecs[index1][i];
184
- // const origin1 = rep[0];
185
- // const sameOrigin = vecs[index2].find((e) => e[0] === origin1);
186
- // if (sameOrigin)
187
- // return `on prend $${rep}$ et $${sameOrigin}$. ${sameOrigin[1]} à projeter sur ${rep}`;
186
+ // if (vec1Name[0] === vec2Name[0]) {
187
+ // const firstIsBase = baseIndexes.includes(index1);
188
+ // return `Le projeté orthogonal de $${
189
+ // firstIsBase ? vec2Name[1] : vec1Name[1]
190
+ // }$ sur la droite $(${firstIsBase ? vec1Name : vec2Name})$ est $${"a"}$.
191
+ // On a donc :
192
+ // immédiat`;
188
193
  // }
194
+ // const sameOrigin =
195
+ // vecs[index2].find((e) => e[0] === vec1Name[0]) ||
196
+ // reversedVecs[index2].find((e) => e[0] === vec1Name[0]);
197
+ // if (sameOrigin)
198
+ // return `on prend $${vec1Name}$ et $${sameOrigin}$. eet ${sameOrigin[1]} à projeter sur ${vec1Name}`;
199
+ // const sameOrigin2 =
200
+ // vecs[index1].find((e) => e[0] === vec2Name[0]) ||
201
+ // reversedVecs[index1].find((e) => e[0] === vec2Name[0]);
202
+ // if (sameOrigin2)
203
+ // return `on prend $${vec2Name}$ et $${sameOrigin2}$. ${vec2Name[1]} à projeter sur ${sameOrigin2}`;
189
204
  // return `On a :
190
205
  // ${alignTex([[]])}
191
206
  // `;
@@ -0,0 +1,13 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ situationIndex: number;
4
+ aCapB: number;
5
+ aCapBBarre: number;
6
+ aBarreCapB: number;
7
+ aBarreCapBBarre: number;
8
+ knowing: "A" | "\\overline{A}" | "B" | "\\overline{B}";
9
+ asked: "A" | "\\overline{A}" | "B" | "\\overline{B}";
10
+ };
11
+ export declare const conditionalProbaFromTableWithContext: Exercise<Identifiers>;
12
+ export {};
13
+ //# sourceMappingURL=conditionalProbaFromTableWithContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditionalProbaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;IACvD,KAAK,EAAE,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;CACtD,CAAC;AA+NF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAsBtE,CAAC"}