math-exercises 2.2.56 → 2.2.57

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 (160) hide show
  1. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
  2. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
  3. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
  4. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  5. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  6. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  7. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
  9. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
  10. package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
  11. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
  12. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
  13. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -0
  14. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  15. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
  16. package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
  17. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts +10 -0
  18. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
  19. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
  20. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
  21. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  22. package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
  23. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
  24. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  25. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  26. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  27. package/lib/exercises/math/geometry/thales/index.js +1 -0
  28. package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
  29. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  31. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
  32. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
  34. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
  35. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
  36. package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
  37. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
  38. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
  39. package/lib/exercises/math/probaStat/binomial/binomialInequation.js +159 -0
  40. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
  41. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
  42. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
  43. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
  44. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
  45. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
  46. package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
  47. package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
  48. package/lib/exercises/math/probaStat/binomial/index.js +20 -0
  49. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
  50. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
  51. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
  52. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
  53. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
  55. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
  56. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  57. package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
  58. package/lib/exercises/math/probaStat/index.d.ts +1 -3
  59. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  60. package/lib/exercises/math/probaStat/index.js +1 -3
  61. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
  62. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  63. package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
  64. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
  65. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  66. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
  67. package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
  68. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  69. package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
  70. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  71. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
  72. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  73. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
  74. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  75. package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
  76. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
  77. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  78. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  79. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
  80. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  81. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
  82. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
  83. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  84. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
  85. package/lib/exercises/pc/mole/molarMass.js +1 -1
  86. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
  87. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  88. package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
  89. package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
  90. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  91. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  92. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  93. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  94. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  95. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
  96. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  97. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
  98. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  99. package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
  100. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  101. package/lib/exercises/utils/getDistinctQuestions.js +11 -4
  102. package/lib/index.d.ts +88 -22
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/math/geometry/CloudPoints.d.ts +5 -1
  105. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  106. package/lib/math/geometry/CloudPoints.js +5 -0
  107. package/lib/math/geometry/line.d.ts +23 -1
  108. package/lib/math/geometry/line.d.ts.map +1 -1
  109. package/lib/math/geometry/line.js +53 -2
  110. package/lib/math/geometry/point.d.ts +15 -13
  111. package/lib/math/geometry/point.d.ts.map +1 -1
  112. package/lib/math/geometry/point.js +28 -12
  113. package/lib/math/geometry/segment.d.ts +11 -1
  114. package/lib/math/geometry/segment.d.ts.map +1 -1
  115. package/lib/math/geometry/segment.js +12 -0
  116. package/lib/math/geometry/triangle.d.ts +67 -0
  117. package/lib/math/geometry/triangle.d.ts.map +1 -0
  118. package/lib/math/geometry/triangle.js +227 -0
  119. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  120. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  121. package/lib/math/numbers/rationals/rational.js +5 -0
  122. package/lib/math/polynomials/generalTrinom.d.ts +2 -2
  123. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
  124. package/lib/math/probability/binomial.d.ts +10 -0
  125. package/lib/math/probability/binomial.d.ts.map +1 -0
  126. package/lib/math/probability/binomial.js +30 -0
  127. package/lib/math/sets/intervals/intervals.d.ts +1 -1
  128. package/lib/math/systems/generalSystem.d.ts +11 -0
  129. package/lib/math/systems/generalSystem.d.ts.map +1 -0
  130. package/lib/math/systems/generalSystem.js +79 -0
  131. package/lib/playground.d.ts.map +1 -1
  132. package/lib/playground.js +1 -4
  133. package/lib/server.js +0 -2
  134. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
  135. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/inequations/inequationNode.js +1 -1
  137. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
  138. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  139. package/lib/tree/nodes/node.d.ts +2 -1
  140. package/lib/tree/nodes/node.d.ts.map +1 -1
  141. package/lib/tree/nodes/node.js +1 -0
  142. package/lib/tree/nodes/nodeConstructor.d.ts +4 -3
  143. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  144. package/lib/tree/nodes/nodeConstructor.js +4 -0
  145. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  146. package/lib/tree/nodes/operators/addNode.js +20 -8
  147. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
  148. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
  149. package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -0
  150. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  151. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  153. package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
  154. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  155. package/lib/tree/nodes/operators/operatorNode.js +1 -0
  156. package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
  157. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/sets/intervalNode.js +1 -0
  159. package/lib/utils/alea/random.d.ts.map +1 -1
  160. package/package.json +1 -1
