math-exercises 3.0.150 → 3.0.152

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 (217) hide show
  1. package/lib/exercises/exercise.d.ts +5 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts +5 -1
  5. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +92 -38
  7. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +5 -1
  9. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +7 -1
  11. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +5 -1
  13. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +5 -1
  15. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +8 -2
  17. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +4 -1
  18. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/equa1.js +27 -7
  20. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +1 -0
  21. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/equation/equa2.js +18 -1
  23. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +4 -1
  24. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/equation/equa3.js +26 -6
  26. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +4 -1
  27. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/equation/equa4.js +27 -7
  29. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts +14 -0
  30. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts.map +1 -0
  31. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.js +129 -0
  32. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts +18 -0
  33. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts.map +1 -0
  34. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.js +167 -0
  35. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts +15 -0
  36. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts.map +1 -0
  37. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.js +129 -0
  38. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts +16 -0
  39. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts.map +1 -0
  40. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.js +124 -0
  41. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts +9 -0
  42. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts.map +1 -0
  43. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.js +107 -0
  44. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts +10 -0
  45. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts.map +1 -0
  46. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.js +108 -0
  47. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts +11 -0
  48. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts.map +1 -0
  49. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.js +104 -0
  50. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts +8 -0
  51. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts.map +1 -0
  52. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.js +7 -0
  53. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -7
  54. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  55. package/lib/exercises/math/calculLitteral/equation/index.js +1 -7
  56. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts +8 -0
  57. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts.map +1 -0
  58. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.js +175 -0
  59. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts +9 -0
  60. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts.map +1 -0
  61. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.js +250 -0
  62. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts +9 -0
  63. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts.map +1 -0
  64. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.js +173 -0
  65. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts +14 -0
  66. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts.map +1 -0
  67. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.js +239 -0
  68. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts +9 -0
  69. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts.map +1 -0
  70. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.js +163 -0
  71. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts +6 -0
  72. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts.map +1 -0
  73. package/lib/exercises/math/dataRepresentations/histogram/index.js +5 -0
  74. package/lib/exercises/math/dataRepresentations/index.d.ts +1 -1
  75. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  76. package/lib/exercises/math/dataRepresentations/index.js +1 -1
  77. package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
  78. package/lib/exercises/math/dataRepresentations/tableReading.js +7 -0
  79. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/affines/affineAdjustment.js +7 -1
  81. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -1
  83. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -1
  85. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts +4 -1
  86. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +19 -4
  88. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts +1 -0
  89. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/affines/leadingCoefficient.js +13 -1
  91. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts +4 -1
  92. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
  93. package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +19 -4
  94. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +7 -1
  96. package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +7 -0
  98. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +4 -1
  99. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +18 -3
  101. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
  102. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  103. package/lib/exercises/math/geometry/triangles/index.js +1 -0
  104. package/lib/exercises/math/geometry/triangles/similar/index.d.ts +4 -0
  105. package/lib/exercises/math/geometry/triangles/similar/index.d.ts.map +1 -0
  106. package/lib/exercises/math/geometry/triangles/similar/index.js +3 -0
  107. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts +10 -0
  108. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +122 -0
  110. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts +15 -0
  111. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.js +351 -0
  113. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts +11 -0
  114. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.js +311 -0
  116. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts +10 -0
  117. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts.map +1 -0
  118. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +135 -0
  119. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts +9 -0
  120. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts.map +1 -0
  121. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.js +109 -0
  122. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.d.ts.map +1 -1
  123. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.js +7 -0
  124. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts +9 -0
  125. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts.map +1 -0
  126. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.js +120 -0
  127. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +4 -0
  128. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/basicProbas/index.js +4 -0
  130. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts +12 -0
  131. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -0
  132. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +374 -0
  133. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  134. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +7 -0
  135. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  136. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -0
  137. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  138. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +7 -1
  139. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.d.ts.map +1 -1
  140. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.js +7 -0
  141. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.d.ts.map +1 -1
  142. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.js +7 -0
  143. package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
  144. package/lib/exercises/math/probaStat/stats1var/etendueTable.js +7 -1
  145. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  146. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +7 -0
  147. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  148. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +5 -1
  149. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  150. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +7 -0
  151. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +2 -0
  152. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  153. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +67 -14
  154. package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
  155. package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +7 -1
  156. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  157. package/lib/exercises/math/probaStat/stats1var/quartiles.js +7 -1
  158. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  159. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +5 -1
  160. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  161. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +5 -1
  162. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  163. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +7 -1
  164. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts +7 -0
  165. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -0
  166. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +171 -0
  167. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts +7 -0
  168. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -0
  169. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +155 -0
  170. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts +3 -0
  171. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts.map +1 -1
  172. package/lib/exercises/math/probaStat/twoStepExperiments/index.js +3 -0
  173. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts +7 -0
  174. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -0
  175. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +189 -0
  176. package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
  177. package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
  178. package/lib/exercises/math/spaceGeometry/index.js +1 -0
  179. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts +14 -0
  180. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts.map +1 -0
  181. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.js +439 -0
  182. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts +14 -0
  183. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts.map +1 -0
  184. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.js +548 -0
  185. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts +11 -0
  186. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts.map +1 -0
  187. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.js +360 -0
  188. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts +9 -0
  189. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts.map +1 -0
  190. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.js +272 -0
  191. package/lib/exercises/math/spaceGeometry/sections/index.d.ts +9 -0
  192. package/lib/exercises/math/spaceGeometry/sections/index.d.ts.map +1 -0
  193. package/lib/exercises/math/spaceGeometry/sections/index.js +8 -0
  194. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts +11 -0
  195. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts.map +1 -0
  196. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.js +266 -0
  197. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts +11 -0
  198. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts.map +1 -0
  199. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.js +236 -0
  200. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts +7 -0
  201. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts.map +1 -0
  202. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.js +92 -0
  203. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts +9 -0
  204. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts.map +1 -0
  205. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.js +236 -0
  206. package/lib/exercises/pc/mathExosInPC.d.ts +4 -4
  207. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  208. package/lib/exercises/pc/mathExosInPC.js +4 -4
  209. package/lib/index.d.ts +173 -45
  210. package/lib/index.d.ts.map +1 -1
  211. package/lib/math/geometry/spacePoint.d.ts +10 -0
  212. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  213. package/lib/math/geometry/spacePoint.js +13 -0
  214. package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
  215. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  216. package/lib/tree/nodes/operators/substractNode.js +6 -0
  217. package/package.json +1 -1
