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,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ A: number[];
4
+ B: number[];
5
+ coeffs: number[];
6
+ };
7
+ type Options = {
8
+ notationType: string;
9
+ };
10
+ export declare const derivativeReadingByManipulatingPoint: Exercise<Identifiers, Options>;
11
+ export {};
12
+ //# sourceMappingURL=derivativeReadingByManipulatingPoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivativeReadingByManipulatingPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA+NF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CACzD,WAAW,EACX,OAAO,CAkBR,CAAC"}
@@ -0,0 +1,219 @@
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueMain, orange } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { Integer } from "../../../../math/numbers/integer/integer.js";
6
+ import { Rational } from "../../../../math/numbers/rationals/rational.js";
7
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
10
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
11
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
12
+ import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
13
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
14
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
15
+ const getInstruction = (identifiers, opts) => {
16
+ const { A } = identifiers;
17
+ const xA = A[0];
18
+ const notation = opts?.notationType === "Nombre dérivé de $f$ en $a$"
19
+ ? `le nombre dérivé de $f$ en $${xA.frenchify()}$`
20
+ : `$f'(${xA.frenchify()})$`;
21
+ return `Ci-dessous est tracée la courbe $\\mathcal C_f$ de la fonction $f$.
22
+
23
+ En manipulant le curseur ou le point sur l'axe des abscisses,
24
+ on peut faire apparaître la tangente à cette courbe au point d'abscisse de son choix.
25
+
26
+ Déterminer ${notation}.`;
27
+ };
28
+ const getAnswer = (identifiers) => {
29
+ const { A, B } = identifiers;
30
+ const xA = A[0];
31
+ const xB = B[0];
32
+ const yA = A[1];
33
+ const yB = B[1];
34
+ const pente = new Rational(yB - yA, xB - xA).simplify();
35
+ const penteTree = pente.toTree();
36
+ const answer = penteTree.toTex();
37
+ return answer;
38
+ };
39
+ const getGGBOptions = (identifiers) => {
40
+ const { A, B } = identifiers;
41
+ const xA = A[0];
42
+ const xB = B[0];
43
+ const yA = A[1];
44
+ const yB = B[1];
45
+ const [minSlider, maxSlider] = [-6, 6];
46
+ const stepSlider = 0.5;
47
+ const valueSliderInitial = randint(minSlider, maxSlider, [xA]);
48
+ const polynome = new Polynomial(identifiers.coeffs);
49
+ const commands = [
50
+ `f(x) = ${polynome.toMathString()}`,
51
+ `SetColor(f, "${blueMain}")`,
52
+ `SetCaption(f, "$\\mathcal C_f$")`,
53
+ `ShowLabel(f, true)`,
54
+ //slider
55
+ `a = Slider(${minSlider}, ${maxSlider}, ${stepSlider})`,
56
+ `SetValue(a, ${valueSliderInitial})`,
57
+ //moving point
58
+ `A = (a,0)`,
59
+ "SetPointStyle(A, 0)",
60
+ "SetPointSize(A,5)",
61
+ //tangent
62
+ `t(x) = f(a) + (x-a) f'(a)`,
63
+ //curve point
64
+ `B = (a,f(a))`,
65
+ "SetPointStyle(B, 1)",
66
+ ];
67
+ const xMin = Math.min(xA, xB);
68
+ const yMin = Math.min(yA, yB);
69
+ const xMax = Math.max(xA, xB);
70
+ const yMax = Math.max(yA, yB);
71
+ const ggb = new GeogebraConstructor({
72
+ commands,
73
+ });
74
+ return ggb.getOptions({
75
+ coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
76
+ });
77
+ };
78
+ const getHint = () => {
79
+ return `Le nombre dérivé de $f$ en $a$, aussi noté $f'(a)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $a$.`;
80
+ };
81
+ const getCorrection = (identifiers) => {
82
+ const { A, B } = identifiers;
83
+ const xA = A[0];
84
+ const yA = A[1];
85
+ const xB = B[0];
86
+ const yB = B[1];
87
+ return `Le nombre dérivé de $f$ en $${xA.frenchify()}$, aussi noté $f'(${xA.frenchify()})$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $${xA.frenchify()}$.
88
+
89
+ Ici, on doit donc lire le coefficient directeur de la tangente passant par $A(${xA.frenchify()};${yA.frenchify()})$.
90
+
91
+ On lit un deuxième point par lequel passe cette tangente : c'est $B(${xB.frenchify()};${yB.frenchify()})$.
92
+
93
+ Le coefficient directeur est donc :
94
+
95
+ $$
96
+ ${frac(substract(yB, yA), substract(xB, xA)).toSimplificationTex()}
97
+ $$
98
+
99
+ C'est donc le nombre dérivé de $f$ en $${xA.frenchify()}$, noté $f'(${xA.frenchify()})$.`;
100
+ };
101
+ const getCorrectionGGBOptions = (identifiers) => {
102
+ const { A, B } = identifiers;
103
+ const xA = A[0];
104
+ const xB = B[0];
105
+ const yA = A[1];
106
+ const yB = B[1];
107
+ const pente = new Rational(yB - yA, xB - xA).simplify();
108
+ const origin = pente
109
+ .opposite()
110
+ .multiply(new Integer(xA))
111
+ .add(new Integer(yA));
112
+ const penteTree = pente.toTree();
113
+ const originTree = origin.toTree();
114
+ const penteString = penteTree.toMathString();
115
+ const originString = originTree.toMathString();
116
+ const polynome = new Polynomial(identifiers.coeffs);
117
+ const commands = [
118
+ `f(x) = ${polynome.toMathString()}`,
119
+ `SetColor(f, "${blueMain}")`,
120
+ `SetCaption(f, "$\\mathcal C_f$")`,
121
+ `ShowLabel(f, true)`,
122
+ `g(x) = (${penteString}) * x + (${originString})`,
123
+ `SetColor(g, "${orange}")`,
124
+ `A = (${xA},${yA})`,
125
+ "SetFixed(A, true, false)",
126
+ "SetPointStyle(A, 1)",
127
+ ];
128
+ const xMin = Math.min(xA, xB);
129
+ const yMin = Math.min(yA, yB);
130
+ const xMax = Math.max(xA, xB);
131
+ const yMax = Math.max(yA, yB);
132
+ const ggb = new GeogebraConstructor({
133
+ commands,
134
+ });
135
+ return ggb.getOptions({
136
+ coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
137
+ });
138
+ };
139
+ const getPropositions = (n, { answer, A, B }) => {
140
+ const propositions = [];
141
+ addValidProp(propositions, answer);
142
+ if (B[1] - A[1] !== 0)
143
+ tryToAddWrongProp(propositions, new Rational(B[0] - A[0], B[1] - A[1]).simplify().toTree().toTex());
144
+ propWhile(propositions, n, () => {
145
+ const wrongAnswer = new NumberNode(randint(-4, 5, [0]));
146
+ tryToAddWrongProp(propositions, wrongAnswer.toTex());
147
+ });
148
+ return shuffle(propositions);
149
+ };
150
+ const isAnswerValid = (ans, { answer }) => {
151
+ try {
152
+ const parsed = rationalParser(ans);
153
+ if (!parsed)
154
+ return false;
155
+ return parsed.simplify({ decimalToFractions: true }).toTex() === answer;
156
+ }
157
+ catch (err) {
158
+ return handleVEAError(err);
159
+ }
160
+ };
161
+ const getDerivativeReadingByManipulatingPointQuestion = (opts) => {
162
+ const [xA, yA] = [1, 2].map((_el) => randint(-5, 6));
163
+ const xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
164
+ const yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
165
+ const pente = new Rational(yB - yA, xB - xA).simplify();
166
+ const penteValue = pente.value;
167
+ const [a, b] = [
168
+ (3 * randint(-100, 100, [0])) / 100,
169
+ (2 * randint(-4, 5)) / 100,
170
+ ];
171
+ const c = penteValue - a * Math.pow(xA, 2) - b * xA;
172
+ const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
173
+ const identifiers = {
174
+ A: [xA, yA],
175
+ B: [xB, yB],
176
+ coeffs: [d, c, b / 2, a / 3],
177
+ };
178
+ return getQuestionFromIdentifiers(identifiers, opts);
179
+ };
180
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
181
+ return {
182
+ instruction: getInstruction(identifiers, opts),
183
+ startStatement: "a",
184
+ answer: getAnswer(identifiers),
185
+ ggbOptions: getGGBOptions(identifiers),
186
+ answerFormat: "tex",
187
+ keys: [],
188
+ hint: getHint(identifiers, opts),
189
+ correction: getCorrection(identifiers, opts),
190
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
191
+ identifiers,
192
+ };
193
+ };
194
+ const options = [
195
+ {
196
+ id: "notationType",
197
+ label: "",
198
+ type: GeneratorOptionType.select,
199
+ target: GeneratorOptionTarget.instruction,
200
+ values: ["Nombre dérivé de $f$ en $a$", "$f'(a)$"],
201
+ defaultValue: "$f'(a)$",
202
+ },
203
+ ];
204
+ export const derivativeReadingByManipulatingPoint = {
205
+ id: "derivativeReadingByManipulatingPoint",
206
+ connector: "=",
207
+ label: "Lire graphiquement un nombre dérivé par la manipulation de l'abscisse du point",
208
+ isSingleStep: false,
209
+ generator: (nb) => getDistinctQuestions(getDerivativeReadingByManipulatingPointQuestion, nb),
210
+ qcmTimer: 60,
211
+ freeTimer: 60,
212
+ getPropositions,
213
+ isAnswerValid,
214
+ hasGeogebra: true,
215
+ subject: "Mathématiques",
216
+ getQuestionFromIdentifiers,
217
+ options,
218
+ hasHintAndCorrection: true,
219
+ };
@@ -0,0 +1,13 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ x: number;
5
+ k: number;
6
+ nodeIds: NodeIdentifiers[];
7
+ };
8
+ type Options = {
9
+ notationType: string;
10
+ };
11
+ export declare const derivativeReadingByManipulatingSecant: Exercise<Identifiers, Options>;
12
+ export {};
13
+ //# sourceMappingURL=derivativeReadingByManipulatingSecant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivativeReadingByManipulatingSecant.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAwTF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -0,0 +1,273 @@
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueMain, greenMain, orange } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { Rational } from "../../../../math/numbers/rationals/rational.js";
6
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
7
+ import { randint } from "../../../../math/utils/random/randint.js";
8
+ import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
9
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
10
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
11
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
12
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
13
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
14
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
15
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
16
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
17
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
18
+ const [xMin, xMax] = [-6, 6];
19
+ const getInstruction = (identifiers, opts) => {
20
+ const { x: xA } = identifiers;
21
+ const notation = opts?.notationType === "Nombre dérivé de $f$ en $a$"
22
+ ? `le nombre dérivé de $f$ en $${xA.frenchify()}$`
23
+ : `$f'(${xA.frenchify()})$`;
24
+ return `Ci-dessous est tracée la courbe $\\mathcal C_f$ de la fonction $f$.
25
+
26
+ En manipulant les points $A$ et $B$,
27
+ on peut construire la sécante à $C_f$ passant par $A$ et $B$.
28
+
29
+ Déterminer ${notation} (donner une valeur approximative).`;
30
+ };
31
+ const getAnswerNode = (identifiers) => {
32
+ const { k } = identifiers;
33
+ return k.toTree();
34
+ };
35
+ const getAnswer = (identifiers) => {
36
+ return getAnswerNode(identifiers).toTex();
37
+ };
38
+ const getHint = () => {
39
+ return `Le nombre dérivé de $f$ en $x$, aussi noté $f'(x)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $x$.
40
+
41
+ Résoudre l'équation $f'(x) = k$,
42
+ c'est trouver toutes les abscisses $x$
43
+ pour lesquelles le coefficient directeur la tangente à la courbe représentative de $f$ vaut $k$.
44
+
45
+ La tangente au point $C$ est la droite que l'on obtient quand $A$ et $B$ sont infiniment proches de $C$, en restant tous deux distincts.
46
+ `;
47
+ };
48
+ const getCorrection = (identifiers) => {
49
+ const { x, k } = identifiers;
50
+ return `Le nombre dérivé de $f$ en $x$, aussi noté $f'(x)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $x$.
51
+
52
+ La tangente au point $C$ est la droite que l'on obtient quand $A$ et $B$ sont infiniment proches de $C$, en restant tous deux distincts.
53
+
54
+ En manipulant les points $A$ et $B$, on observe que $f'(${x.frenchify()}) \\approx ${k.frenchify()}$.`;
55
+ };
56
+ const getCorrectionGGBOptions = (identifiers) => {
57
+ const { x, nodeIds } = identifiers;
58
+ const [nodeC, nodeB, nodeA] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
59
+ const nodeX = "x".toTree();
60
+ const nodeF = add(nodeC, add(multiply(nodeB, nodeX), multiply(nodeA, power(nodeX, 2))));
61
+ const commands = [
62
+ `f(x) = ${nodeF.toMathString()}`,
63
+ `SetColor(f, "${blueMain}")`,
64
+ `SetCaption(f, "$\\mathcal C_f$")`,
65
+ `ShowLabel(f, true)`,
66
+ //tangent
67
+ `t(x) = f(${x}) + (x-${x}) f'(${x})`,
68
+ `SetColor(t, "${greenMain}")`,
69
+ //moving point
70
+ `A = (${x - 0.1},f(${x - 0.1}))`,
71
+ "SetPointStyle(A, 0)",
72
+ "SetPointSize(A,5)",
73
+ "ShowLabel(A,true)",
74
+ `B = (${x + 0.1},f(${x + 0.1}))`,
75
+ "SetPointStyle(B, 0)",
76
+ "SetPointSize(B,5)",
77
+ "ShowLabel(B,true)",
78
+ //secant
79
+ `lineAB = Line(A,B)`,
80
+ `SetColor(lineAB, "${orange}")`,
81
+ `s = Slope(lineAB)`,
82
+ ];
83
+ const [yMin, yMax] = [xMin, xMax].map((x) => nodeF.evaluate({ x }));
84
+ const ggb = new GeogebraConstructor({
85
+ commands,
86
+ });
87
+ return ggb.getOptions({
88
+ coords: ggb.getAdaptedCoords({
89
+ xMin,
90
+ xMax,
91
+ yMin: Math.min(yMin, -2),
92
+ yMax,
93
+ }),
94
+ });
95
+ };
96
+ const getGGBOptions = (identifiers) => {
97
+ const { x, nodeIds } = identifiers;
98
+ const [nodeC, nodeB, nodeA] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
99
+ const nodeX = "x".toTree();
100
+ const nodeF = add(nodeC, add(multiply(nodeB, nodeX), multiply(nodeA, power(nodeX, 2))));
101
+ const [minSliderA, maxSliderA] = [-6, 6];
102
+ const stepSliderA = 0.1;
103
+ const valueSliderInitialA = randint(minSliderA, -1, [x]);
104
+ const [minSliderB, maxSliderB] = [-6, 6];
105
+ const stepSliderB = 0.1;
106
+ const valueSliderInitialB = randint(1, maxSliderB, [x]);
107
+ const commands = [
108
+ `f(x) = ${nodeF.toMathString()}`,
109
+ `SetColor(f, "${blueMain}")`,
110
+ `SetCaption(f, "$\\mathcal C_f$")`,
111
+ `ShowLabel(f, true)`,
112
+ `SetColor(f, "${blueMain}")`,
113
+ //sliderA
114
+ `a = Slider(${minSliderA}, ${maxSliderA}, ${stepSliderA})`,
115
+ `SetValue(a, ${valueSliderInitialA})`,
116
+ `SetVisibleInView(a, 1, false)`,
117
+ //moving point
118
+ `A = (a,f(a))`,
119
+ "SetPointStyle(A, 0)",
120
+ "SetPointSize(A,5)",
121
+ "ShowLabel(A,true)",
122
+ //sliderB
123
+ `b = Slider(${minSliderB}, ${maxSliderB}, ${stepSliderB})`,
124
+ `SetValue(b, ${valueSliderInitialB})`,
125
+ `SetVisibleInView(b, 1, false)`,
126
+ //moving point
127
+ `B = (b,f(b))`,
128
+ "SetPointStyle(B, 0)",
129
+ "SetPointSize(B,5)",
130
+ "ShowLabel(B,true)",
131
+ //secant
132
+ `lineAB = Line(A,B)`,
133
+ `s = Slope(lineAB)`,
134
+ ];
135
+ const [yMin, yMax] = [xMin, xMax].map((x) => nodeF.evaluate({ x }));
136
+ const ggb = new GeogebraConstructor({
137
+ commands,
138
+ });
139
+ return ggb.getOptions({
140
+ coords: ggb.getAdaptedCoords({
141
+ xMin,
142
+ xMax,
143
+ yMin: Math.min(yMin, -2),
144
+ yMax: Math.max(yMax, 2),
145
+ }),
146
+ });
147
+ };
148
+ const getPropositions = (n, { answer, ..._identifiers }) => {
149
+ const propositions = [];
150
+ addValidProp(propositions, answer);
151
+ propWhile(propositions, n, () => {
152
+ const xWrong = (() => {
153
+ const num = randint(-10, 11, [0]);
154
+ const den = 2;
155
+ return new Rational(num, den).simplify();
156
+ })().value;
157
+ tryToAddWrongProp(propositions, xWrong.frenchify());
158
+ });
159
+ return shuffle(propositions);
160
+ };
161
+ const isAnswerValid = (ans, { answer }) => {
162
+ try {
163
+ const [nodeAns, nodeAnswer] = [ans, answer].map((tex) => parseAlgebraic(tex));
164
+ const [valueAns, valueAnswer] = [nodeAns, nodeAnswer].map((node) => node.evaluate());
165
+ //+/-5°
166
+ const [angleAns, angleAnswer] = [valueAns, valueAnswer].map((value) => (Math.atan2(value, 1) * 180.0) / Math.PI);
167
+ const [angleMin, angleMax] = [-5, +5].map((offset) => angleAnswer + offset);
168
+ const isValid = angleMin < angleAns && angleAns < angleMax;
169
+ return isValid;
170
+ }
171
+ catch (err) {
172
+ return handleVEAError(err);
173
+ }
174
+ };
175
+ const createRandomIdentifiers = () => {
176
+ //x=m*0.5
177
+ const x = (() => {
178
+ const num = randint(-10, 11, [0]);
179
+ const den = 2;
180
+ return new Rational(num, den).simplify();
181
+ })();
182
+ //k=p*0.1
183
+ const k = (() => {
184
+ const num = (coinFlip() ? +1 : -1) * randint(5, 41);
185
+ const den = 10;
186
+ return new Rational(num, den).simplify();
187
+ })();
188
+ //f(x) = ax²+bx+c
189
+ //f'(x) = 2ax + b = k
190
+ //a = (k-b)/2x
191
+ const nodeB = ((coinFlip() ? +1 : -1) * randfloat(0, 1, 2, [0])).toTree();
192
+ const nodeA = frac(substract(k.toTree(), nodeB), multiply(2, x.toTree()));
193
+ const nodeC = (0).toTree();
194
+ const identifiers = {
195
+ x: x.value,
196
+ k: k.value,
197
+ nodeIds: [nodeC, nodeB, nodeA].map((node) => node.simplify().toIdentifiers()),
198
+ };
199
+ return identifiers;
200
+ };
201
+ const getDerivativeReadingByManipulatingSecantQuestion = (opts) => {
202
+ let identifiers;
203
+ let counter = -1;
204
+ let isValid = false;
205
+ while (!isValid && counter < 100) {
206
+ counter++;
207
+ const identifiersCandidate = createRandomIdentifiers();
208
+ function isValidFrameWise(identifiers) {
209
+ const { nodeIds } = identifiers;
210
+ const [nodeC, nodeB, nodeA] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
211
+ const nodeX = "x".toTree();
212
+ const nodeF = add(nodeC, add(multiply(nodeB, nodeX), multiply(nodeA, power(nodeX, 2))));
213
+ const arrX = [...Array(xMax - xMin + 1).keys()].map((i) => i + xMin);
214
+ const arrY = arrX.map((x) => nodeF.evaluate({ x }));
215
+ const minY = Math.min(...arrY);
216
+ const maxY = Math.max(...arrY);
217
+ const spanY = maxY - minY;
218
+ return spanY < 15;
219
+ }
220
+ isValid = isValidFrameWise(identifiersCandidate);
221
+ if (isValid) {
222
+ identifiers = identifiersCandidate;
223
+ }
224
+ }
225
+ if (!isValid) {
226
+ const identifiersDefault = {
227
+ x: -2.5,
228
+ k: 1.8,
229
+ nodeIds: [(0).toTree(), (0.37).toTree(), frac(143, 500)].map((node) => node.toIdentifiers()),
230
+ };
231
+ identifiers = identifiersDefault;
232
+ }
233
+ return getQuestionFromIdentifiers(identifiers, opts);
234
+ };
235
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
236
+ return {
237
+ instruction: getInstruction(identifiers, opts),
238
+ answer: getAnswer(identifiers),
239
+ ggbOptions: getGGBOptions(identifiers),
240
+ answerFormat: "tex",
241
+ keys: [],
242
+ hint: getHint(identifiers, opts),
243
+ correction: getCorrection(identifiers, opts),
244
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
245
+ identifiers,
246
+ };
247
+ };
248
+ const options = [
249
+ {
250
+ id: "notationType",
251
+ label: "",
252
+ type: GeneratorOptionType.select,
253
+ target: GeneratorOptionTarget.instruction,
254
+ values: ["Nombre dérivé de $f$ en $a$", "$f'(a)$"],
255
+ defaultValue: "$f'(a)$",
256
+ },
257
+ ];
258
+ export const derivativeReadingByManipulatingSecant = {
259
+ id: "derivativeReadingByManipulatingSecant",
260
+ connector: "=",
261
+ label: "Lire graphiquement un nombre dérivé par la manipulation d'une sécante",
262
+ isSingleStep: false,
263
+ generator: (nb, opts) => getDistinctQuestions(() => getDerivativeReadingByManipulatingSecantQuestion(opts), nb),
264
+ options,
265
+ qcmTimer: 60,
266
+ freeTimer: 60,
267
+ getPropositions,
268
+ isAnswerValid,
269
+ subject: "Mathématiques",
270
+ getQuestionFromIdentifiers,
271
+ hasHintAndCorrection: true,
272
+ hasGeogebra: true,
273
+ };
@@ -0,0 +1,18 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointOfFunctionIdentifiers } from "../../../../math/utils/polynomial/polynomialInterpolationUtils.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type CubicSplineChunkIdentifiers = {
5
+ nodeIdsFCubic: NodeIdentifiers;
6
+ nodeIdsXStart: NodeIdentifiers;
7
+ nodeIdsXEnd: NodeIdentifiers;
8
+ };
9
+ type CubicSplineIds = {
10
+ chunkIds: CubicSplineChunkIdentifiers[];
11
+ };
12
+ type Identifiers = {
13
+ pofIds: PointOfFunctionIdentifiers[];
14
+ cubicSplineIds: CubicSplineIds;
15
+ };
16
+ export declare const placePointsOfDerivativeFromGraph: Exercise<Identifiers>;
17
+ export {};
18
+ //# sourceMappingURL=placePointsOfDerivativeFromGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placePointsOfDerivativeFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAYrC,OAAO,EAIL,0BAA0B,EAC3B,MAAM,6DAA6D,CAAC;AAGrE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6C7C,KAAK,2BAA2B,GAAG;IACjC,aAAa,EAAE,eAAe,CAAC;IAC/B,aAAa,EAAE,eAAe,CAAC;IAC/B,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAqBF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,2BAA2B,EAAE,CAAC;CACzC,CAAC;AAwBF,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAyRF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAqBlE,CAAC"}