@@ -4,7 +4,7 @@ exports.pythagoreCalcul = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
- const triangles_1 = require("../../../../math/geometry/triangles");
7
+ const triangle_1 = require("../../../../math/geometry/triangle");
8
8
  const real_1 = require("../../../../math/numbers/reals/real");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
10
  const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
@@ -17,7 +17,7 @@ const getPythagoreCalcul = () => {
17
17
  const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
18
18
  for (let i = 0; i < 3; i++)
19
19
  vertices.push(String.fromCharCode(code + i));
20
- const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({
20
+ const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
21
21
  minRapport: 0.7,
22
22
  maxRapport: 1.3,
23
23
  names: vertices,
@@ -59,6 +59,7 @@ const getPythagoreCalcul = () => {
59
59
  hideAxes: true,
60
60
  hideGrid: true,
61
61
  });
62
+ const triangleIdentifiers = triangle.toIdentifiers();
62
63
  answer = answer + "";
63
64
  const question = {
64
65
  instruction: `Dans le triangle $${triangle.getTriangleName()}$ rectangle en $${triangle.getRightAngle()}$, on sait que $${sides[randoms[0]]} = ${sideLengths[randoms[0]]}$ et que $${sides[randoms[1]]} = ${sideLengths[randoms[1]]}$. Calculer la longueur exacte $${sides[randoms[2]]}$.`,
@@ -68,7 +69,7 @@ const getPythagoreCalcul = () => {
68
69
  coords: triangle.generateCoords(),
69
70
  }),
70
71
  answerFormat: "tex",
71
- identifiers: { square, sideLengths },
72
+ identifiers: { square, sideLengths, triangleIdentifiers },
72
73
  };
73
74
  return question;
74
75
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,cAAc,gBAAgB,CAAC"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./thales"), exports);
18
+ // export * from "./thalesCalculOld";
18
19
  __exportStar(require("./thalesCalcul"), exports);
@@ -1,6 +1,13 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
2
  type Identifiers = {
3
3
  vertices: string[];
4
+ xA: number;
5
+ yA: number;
6
+ xB: number;
7
+ yB: number;
8
+ xC: number;
9
+ yC: number;
10
+ factor: number;
4
11
  };
5
12
  export declare const thales: Exercise<Identifiers>;
6
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2IF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,CAcxC,CAAC"}
1
+ {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2IF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,CAcxC,CAAC"}
@@ -72,7 +72,7 @@ const getThales = () => {
72
72
  coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
73
73
  }),
74
74
  answerFormat: "tex",
75
- identifiers: { vertices },
75
+ identifiers: { vertices, xA, yA, xB, yB, xC, yC, factor },
76
76
  };
77
77
  return question;
78
78
  };
@@ -1,10 +1,16 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point";
3
+ import { SegmentIdentifiers } from "../../../../math/geometry/segment";
4
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
2
5
  type Identifiers = {
3
- sideLengths: number[];
4
- rand: number;
5
- rand2: number;
6
- isAskingC: boolean;
6
+ triangleIdentifiers: TriangleIdentifiers;
7
+ insidePointsIdentifiers: PointIdentifiers[];
8
+ segmentAsked: SegmentIdentifiers;
9
+ isPapillon: boolean;
7
10
  };
8
- export declare const thalesCalcul: Exercise<Identifiers>;
11
+ type Options = {
12
+ configurationType: string;
13
+ };
14
+ export declare const thalesCalcul: Exercise<Identifiers, Options>;
9
15
  export {};
10
16
  //# sourceMappingURL=thalesCalcul.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmLF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