@@ -0,0 +1,548 @@
1
+ import { shuffleProps, addValidProp, tryToAddWrongProp, GeneratorOptionType, GeneratorOptionTarget, propWhile, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueLight, greenMain, red } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { SpacePoint } from "../../../../math/geometry/spacePoint.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { round } from "../../../../math/utils/round.js";
8
+ import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
9
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
10
+ import { add } from "../../../../tree/nodes/operators/addNode.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 { probaFlip } from "../../../../utils/alea/probaFlip.js";
16
+ import { random } from "../../../../utils/alea/random.js";
17
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
18
+ const getSpacePointP = (radius, offset) => {
19
+ const nodeHalfWidth = sqrt(substract(power(radius, 2), power(offset, 2)));
20
+ return new SpacePoint("P", (-offset).toTree(), nodeHalfWidth, (0).toTree());
21
+ };
22
+ const cylinderSectionGGBCommands = (radius, height, offset, isShowSectionPlane, planeType) => {
23
+ return [
24
+ //hide xOyPlane
25
+ `SetFilling(xOyPlane, 0)`,
26
+ //cylinder
27
+ `Cyl = Cylinder((0,0,${-height / 2.0}), (0,0,${height / 2.0}), ${radius})`,
28
+ `SetColor(Cyl, "#d3dde6ff")`,
29
+ `SetFilling(Cyl, 0.36)`,
30
+ `SetLineThickness(Cyl, 1)`,
31
+ //plane
32
+ ...(isShowSectionPlane
33
+ ? (() => {
34
+ switch (planeType) {
35
+ case "contenant l'axe de révolution":
36
+ {
37
+ return [
38
+ `Pl = Plane((0,0,0), (0,1,0), (0,1,1))`,
39
+ `SetColor(Pl, "${blueLight}")`,
40
+ `SetFilling(Pl, 0.23)`,
41
+ ];
42
+ }
43
+ break;
44
+ case "perpendiculaire à l'axe de révolution":
45
+ {
46
+ return [
47
+ `Pl = Plane((${1}, 0, ${offset}), (0, ${1}, ${offset}), (${-1}, 0, ${offset}))`,
48
+ `SetColor(Pl, "${blueLight}")`,
49
+ `SetFilling(Pl, 0.23)`,
50
+ ];
51
+ }
52
+ break;
53
+ case "parallèle à l'axe de révolution":
54
+ {
55
+ return [
56
+ `Pl = Plane((${-offset},0,0), (${-offset},1,0), (${-offset},1,1))`,
57
+ `SetColor(Pl, "${blueLight}")`,
58
+ `SetFilling(Pl, 0.23)`,
59
+ ];
60
+ }
61
+ break;
62
+ default:
63
+ throw new Error("unsupported planeType: " + planeType);
64
+ }
65
+ })()
66
+ : []),
67
+ //section
68
+ ...(() => {
69
+ switch (planeType) {
70
+ case "contenant l'axe de révolution":
71
+ {
72
+ return [
73
+ `s = Polygon((0, ${-radius}, ${height / 2.0}), (0, ${radius}, ${height / 2.0}), (0, ${radius}, ${-height / 2.0}), (0, ${-radius}, ${-height / 2.0}))`,
74
+ `SetColor(s, "${red}")`,
75
+ // `SetFilling(s, 0.36)`,
76
+ `SetLineThickness(s, 3)`,
77
+ ];
78
+ }
79
+ break;
80
+ case "perpendiculaire à l'axe de révolution":
81
+ {
82
+ return [
83
+ `s = Circle((${radius}, 0, ${offset}), (0, ${radius}, ${offset}), (${-radius}, 0, ${offset}))`,
84
+ `SetColor(s, "${red}")`,
85
+ // `SetFilling(s, 0.36)`,
86
+ `SetLineThickness(s, 3)`,
87
+ ];
88
+ }
89
+ break;
90
+ case "parallèle à l'axe de révolution":
91
+ {
92
+ const nodeWidthHalf = sqrt(substract(power(radius, 2), power(offset, 2)));
93
+ const widthHalf = nodeWidthHalf.evaluate();
94
+ return [
95
+ `s = Polygon((${-offset}, ${-widthHalf}, ${height / 2.0}),(${-offset}, ${widthHalf}, ${height / 2.0}), (${-offset}, ${widthHalf}, ${-height / 2.0}), (${-offset}, ${-widthHalf}, ${-height / 2.0}))`,
96
+ `SetColor(s, "${red}")`,
97
+ // `SetFilling(s, 0.36)`,
98
+ `SetLineThickness(s, 3)`,
99
+ ];
100
+ }
101
+ break;
102
+ default:
103
+ throw new Error("unsupported planeType: " + planeType);
104
+ }
105
+ })(),
106
+ //points
107
+ `O = Point({0,0,0})`,
108
+ `ShowLabel(O,true)`,
109
+ ...(() => {
110
+ switch (planeType) {
111
+ case "contenant l'axe de révolution":
112
+ case "perpendiculaire à l'axe de révolution":
113
+ {
114
+ return [`I = Point({0,0,${offset}})`, `ShowLabel(I,true)`];
115
+ }
116
+ break;
117
+ case "parallèle à l'axe de révolution":
118
+ {
119
+ return [`I = Point({${-offset},0,0})`, `ShowLabel(I,true)`];
120
+ }
121
+ break;
122
+ default:
123
+ throw new Error("unsupported planeType: " + planeType);
124
+ }
125
+ })(),
126
+ //center view
127
+ `CenterView(Point({0,0,0}))`,
128
+ ];
129
+ };
130
+ const getInstruction = (identifiers) => {
131
+ const { radius, height, isDiameterGiven, offset, planeType } = identifiers;
132
+ return `Soit $\\mathcal{K}$ un cylindre de centre $O$, de hauteur $${height.frenchify()} \\ \\textrm{cm}$ et de ${isDiameterGiven ? "diamètre" : "rayon"} $${isDiameterGiven ? 2 * radius : radius} \\ \\textrm{cm}$.
133
+
134
+ ${(() => {
135
+ switch (planeType) {
136
+ case "contenant l'axe de révolution":
137
+ {
138
+ return `Un plan contenant l'axe de révolution coupe $\\mathcal{K}$ en une section telle que $OI = ${offset.frenchify()}\\ \\textrm{cm}$.`;
139
+ }
140
+ break;
141
+ case "perpendiculaire à l'axe de révolution":
142
+ {
143
+ return `Un plan perpendiculaire à l'axe de révolution coupe $\\mathcal{K}$ en une section telle que $OI = ${offset.frenchify()}\\ \\textrm{cm}$.`;
144
+ }
145
+ break;
146
+ case "parallèle à l'axe de révolution":
147
+ {
148
+ return `Un plan parallèle à l'axe de révolution coupe $\\mathcal{K}$ en une section telle que $OI = ${offset.frenchify()}\\ \\textrm{cm}$.`;
149
+ }
150
+ break;
151
+ default:
152
+ throw new Error("unsupported planeType: " + planeType);
153
+ }
154
+ })()}
155
+
156
+ Quelle est l'aire de la section plane en $\\textrm{cm}^2$ ?
157
+ On donnera le résultat sous forme arrondie à deux décimales.`;
158
+ };
159
+ const getAnswerNode = (identifiers) => {
160
+ const { radius, height, offset, planeType } = identifiers;
161
+ const nodeArea = (() => {
162
+ switch (planeType) {
163
+ case "contenant l'axe de révolution":
164
+ {
165
+ return multiply(2 * radius, height);
166
+ }
167
+ break;
168
+ case "perpendiculaire à l'axe de révolution":
169
+ {
170
+ return multiply(PiNode, power(radius, 2));
171
+ }
172
+ break;
173
+ case "parallèle à l'axe de révolution":
174
+ {
175
+ return multiply(multiply(2, sqrt(substract(power(radius, 2), power(offset, 2)))), height);
176
+ }
177
+ break;
178
+ default:
179
+ throw new Error("unsupported planeType: " + planeType);
180
+ }
181
+ })();
182
+ const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
183
+ return nodeAreaRounded;
184
+ };
185
+ const getAnswer = (identifiers) => {
186
+ return getAnswerNode(identifiers).toTex();
187
+ };
188
+ const getHint = (identifiers) => {
189
+ const { planeType } = identifiers;
190
+ switch (planeType) {
191
+ case "contenant l'axe de révolution":
192
+ {
193
+ return `Utilise la formule qui donne l'aire d'un rectangle.`;
194
+ }
195
+ break;
196
+ case "perpendiculaire à l'axe de révolution":
197
+ {
198
+ return `Utilise la formule qui donne l'aire d'un cercle.`;
199
+ }
200
+ break;
201
+ case "parallèle à l'axe de révolution":
202
+ {
203
+ return `Trouve un moyen de calculer la longueur qui te manque pour calculer l'aire.
204
+
205
+ Tu peux peut-être isoler un triangle particulier dont tu pourrais calculer la longueur d'un des côtés.`;
206
+ }
207
+ break;
208
+ default:
209
+ throw new Error("unsupported planeType: " + planeType);
210
+ }
211
+ };
212
+ const getCorrection = (identifiers) => {
213
+ const { radius, height, planeType } = identifiers;
214
+ switch (planeType) {
215
+ case "contenant l'axe de révolution":
216
+ {
217
+ const longueur = Math.max(2 * radius, height);
218
+ const largeur = Math.min(2 * radius, height);
219
+ return `La section est un rectangle de longueur $${longueur} \\ \\textrm{cm}$ et de largeur $${largeur} \\ \\textrm{cm}$.
220
+ Son aire vaut :
221
+
222
+ $$
223
+ \\mathcal{A}_{\\text{rectangle}} = ${longueur} \\times ${largeur} \\approx ${getAnswer(identifiers)} \\ \\textrm{cm}^2
224
+ $$
225
+
226
+ `;
227
+ }
228
+ break;
229
+ case "perpendiculaire à l'axe de révolution":
230
+ {
231
+ return `La section est un cercle de rayon $${radius} \\ \\textrm{cm}$.
232
+ Son aire vaut :
233
+
234
+ $$
235
+ \\mathcal{A}_{\\text{cercle}} = \\pi \\times ${radius}^2 \\approx ${getAnswer(identifiers)} \\ \\textrm{cm}^2
236
+ $$
237
+
238
+ `;
239
+ }
240
+ break;
241
+ case "parallèle à l'axe de révolution":
242
+ {
243
+ const { offset } = identifiers;
244
+ const spacePointP = getSpacePointP(radius, offset);
245
+ const nodeWidthHalf = spacePointP.y;
246
+ const widthHalf = nodeWidthHalf.evaluate();
247
+ const isLongueurKnown = height > 2 * widthHalf;
248
+ return `La section est un rectangle dont la ${isLongueurKnown ? "longueur" : "largeur"} vaut $${height} \\ \\textrm{cm}$.
249
+
250
+ Pour trouver sa ${!isLongueurKnown ? "longueur" : "largeur"}, on va utiliser un point $P$ qui est sur le même plan que $O$ et $I$, et qui appartient au rectangle section.
251
+
252
+ Le triangle $OPI$ est un triangle rectangle.
253
+
254
+ Le point $P$ est un point du cylindre $\\mathcal{K}$ donc $OP=${radius} \\ \\textrm{cm}$.
255
+
256
+ D'après le théorème de Pythagore :
257
+
258
+ $$
259
+ {OP}^2={IO}^2+{IP}^2
260
+ $$
261
+
262
+ $$
263
+ {IP}^2={OP}^2-{IO}^2
264
+ $$
265
+
266
+ $$
267
+ {IP}^2={${radius}}^2-{${offset}}^2
268
+ $$
269
+
270
+ $$
271
+ {IP}=\\sqrt{{${radius}}^2-{${offset}}^2}
272
+ $$
273
+
274
+ L'aire du rectangle section vaut donc :
275
+
276
+ $$
277
+ \\mathcal{A}_{\\text{rectangle}} = ${height} \\times IP \\approx ${getAnswer(identifiers)} \\ \\textrm{cm}^2
278
+ $$
279
+ `;
280
+ }
281
+ break;
282
+ default:
283
+ throw new Error("unsupported planeType: " + planeType);
284
+ }
285
+ };
286
+ const getCorrectionGGBOptions = (identifiers) => {
287
+ const { radius, height, offset, planeType } = identifiers;
288
+ const commands = [
289
+ ...cylinderSectionGGBCommands(radius, height, offset, false, planeType),
290
+ `SetFilling(s, 0.36)`,
291
+ ...(() => {
292
+ switch (planeType) {
293
+ case "contenant l'axe de révolution":
294
+ case "perpendiculaire à l'axe de révolution":
295
+ {
296
+ return [];
297
+ }
298
+ break;
299
+ case "parallèle à l'axe de révolution":
300
+ {
301
+ const spacePointP = getSpacePointP(radius, offset);
302
+ return [
303
+ `P = Point({${spacePointP.x.evaluate()},${spacePointP.y.evaluate()},${spacePointP.z.evaluate()}})`,
304
+ `ShowLabel(P,true)`,
305
+ //segments
306
+ `S_PI = Segment(P,I)`,
307
+ `SetColor(S_PI, "${greenMain}")`,
308
+ `SetCaption(S_PI,"$\\sqrt{${radius}^2-${offset}^2}$")`,
309
+ `ShowLabel(S_PI,true)`,
310
+ `S_IO = Segment(I,O)`,
311
+ `SetCaption(S_IO,"${offset}")`,
312
+ `ShowLabel(S_IO,true)`,
313
+ `S_OP = Segment(O,P)`,
314
+ `SetCaption(S_OP,"${radius}")`,
315
+ `ShowLabel(S_OP,true)`,
316
+ //angle
317
+ `a_OIP = Angle(O,I,P)`,
318
+ `ShowLabel(a_OIP,false)`,
319
+ ];
320
+ }
321
+ break;
322
+ default:
323
+ throw new Error("unsupported planeType: " + planeType);
324
+ }
325
+ })(),
326
+ ];
327
+ const ggb = new GeogebraConstructor({
328
+ commands,
329
+ is3D: true,
330
+ xAxis: {
331
+ hidden: true,
332
+ },
333
+ yAxis: {
334
+ hidden: true,
335
+ },
336
+ zAxis: {
337
+ hidden: false,
338
+ },
339
+ });
340
+ const xMax = radius;
341
+ const xMin = -xMax;
342
+ const yMax = radius;
343
+ const yMin = -yMax;
344
+ const zMax = radius;
345
+ const zMin = -zMax;
346
+ return ggb.getOptions({
347
+ coords: [xMin, xMax, yMin, yMax, zMin, zMax],
348
+ });
349
+ };
350
+ const getGGBOptions = (identifiers) => {
351
+ const { radius, height, offset, planeType } = identifiers;
352
+ const commands = [
353
+ ...cylinderSectionGGBCommands(radius, height, offset, true, planeType),
354
+ ];
355
+ const ggb = new GeogebraConstructor({
356
+ commands,
357
+ is3D: true,
358
+ xAxis: {
359
+ hidden: true,
360
+ },
361
+ yAxis: {
362
+ hidden: true,
363
+ },
364
+ zAxis: {
365
+ hidden: false,
366
+ },
367
+ });
368
+ const xMax = radius;
369
+ const xMin = -xMax;
370
+ const yMax = radius;
371
+ const yMin = -yMax;
372
+ const zMax = radius;
373
+ const zMin = -zMax;
374
+ return ggb.getOptions({
375
+ coords: [xMin, xMax, yMin, yMax, zMin, zMax],
376
+ });
377
+ };
378
+ const getKeys = () => {
379
+ return [];
380
+ };
381
+ const isAnswerValid = (ans, { answer }) => {
382
+ try {
383
+ const nodeAns = parseAlgebraic(ans);
384
+ const nodeAnswer = parseAlgebraic(answer);
385
+ return substract(nodeAns, nodeAnswer).evaluate() === 0;
386
+ }
387
+ catch (e) {
388
+ return handleVEAError(e);
389
+ }
390
+ };
391
+ const getPropositions = (n, { answer, ...identifiers }) => {
392
+ const { radius, height, planeType } = identifiers;
393
+ const propositions = [];
394
+ addValidProp(propositions, answer);
395
+ switch (planeType) {
396
+ case "contenant l'axe de révolution":
397
+ {
398
+ //wrong formula: radius instead of 2*radius
399
+ {
400
+ const nodeArea = multiply(height, radius);
401
+ const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
402
+ tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
403
+ }
404
+ //wrong formula: perimeter
405
+ {
406
+ const nodeCircumference = multiply(2, add(height, 2 * radius));
407
+ const nodeCircumferenceRounded = round(nodeCircumference.evaluate(), 2).toTree();
408
+ tryToAddWrongProp(propositions, nodeCircumferenceRounded.toTex());
409
+ }
410
+ //wrong formula: perimeter with radius instead of 2*radius
411
+ {
412
+ const nodeCircumference = multiply(2, add(height, radius));
413
+ const nodeCircumferenceRounded = round(nodeCircumference.evaluate(), 2).toTree();
414
+ tryToAddWrongProp(propositions, nodeCircumferenceRounded.toTex());
415
+ }
416
+ }
417
+ break;
418
+ case "perpendiculaire à l'axe de révolution":
419
+ {
420
+ //wrong formula: circumference
421
+ {
422
+ const nodeCircumference = multiply(multiply(2, PiNode), radius);
423
+ const nodeCircumferenceRounded = round(nodeCircumference.evaluate(), 2).toTree();
424
+ tryToAddWrongProp(propositions, nodeCircumferenceRounded.toTex());
425
+ }
426
+ //wrong formula: 2*radius instead of radius
427
+ {
428
+ const nodeArea = multiply(PiNode, power(2 * radius, 2));
429
+ const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
430
+ tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
431
+ }
432
+ }
433
+ break;
434
+ case "parallèle à l'axe de révolution":
435
+ {
436
+ const { offset } = identifiers;
437
+ const nodeWidthHalf = sqrt(substract(power(radius, 2), power(offset, 2)));
438
+ const nodeWidthHalfRounded = round(nodeWidthHalf.evaluate(), 2).toTree();
439
+ //stops at step1
440
+ {
441
+ tryToAddWrongProp(propositions, nodeWidthHalfRounded.toTex());
442
+ }
443
+ //wrong application of pythagore
444
+ {
445
+ const nodeWidthHalf = sqrt(add(power(radius, 2), power(offset, 2)));
446
+ const nodeArea = multiply(multiply(2, nodeWidthHalf), height);
447
+ const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
448
+ tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
449
+ }
450
+ //rounds before last step
451
+ {
452
+ const nodeArea = multiply(multiply(2, nodeWidthHalfRounded), height);
453
+ const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
454
+ tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
455
+ }
456
+ }
457
+ break;
458
+ default:
459
+ throw new Error("unsupported planeType: " + planeType);
460
+ }
461
+ propWhile(propositions, n, () => {
462
+ const identifiersWrong = (() => {
463
+ const isDiameterGiven = probaFlip(0.23);
464
+ const radius = randint(5, 21);
465
+ const height = randint(5, 21);
466
+ const offset = randint(2, Math.min(radius, height / 2.0));
467
+ const identifiers = {
468
+ radius,
469
+ height,
470
+ isDiameterGiven,
471
+ offset,
472
+ planeType,
473
+ };
474
+ return {
475
+ planeType: identifiers.planeType,
476
+ isDiameterGiven,
477
+ radius,
478
+ height,
479
+ offset,
480
+ };
481
+ })();
482
+ tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
483
+ });
484
+ return shuffleProps(propositions, n);
485
+ };
486
+ const getAreaOfCylinderSectionQuestion = (optsIn) => {
487
+ const opts = optsIn ?? optsDefault;
488
+ const planeType = random(opts.planeTypes);
489
+ const isDiameterGiven = probaFlip(0.23);
490
+ const radius = randint(5, 21);
491
+ const height = randint(5, 21);
492
+ const offset = randint(2, Math.min(radius, height / 2.0));
493
+ const identifiers = { radius, height, isDiameterGiven, offset, planeType };
494
+ return getQuestionFromIdentifiers(identifiers, opts);
495
+ };
496
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
497
+ const question = {
498
+ instruction: getInstruction(identifiers),
499
+ answer: getAnswer(identifiers),
500
+ hint: getHint(identifiers),
501
+ keys: getKeys(identifiers),
502
+ correction: getCorrection(identifiers),
503
+ ggbOptions: getGGBOptions(identifiers),
504
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
505
+ answerFormat: "tex",
506
+ identifiers,
507
+ options: opts,
508
+ };
509
+ return question;
510
+ };
511
+ const optsDefault = {
512
+ planeTypes: [
513
+ "contenant l'axe de révolution",
514
+ "perpendiculaire à l'axe de révolution",
515
+ ],
516
+ };
517
+ const options = [
518
+ {
519
+ id: "planeTypes",
520
+ label: "Type de plan pour la section",
521
+ type: GeneratorOptionType.multiselect,
522
+ target: GeneratorOptionTarget.generation,
523
+ values: [
524
+ "contenant l'axe de révolution",
525
+ "perpendiculaire à l'axe de révolution",
526
+ "parallèle à l'axe de révolution",
527
+ ],
528
+ defaultValue: optsDefault.planeTypes,
529
+ },
530
+ ];
531
+ export const areaOfCylinderSection = {
532
+ id: "areaOfCylinderSection",
533
+ connector: "=",
534
+ label: "Calculer l'aire d'une section plane de cylindre",
535
+ isSingleStep: true,
536
+ generator: (nb, opts) => getDistinctQuestions(() => getAreaOfCylinderSectionQuestion(opts), nb),
537
+ options,
538
+ qcmTimer: 60,
539
+ freeTimer: 60,
540
+ isAnswerValid,
541
+ getPropositions,
542
+ subject: "Mathématiques",
543
+ getQuestionFromIdentifiers,
544
+ getHint,
545
+ getCorrection,
546
+ hasHintAndCorrection: true,
547
+ hasGeogebra: true,
548
+ };
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ AB: number;
4
+ AD: number;
5
+ AE: number;
6
+ offset: number;
7
+ planeType: string;
8
+ };
9
+ export declare const areaOfRectangularPrismSection: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=areaOfRectangularPrismSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areaOfRectangularPrismSection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AA+KrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4OF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAiB/D,CAAC"}