1
+ {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uBAAuB,EAAE,gBAAgB,EAAE,CAAC;IAC5C,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAsKF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAiEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvD,CAAC"}
@@ -3,149 +3,197 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.thalesCalcul = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const numberVEA_1 = require("../../../../exercises/vea/numberVEA");
6
7
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
- const rational_1 = require("../../../../math/numbers/rationals/rational");
8
+ const line_1 = require("../../../../math/geometry/line");
9
+ const point_1 = require("../../../../math/geometry/point");
10
+ const segment_1 = require("../../../../math/geometry/segment");
11
+ const triangle_1 = require("../../../../math/geometry/triangle");
12
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
8
13
  const randint_1 = require("../../../../math/utils/random/randint");
14
+ const round_1 = require("../../../../math/utils/round");
15
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
16
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
9
17
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
10
- const shuffle_1 = require("../../../../utils/alea/shuffle");
11
- const getThales = () => {
12
- const vertices = [];
13
- const code = 65 + (0, randint_1.randint)(0, 22); // Générer un code de caractère majuscule aléatoire (A-Z)
14
- for (let i = 0; i < 5; i++)
15
- vertices.push(String.fromCharCode(code + i));
16
- const [xA, yA] = [(0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11)];
17
- let xB, yB, xC, yC;
18
- let d1, d2, d3; // distance entre le point A et B
19
- let theta = 0; // angle entre AB et AC
20
- do {
21
- [xB, yB, xC, yC] = [
22
- (0, randint_1.randint)(-10, 11),
23
- (0, randint_1.randint)(-10, 11),
24
- (0, randint_1.randint)(-10, 11),
25
- (0, randint_1.randint)(-10, 11),
26
- ];
27
- d1 = Math.hypot(xB - xA, yB - yA); // Calculer la distance entre A et B
28
- d2 = Math.hypot(xC - xA, yC - yA); // Calculer la distance entre A et C
29
- theta = Math.acos(((xB - xA) * (xC - xA) + (yB - yA) * (yC - yA)) / (d1 * d2));
30
- } while (!theta ||
31
- theta < 0.35 ||
32
- theta > 2.1 ||
33
- d1 / d2 > 1.3 ||
34
- d1 / d2 < 0.7);
35
- d3 = Math.sqrt(d1 ** 2 + d2 ** 2 - 2 * d1 * d2 * Math.cos(theta)); // Calculer la distance entre C et B
36
- // CB² = AB² * AC² - 2*AB*AC*cos(theta) : pythagore généralisé
37
- const factor = (0, randint_1.randint)(-5, 6, [-2, -1, 0, 1, 2]) / 10; // facteur = AB/AE, Pour que l'affichage soit acceptable, les valeurs de factor sont +- 0.5 0.4 0.3
38
- const [xD, yD] = [xA + factor * (xB - xA), yA + factor * (yB - yA)];
39
- const [xE, yE] = [xA + factor * (xC - xA), yA + factor * (yC - yA)];
40
- const xMin = Math.min(xA, xB, xC, xD, xE);
41
- const xMax = Math.max(xA, xB, xC, xD, xE);
42
- const yMin = Math.min(yA, yB, yC, yD, yE);
43
- const yMax = Math.max(yA, yB, yC, yD, yE);
44
- // AB AC BC AD AE
45
- const sides = [
46
- `${vertices[0]}${vertices[1]}`,
47
- `${vertices[0]}${vertices[3]}`,
48
- `${vertices[0]}${vertices[2]}`,
49
- `${vertices[0]}${vertices[4]}`,
50
- `${vertices[1]}${vertices[2]}`,
51
- `${vertices[3]}${vertices[4]}`,
18
+ const random_1 = require("../../../../utils/alea/random");
19
+ const randomLetter_1 = require("../../../../utils/strings/randomLetter");
20
+ const getPropositions = (n, { answer }) => {
21
+ const propositions = [];
22
+ (0, exercise_1.addValidProp)(propositions, answer);
23
+ while (propositions.length < n) {
24
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(3, 20, 1).frenchify());
25
+ }
26
+ return (0, exercise_1.shuffleProps)(propositions, n);
27
+ };
28
+ const getAnswer = (identifiers) => {
29
+ const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
30
+ const pointD = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[0]);
31
+ const pointE = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[1]);
32
+ //order is important
33
+ const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
34
+ const segmentAskedName = segment_1.SegmentConstructor.fromIdentifiers(identifiers.segmentAsked).toInsideName();
35
+ const lengths = [
36
+ ...triangle.getSegments().map((s) => {
37
+ return {
38
+ name: s.toInsideName(),
39
+ length: (0, round_1.round)(s.getLength(), 1),
40
+ };
41
+ }),
42
+ ...subTriangle.getSegments().map((s) => {
43
+ return {
44
+ name: s.toInsideName(),
45
+ length: (0, round_1.round)(s.getLength(), 1),
46
+ };
47
+ }),
52
48
  ];
53
- // round pour avoir des valeurs dans N tout en gardant les proportions pour que ça soit cohérent. sides[i] a pour longueur sideLengths[i]
54
- const sideLengths = [d1, factor * d1, d2, factor * d2, d3, factor * d3].map((el) => Math.round(Math.abs(el)));
55
- const rand = (0, randint_1.randint)(0, 3);
56
- let rand2 = (0, randint_1.randint)(0, 3, [rand]);
57
- if (sideLengths[2 * rand] === sideLengths[2 * rand2])
58
- rand2 = (0, randint_1.randint)(0, 3, [rand, rand2]); // condition pour pas prendre 2 longueurs identiques
59
- let instruction = `Dans la figure ci-dessous, on a $(${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]})$, `;
60
- let statement;
61
- let startStatement;
62
- const isAskingC = (0, coinFlip_1.coinFlip)();
63
- if (isAskingC) {
64
- // a/b = c/d on cherche c
65
- instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${sides[2 * rand + 1]} = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2]} = ${sideLengths[2 * rand2]}$. Déterminer $${sides[2 * rand2 + 1]}$.`;
66
- startStatement = `${sides[2 * rand2 + 1]}`;
67
- statement = new rational_1.Rational(sideLengths[2 * rand2] * sideLengths[2 * rand + 1], sideLengths[2 * rand])
68
- .simplify()
69
- .toTree();
49
+ const askedIndex = lengths.findIndex((l) => l.name === segmentAskedName);
50
+ const otherIndex = (0, randint_1.randint)(0, 3, [askedIndex]);
51
+ const ratio = (0, fractionNode_1.frac)(lengths[otherIndex].length, lengths[otherIndex + 3].length);
52
+ if (askedIndex > 2) {
53
+ return (0, round_1.round)((0, fractionNode_1.frac)(lengths[askedIndex - 3].length, ratio).evaluate(), 1).frenchify();
70
54
  }
71
55
  else {
72
- // a/b = c/d on cherche d
73
- instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${sides[2 * rand + 1]} = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2 + 1]} = ${sideLengths[2 * rand2 + 1]}$. Déterminer $${sides[2 * rand2]}$.`;
74
- startStatement = `${sides[2 * rand2]}`;
75
- statement = new rational_1.Rational(sideLengths[2 * rand2 + 1] * sideLengths[2 * rand], sideLengths[2 * rand + 1])
76
- .simplify()
77
- .toTree();
56
+ return (0, round_1.round)((0, multiplyNode_1.multiply)(ratio, lengths[askedIndex + 3].length).evaluate(), 1).frenchify();
78
57
  }
58
+ };
59
+ const getInstruction = (identifiers) => {
60
+ const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
61
+ const pointD = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[0]);
62
+ const pointE = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[1]);
63
+ const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
64
+ const oppositeSegment = triangle.getSideBName();
65
+ const insideSegmentName = identifiers.insidePointsIdentifiers[0].name +
66
+ identifiers.insidePointsIdentifiers[1].name;
67
+ const segmentAskedName = segment_1.SegmentConstructor.fromIdentifiers(identifiers.segmentAsked).toInsideName();
68
+ const lengths = [
69
+ ...triangle.getSegments().map((s) => {
70
+ return {
71
+ name: s.toInsideName(),
72
+ length: (0, round_1.round)(s.getLength(), 1).frenchify(),
73
+ };
74
+ }),
75
+ ...subTriangle.getSegments().map((s) => {
76
+ return {
77
+ name: s.toInsideName(),
78
+ length: (0, round_1.round)(s.getLength(), 1).frenchify(),
79
+ };
80
+ }),
81
+ ];
82
+ return `Dans le triangle $${triangle.getTriangleName()}$ ci-dessous, les droites $\\left(${insideSegmentName}\\right)$ et $\\left(${oppositeSegment}\\right)$ sont parallèles.
83
+
84
+ On sait de plus que : ${lengths
85
+ .filter((e) => e.name !== segmentAskedName)
86
+ .map((e) => `$${e.name}=${e.length}$`)
87
+ .join(" , ")}.
88
+
89
+ Calculer $${segmentAskedName}$ (arrondir aux dixième).`;
90
+ };
91
+ // const getHint : GetHint<Identifiers> = (identifiers)=>{
92
+ // }
93
+ // const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
94
+ // }
95
+ const getGGBOptions = (identifiers) => {
96
+ const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
97
+ const points = identifiers.insidePointsIdentifiers.map((d) => point_1.PointConstructor.fromIdentifiers(d));
98
+ const subTriangle = new triangle_1.Triangle(points[0], triangle.vertexB, points[1]);
99
+ const seg = new segment_1.Segment(points[0], points[1]);
79
100
  const commands = [
80
- `${vertices[0]} = Point({${xA}, ${yA}})`,
81
- `${vertices[1]} = Point({${xB}, ${yB}})`,
82
- `${vertices[2]} = Point({${xC}, ${yC}})`,
83
- `${vertices[3]} = Point(${vertices[0]}, Vector(${factor}Vector(${vertices[0]},${vertices[1]})))`,
84
- `${vertices[4]} = Intersect(Line(${vertices[3]}, Line(${vertices[1]}, ${vertices[2]})) , Line(${vertices[0]}, ${vertices[2]}))`,
85
- `l = Segment(${vertices[0]}, ${vertices[1]})`,
86
- `i = Segment(${vertices[0]}, ${vertices[2]})`,
87
- `j = Segment(${vertices[1]}, ${vertices[2]})`,
88
- `k = Segment(${vertices[3]}, ${vertices[4]})`,
89
- `If(${factor} < 0, Segment(${vertices[0]}, ${vertices[3]}))`,
90
- `If(${factor} < 0, Segment(${vertices[0]}, ${vertices[4]}))`,
91
- `ShowLabel(${vertices[0]}, true)`,
92
- `ShowLabel(${vertices[1]}, true)`,
93
- `ShowLabel(${vertices[2]}, true)`,
94
- `ShowLabel(${vertices[3]}, true)`,
95
- `ShowLabel(${vertices[4]}, true)`,
101
+ ...triangle.generateCommands({}),
102
+ ...points.flatMap((p) => p.toGGBCommand({ style: 0, color: "#444444", size: 4 })),
103
+ ...seg.toGGBCommands(false),
96
104
  ];
105
+ if (identifiers.isPapillon) {
106
+ commands.push(...new segment_1.Segment(points[0], triangle.vertexB).toGGBCommands(false));
107
+ commands.push(...new segment_1.Segment(points[1], triangle.vertexB).toGGBCommands(false));
108
+ }
97
109
  const ggb = new geogebraConstructor_1.GeogebraConstructor({
98
110
  commands,
99
111
  hideAxes: true,
100
112
  hideGrid: true,
101
113
  });
102
- const answer = statement.toTex();
114
+ let coords = triangle.generateCoords();
115
+ if (identifiers.isPapillon) {
116
+ const subCoords = subTriangle.generateCoords();
117
+ coords = [
118
+ Math.min(subCoords[0], coords[0]),
119
+ Math.max(subCoords[1], coords[1]),
120
+ Math.min(subCoords[2], coords[2]),
121
+ Math.max(subCoords[3], coords[3]),
122
+ ];
123
+ }
124
+ return ggb.getOptions({
125
+ coords: coords,
126
+ });
127
+ };
128
+ const getKeys = (identifiers) => {
129
+ return [];
130
+ };
131
+ const isAnswerValid = (ans, { answer }) => {
132
+ return (0, numberVEA_1.numberVEA)(ans, answer);
133
+ };
134
+ const options = [
135
+ {
136
+ id: "configurationType",
137
+ label: "Types de figure",
138
+ defaultValue: "Toutes",
139
+ values: ["Toutes", "Uniquement papillon", "Uniquement non papillon"],
140
+ target: exercise_1.GeneratorOptionTarget.generation,
141
+ type: exercise_1.GeneratorOptionType.select,
142
+ },
143
+ ];
144
+ const getThalesFindSideQuestion = (opts) => {
145
+ const summitNames = triangle_1.TriangleConstructor.randomName();
146
+ const triangle = triangle_1.TriangleConstructor.createRandomTriangle({
147
+ names: summitNames,
148
+ });
149
+ const isPapillon = !opts || opts?.configurationType === "Toutes"
150
+ ? (0, coinFlip_1.coinFlip)()
151
+ : opts.configurationType === "Uniquement papillon"
152
+ ? true
153
+ : false;
154
+ const pointD = point_1.PointConstructor.onSegment(triangle.vertexA, triangle.vertexB, (0, randomLetter_1.randomLetter)(true, summitNames), isPapillon ? { coefficient: (0, randfloat_1.randfloat)(1.2, 1.8) } : { spacing: 0.2 });
155
+ const line = new line_1.Line(triangle.vertexA, triangle.vertexC);
156
+ const parallel = line.getParallele(pointD);
157
+ const intersectLine = new line_1.Line(triangle.vertexB, triangle.vertexC);
158
+ const pointE = parallel.intersect(intersectLine, (0, randomLetter_1.randomLetter)(true, [...summitNames, pointD.name]));
159
+ const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
160
+ const segmentAsked = (0, random_1.random)([
161
+ ...triangle.getSegments(),
162
+ ...subTriangle.getSegments(),
163
+ ]);
164
+ const identifiers = {
165
+ triangleIdentifiers: triangle.toIdentifiers(),
166
+ insidePointsIdentifiers: [pointD.toIdentifiers(), pointE.toIdentifiers()],
167
+ segmentAsked: segmentAsked.toIdentifiers(),
168
+ isPapillon,
169
+ };
103
170
  const question = {
104
- instruction,
105
- startStatement,
106
- answer,
107
- keys: [],
108
- ggbOptions: ggb.getOptions({
109
- coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
110
- }),
171
+ answer: getAnswer(identifiers),
172
+ instruction: getInstruction(identifiers),
173
+ keys: getKeys(identifiers),
111
174
  answerFormat: "tex",
112
- identifiers: { isAskingC, rand, rand2, sideLengths },
175
+ identifiers,
176
+ // hint: getHint(identifiers),
177
+ // correction: getCorrection(identifiers),
178
+ ggbOptions: getGGBOptions(identifiers),
113
179
  };
114
180
  return question;
115
181
  };
116
- const getPropositions = (n, { answer }) => {
117
- const propositions = [];
118
- (0, exercise_1.addValidProp)(propositions, answer);
119
- while (propositions.length < n) {
120
- (0, exercise_1.tryToAddWrongProp)(propositions, new rational_1.Rational((0, randint_1.randint)(2, 30), (0, randint_1.randint)(2, 30)).simplify().toTree().toTex());
121
- }
122
- return (0, shuffle_1.shuffle)(propositions);
123
- };
124
- const isAnswerValid = (ans, { isAskingC, rand, rand2, sideLengths }) => {
125
- let answer;
126
- if (isAskingC)
127
- answer = new rational_1.Rational(sideLengths[2 * rand2] * sideLengths[2 * rand + 1], sideLengths[2 * rand])
128
- .simplify()
129
- .toTree();
130
- else
131
- answer = new rational_1.Rational(sideLengths[2 * rand2 + 1] * sideLengths[2 * rand], sideLengths[2 * rand + 1])
132
- .simplify()
133
- .toTree();
134
- const texs = answer.toAllValidTexs({ allowFractionToDecimal: true });
135
- return texs.includes(ans);
136
- };
137
182
  exports.thalesCalcul = {
138
183
  id: "thalesCalcul",
139
184
  connector: "=",
140
- label: "Utiliser le théoreme de Thalès pour faire des calculs",
141
- levels: ["5ème", "4ème", "3ème", "2nde"],
142
- isSingleStep: false,
143
- sections: ["Théorème de Thalès", "Géométrie euclidienne"],
144
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getThales, nb),
185
+ label: "Utiliser le théoreme de Thalès calculer un côté",
186
+ isSingleStep: true,
187
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getThalesFindSideQuestion(opts), nb),
145
188
  qcmTimer: 60,
146
189
  freeTimer: 60,
147
190
  getPropositions,
148
191
  isAnswerValid,
149
- hasGeogebra: true,
150
192
  subject: "Mathématiques",
193
+ // getHint,
194
+ // getCorrection,
195
+ getAnswer,
196
+ getGGBOptions,
197
+ options,
198
+ hasGeogebra: true,
151
199
  };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=thalesCalculOld.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thalesCalculOld.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalculOld.ts"],"names":[],"mappings":""}
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ // import {
3
+ // Exercise,
4
+ // Proposition,
5
+ // QCMGenerator,
6
+ // Question,
7
+ // QuestionGenerator,
8
+ // VEA,
9
+ // addValidProp,
10
+ // tryToAddWrongProp,
11
+ // } from "../../../../exercises/exercise";
12
+ // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions";
13
+ // import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor";
14
+ // import { Rational } from "../../../../math/numbers/rationals/rational";
15
+ // import { randint } from "../../../../math/utils/random/randint";
16
+ // import { Node } from "../../../../tree/nodes/node";
17
+ // import { coinFlip } from "../../../../utils/alea/coinFlip";
18
+ // import { shuffle } from "../../../../utils/alea/shuffle";
19
+ // type Identifiers = {
20
+ // sideLengths: number[];
21
+ // rand: number;
22
+ // rand2: number;
23
+ // isAskingC: boolean;
24
+ // xA: number;
25
+ // yA: number;
26
+ // xB: number;
27
+ // yB: number;
28
+ // xC: number;
29
+ // yC: number;
30
+ // factor: number;
31
+ // };
32
+ // const getThales: QuestionGenerator<Identifiers> = () => {
33
+ // const vertices = [];
34
+ // const code = 65 + randint(0, 22); // Générer un code de caractère majuscule aléatoire (A-Z)
35
+ // for (let i = 0; i < 5; i++) vertices.push(String.fromCharCode(code + i));
36
+ // const [xA, yA] = [randint(-10, 11), randint(-10, 11)];
37
+ // let xB, yB, xC, yC;
38
+ // let d1, d2, d3; // distance entre le point A et B
39
+ // let theta = 0; // angle entre AB et AC
40
+ // do {
41
+ // [xB, yB, xC, yC] = [
42
+ // randint(-10, 11),
43
+ // randint(-10, 11),
44
+ // randint(-10, 11),
45
+ // randint(-10, 11),
46
+ // ];
47
+ // d1 = Math.hypot(xB - xA, yB - yA); // Calculer la distance entre A et B
48
+ // d2 = Math.hypot(xC - xA, yC - yA); // Calculer la distance entre A et C
49
+ // theta = Math.acos(
50
+ // ((xB - xA) * (xC - xA) + (yB - yA) * (yC - yA)) / (d1 * d2),
51
+ // );
52
+ // } while (
53
+ // !theta ||
54
+ // theta < 0.35 ||
55
+ // theta > 2.1 ||
56
+ // d1 / d2 > 1.3 ||
57
+ // d1 / d2 < 0.7
58
+ // );
59
+ // d3 = Math.sqrt(d1 ** 2 + d2 ** 2 - 2 * d1 * d2 * Math.cos(theta)); // Calculer la distance entre C et B
60
+ // // CB² = AB² * AC² - 2*AB*AC*cos(theta) : pythagore généralisé
61
+ // const factor = randint(-5, 6, [-2, -1, 0, 1, 2]) / 10; // facteur = AB/AE, Pour que l'affichage soit acceptable, les valeurs de factor sont +- 0.5 0.4 0.3
62
+ // const [xD, yD] = [xA + factor * (xB - xA), yA + factor * (yB - yA)];
63
+ // const [xE, yE] = [xA + factor * (xC - xA), yA + factor * (yC - yA)];
64
+ // const xMin = Math.min(xA, xB, xC, xD, xE);
65
+ // const xMax = Math.max(xA, xB, xC, xD, xE);
66
+ // const yMin = Math.min(yA, yB, yC, yD, yE);
67
+ // const yMax = Math.max(yA, yB, yC, yD, yE);
68
+ // // AB AC BC AD AE
69
+ // const sides = [
70
+ // `${vertices[0]}${vertices[1]}`,
71
+ // `${vertices[0]}${vertices[3]}`,
72
+ // `${vertices[0]}${vertices[2]}`,
73
+ // `${vertices[0]}${vertices[4]}`,
74
+ // `${vertices[1]}${vertices[2]}`,
75
+ // `${vertices[3]}${vertices[4]}`,
76
+ // ];
77
+ // // round pour avoir des valeurs dans N tout en gardant les proportions pour que ça soit cohérent. sides[i] a pour longueur sideLengths[i]
78
+ // const sideLengths = [d1, factor * d1, d2, factor * d2, d3, factor * d3].map(
79
+ // (el) => Math.round(Math.abs(el)),
80
+ // );
81
+ // const rand = randint(0, 3);
82
+ // let rand2 = randint(0, 3, [rand]);
83
+ // if (sideLengths[2 * rand] === sideLengths[2 * rand2])
84
+ // rand2 = randint(0, 3, [rand, rand2]); // condition pour pas prendre 2 longueurs identiques
85
+ // let instruction = `Dans la figure ci-dessous, on a $(${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]})$, `;
86
+ // let statement: Node;
87
+ // let startStatement;
88
+ // const isAskingC = coinFlip();
89
+ // if (isAskingC) {
90
+ // // a/b = c/d on cherche c
91
+ // instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${
92
+ // sides[2 * rand + 1]
93
+ // } = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2]} = ${
94
+ // sideLengths[2 * rand2]
95
+ // }$. Déterminer $${sides[2 * rand2 + 1]}$.`;
96
+ // startStatement = `${sides[2 * rand2 + 1]}`;
97
+ // statement = new Rational(
98
+ // sideLengths[2 * rand2] * sideLengths[2 * rand + 1],
99
+ // sideLengths[2 * rand],
100
+ // )
101
+ // .simplify()
102
+ // .toTree();
103
+ // } else {
104
+ // // a/b = c/d on cherche d
105
+ // instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${
106
+ // sides[2 * rand + 1]
107
+ // } = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2 + 1]} = ${
108
+ // sideLengths[2 * rand2 + 1]
109
+ // }$. Déterminer $${sides[2 * rand2]}$.`;
110
+ // startStatement = `${sides[2 * rand2]}`;
111
+ // statement = new Rational(
112
+ // sideLengths[2 * rand2 + 1] * sideLengths[2 * rand],
113
+ // sideLengths[2 * rand + 1],
114
+ // )
115
+ // .simplify()
116
+ // .toTree();
117
+ // }
118
+ // const commands = [
119
+ // `${vertices[0]} = Point({${xA}, ${yA}})`,
120
+ // `${vertices[1]} = Point({${xB}, ${yB}})`,
121
+ // `${vertices[2]} = Point({${xC}, ${yC}})`,
122
+ // `${vertices[3]} = Point(${vertices[0]}, Vector(${factor}Vector(${vertices[0]},${vertices[1]})))`,
123
+ // `${vertices[4]} = Intersect(Line(${vertices[3]}, Line(${vertices[1]}, ${vertices[2]})) , Line(${vertices[0]}, ${vertices[2]}))`,
124
+ // `l = Segment(${vertices[0]}, ${vertices[1]})`,
125
+ // `i = Segment(${vertices[0]}, ${vertices[2]})`,
126
+ // `j = Segment(${vertices[1]}, ${vertices[2]})`,
127
+ // `k = Segment(${vertices[3]}, ${vertices[4]})`,
128
+ // `If(${factor} < 0, Segment(${vertices[0]}, ${vertices[3]}))`,
129
+ // `If(${factor} < 0, Segment(${vertices[0]}, ${vertices[4]}))`,
130
+ // `ShowLabel(${vertices[0]}, true)`,
131
+ // `ShowLabel(${vertices[1]}, true)`,
132
+ // `ShowLabel(${vertices[2]}, true)`,
133
+ // `ShowLabel(${vertices[3]}, true)`,
134
+ // `ShowLabel(${vertices[4]}, true)`,
135
+ // ];
136
+ // const ggb = new GeogebraConstructor({
137
+ // commands,
138
+ // hideAxes: true,
139
+ // hideGrid: true,
140
+ // });
141
+ // const answer = statement.toTex();
142
+ // const question: Question<Identifiers> = {
143
+ // instruction,
144
+ // startStatement,
145
+ // answer,
146
+ // keys: [],
147
+ // ggbOptions: ggb.getOptions({
148
+ // coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
149
+ // }),
150
+ // answerFormat: "tex",
151
+ // identifiers: {
152
+ // isAskingC,
153
+ // rand,
154
+ // rand2,
155
+ // sideLengths,
156
+ // xA,
157
+ // yA,
158
+ // xB,
159
+ // yB,
160
+ // xC,
161
+ // yC,
162
+ // factor,
163
+ // },
164
+ // };
165
+ // return question;
166
+ // };
167
+ // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
168
+ // const propositions: Proposition[] = [];
169
+ // addValidProp(propositions, answer);
170
+ // while (propositions.length < n) {
171
+ // tryToAddWrongProp(
172
+ // propositions,
173
+ // new Rational(randint(2, 30), randint(2, 30)).simplify().toTree().toTex(),
174
+ // );
175
+ // }
176
+ // return shuffle(propositions);
177
+ // };
178
+ // const isAnswerValid: VEA<Identifiers> = (
179
+ // ans,
180
+ // { isAskingC, rand, rand2, sideLengths },
181
+ // ) => {
182
+ // let answer: Node;
183
+ // if (isAskingC)
184
+ // answer = new Rational(
185
+ // sideLengths[2 * rand2] * sideLengths[2 * rand + 1],
186
+ // sideLengths[2 * rand],
187
+ // )
188
+ // .simplify()
189
+ // .toTree();
190
+ // else
191
+ // answer = new Rational(
192
+ // sideLengths[2 * rand2 + 1] * sideLengths[2 * rand],
193
+ // sideLengths[2 * rand + 1],
194
+ // )
195
+ // .simplify()
196
+ // .toTree();
197
+ // const texs = answer.toAllValidTexs({ allowFractionToDecimal: true });
198
+ // return texs.includes(ans);
199
+ // };
200
+ // export const thalesCalcul: Exercise<Identifiers> = {
201
+ // id: "thalesCalcul",
202
+ // connector: "=",
203
+ // label: "Utiliser le théoreme de Thalès pour faire des calculs",
204
+ // levels: ["5ème", "4ème", "3ème", "2nde"],
205
+ // isSingleStep: false,
206
+ // sections: ["Théorème de Thalès", "Géométrie euclidienne"],
207
+ // generator: (nb: number) => getDistinctQuestions(getThales, nb),
208
+ // qcmTimer: 60,
209
+ // freeTimer: 60,
210
+ // getPropositions,
211
+ // isAnswerValid,
212
+ // hasGeogebra: true,
213
+ // subject: "Mathématiques",
214
+ // };