math-exercises 2.2.68 → 2.2.70

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 (210) hide show
  1. package/lib/exercises/math/calcul/arithmetics/divisorsList.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/divisorsList.js +2 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +2 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +1 -0
  7. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +3 -6
  9. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  10. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +3 -8
  11. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +7 -9
  13. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +6 -19
  15. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts +8 -0
  16. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -0
  17. package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +146 -0
  18. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  19. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  21. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts +9 -0
  22. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -0
  23. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +175 -0
  24. package/lib/exercises/math/functions/absolute/index.d.ts +1 -0
  25. package/lib/exercises/math/functions/absolute/index.d.ts.map +1 -1
  26. package/lib/exercises/math/functions/absolute/index.js +1 -0
  27. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +3 -3
  28. package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts +2 -2
  29. package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts.map +1 -1
  30. package/lib/exercises/math/functions/trinoms/findSecondRoot.js +5 -5
  31. package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts +2 -2
  32. package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts.map +1 -1
  33. package/lib/exercises/math/functions/trinoms/rootsProduct.js +7 -7
  34. package/lib/exercises/math/functions/trinoms/rootsSum.d.ts +2 -2
  35. package/lib/exercises/math/functions/trinoms/rootsSum.d.ts.map +1 -1
  36. package/lib/exercises/math/functions/trinoms/rootsSum.js +9 -10
  37. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +6 -6
  38. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +3 -1
  39. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  40. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +10 -22
  41. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +6 -1
  42. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  43. package/lib/exercises/math/geometry/areas/triangleArea.js +34 -48
  44. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
  45. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +4 -1
  46. package/lib/exercises/math/geometry/index.d.ts +1 -0
  47. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/index.js +1 -0
  49. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +0 -3
  51. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/pythagore/pythagore.js +19 -25
  53. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -2
  54. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +30 -65
  56. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
  57. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -0
  58. package/lib/exercises/math/geometry/quadrilaterals/index.js +17 -0
  59. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +14 -0
  60. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -0
  61. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +221 -0
  62. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  63. package/lib/exercises/math/geometry/thales/index.js +0 -1
  64. package/lib/exercises/math/geometry/thales/thales.js +2 -2
  65. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +3 -4
  66. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  67. package/lib/exercises/math/geometry/thales/thalesCalcul.js +69 -78
  68. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  69. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +4 -3
  70. package/lib/exercises/math/geometry/volumes/sphereVolume.js +1 -1
  71. package/lib/exercises/math/trigonometry/trigonometry.d.ts +2 -3
  72. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  73. package/lib/exercises/math/trigonometry/trigonometry.js +32 -31
  74. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +3 -2
  75. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  76. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +18 -28
  77. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +5 -4
  78. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  79. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +60 -56
  80. package/lib/exercises/pc/index.d.ts +0 -4
  81. package/lib/exercises/pc/index.d.ts.map +1 -1
  82. package/lib/exercises/pc/index.js +6 -4
  83. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  84. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  85. package/lib/exercises/vea/equationVEA.d.ts +2 -0
  86. package/lib/exercises/vea/equationVEA.d.ts.map +1 -0
  87. package/lib/exercises/vea/equationVEA.js +24 -0
  88. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  89. package/lib/exercises/vea/sqrtVEA.d.ts +6 -0
  90. package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -0
  91. package/lib/exercises/vea/sqrtVEA.js +30 -0
  92. package/lib/geogebra/geogebraConstructor.d.ts +2 -0
  93. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  94. package/lib/geogebra/geogebraConstructor.js +7 -0
  95. package/lib/index.d.ts +31 -46
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/math/complex/complex.d.ts +1 -1
  98. package/lib/math/geometry/angle.d.ts +26 -0
  99. package/lib/math/geometry/angle.d.ts.map +1 -0
  100. package/lib/math/geometry/angle.js +73 -0
  101. package/lib/math/geometry/line.d.ts +5 -1
  102. package/lib/math/geometry/line.d.ts.map +1 -1
  103. package/lib/math/geometry/line.js +17 -0
  104. package/lib/math/geometry/parallelogram.d.ts +23 -0
  105. package/lib/math/geometry/parallelogram.d.ts.map +1 -0
  106. package/lib/math/geometry/parallelogram.js +70 -0
  107. package/lib/math/geometry/point.d.ts +3 -0
  108. package/lib/math/geometry/point.d.ts.map +1 -1
  109. package/lib/math/geometry/point.js +16 -0
  110. package/lib/math/geometry/quadrilateral.d.ts +15 -0
  111. package/lib/math/geometry/quadrilateral.d.ts.map +1 -0
  112. package/lib/math/geometry/quadrilateral.js +38 -0
  113. package/lib/math/geometry/rectangle.d.ts +24 -0
  114. package/lib/math/geometry/rectangle.d.ts.map +1 -0
  115. package/lib/math/geometry/rectangle.js +64 -0
  116. package/lib/math/geometry/rhombus.d.ts +19 -0
  117. package/lib/math/geometry/rhombus.d.ts.map +1 -0
  118. package/lib/math/geometry/rhombus.js +46 -0
  119. package/lib/math/geometry/rightTriangle.d.ts +31 -0
  120. package/lib/math/geometry/rightTriangle.d.ts.map +1 -0
  121. package/lib/math/geometry/rightTriangle.js +113 -0
  122. package/lib/math/geometry/segment.d.ts +24 -6
  123. package/lib/math/geometry/segment.d.ts.map +1 -1
  124. package/lib/math/geometry/segment.js +70 -4
  125. package/lib/math/geometry/square.d.ts +22 -0
  126. package/lib/math/geometry/square.d.ts.map +1 -0
  127. package/lib/math/geometry/square.js +43 -0
  128. package/lib/math/geometry/triangle.d.ts +45 -45
  129. package/lib/math/geometry/triangle.d.ts.map +1 -1
  130. package/lib/math/geometry/triangle.js +159 -186
  131. package/lib/math/geometry/vector.d.ts +2 -2
  132. package/lib/math/geometry/vector.d.ts.map +1 -1
  133. package/lib/math/geometry/vector.js +18 -9
  134. package/lib/math/numbers/nombre.d.ts +5 -0
  135. package/lib/math/numbers/nombre.d.ts.map +1 -1
  136. package/lib/math/numbers/nombre.js +12 -0
  137. package/lib/math/numbers/rationals/rational.d.ts +1 -1
  138. package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -1
  139. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  140. package/lib/math/numbers/reals/real.js +3 -0
  141. package/lib/math/polynomials/generalAffine.d.ts +13 -0
  142. package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
  143. package/lib/math/polynomials/generalAffine.js +25 -1
  144. package/lib/math/polynomials/polynomial.d.ts +1 -1
  145. package/lib/math/polynomials/trinom.d.ts +2 -2
  146. package/lib/math/utils/geometry/pythagoricianTriplets.d.ts +1 -0
  147. package/lib/math/utils/geometry/pythagoricianTriplets.d.ts.map +1 -1
  148. package/lib/math/utils/geometry/pythagoricianTriplets.js +14 -1
  149. package/lib/math/utils/random/randfloat.d.ts +1 -1
  150. package/lib/math/utils/random/randfloat.d.ts.map +1 -1
  151. package/lib/math/utils/random/randfloat.js +8 -1
  152. package/lib/math/utils/random/randint.d.ts +8 -1
  153. package/lib/math/utils/random/randint.d.ts.map +1 -1
  154. package/lib/math/utils/random/randint.js +6 -1
  155. package/lib/playground.d.ts.map +1 -1
  156. package/lib/tree/nodes/functions/absNode.d.ts +2 -1
  157. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/functions/absNode.js +6 -1
  159. package/lib/tree/nodes/functions/functionNode.d.ts +2 -2
  160. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  161. package/lib/tree/nodes/functions/oppositeNode.d.ts +5 -5
  162. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  163. package/lib/tree/nodes/node.d.ts +3 -1
  164. package/lib/tree/nodes/node.d.ts.map +1 -1
  165. package/lib/tree/nodes/node.js +1 -0
  166. package/lib/tree/nodes/nodeConstructor.d.ts +3 -0
  167. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  168. package/lib/tree/nodes/nodeConstructor.js +9 -1
  169. package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
  170. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  171. package/lib/tree/nodes/numbers/numberNode.js +6 -1
  172. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  173. package/lib/tree/nodes/operators/addNode.js +2 -1
  174. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  175. package/lib/tree/nodes/operators/fractionNode.js +6 -1
  176. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  177. package/lib/tree/nodes/operators/multiplyNode.js +3 -3
  178. package/lib/tree/nodes/polynomials/trinomNode.d.ts +70 -0
  179. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -0
  180. package/lib/tree/nodes/polynomials/trinomNode.js +156 -0
  181. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  182. package/lib/tree/nodes/variables/variableNode.js +1 -1
  183. package/lib/tree/parsers/affineParser.d.ts.map +1 -1
  184. package/lib/tree/parsers/affineParser.js +1 -0
  185. package/lib/tree/parsers/discreteSetParser.d.ts +3 -0
  186. package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -0
  187. package/lib/tree/parsers/discreteSetParser.js +23 -0
  188. package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
  189. package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
  190. package/lib/tree/parsers/equationSolutionParser.js +15 -4
  191. package/lib/tree/parsers/latexParser.d.ts +5 -1
  192. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  193. package/lib/tree/parsers/latexParser.js +17 -3
  194. package/lib/tree/parsers/monomParser.js +2 -2
  195. package/lib/tree/parsers/powerParser.d.ts +1 -1
  196. package/lib/tree/parsers/rationalParser.d.ts +1 -1
  197. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  198. package/lib/tree/parsers/rationalParser.js +29 -24
  199. package/lib/tree/parsers/sqrtParser.d.ts +9 -0
  200. package/lib/tree/parsers/sqrtParser.d.ts.map +1 -0
  201. package/lib/tree/parsers/sqrtParser.js +52 -0
  202. package/lib/tree/parsers/trinomParser.d.ts +1 -1
  203. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  204. package/lib/tree/parsers/trinomParser.js +14 -2
  205. package/lib/tree/utilities/functionComposition.d.ts +1 -1
  206. package/lib/tree/utilities/functionComposition.d.ts.map +1 -1
  207. package/lib/utils/arrays/rotation.d.ts +8 -0
  208. package/lib/utils/arrays/rotation.d.ts.map +1 -0
  209. package/lib/utils/arrays/rotation.js +17 -0
  210. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
4
4
  type Identifiers = {
5
- trinomIdentifiers: GeneralTrinomIdentifiers;
5
+ trinomIdentifiers: TrinomNodeIdentifiers;
6
6
  firstRootIdentifiers: NodeIdentifiers;
7
7
  };
8
8
  export declare const findSecondRoot: Exercise<Identifiers>;
@@ -1 +1 @@
1
- {"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
1
+ {"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
@@ -4,7 +4,7 @@ exports.findSecondRoot = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
10
  const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
@@ -21,7 +21,7 @@ const getPropositions = (n, { answer }) => {
21
21
  };
22
22
  const getAnswer = (identifiers) => {
23
23
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
24
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
24
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
25
25
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
26
26
  const firstRootTex = firstRoot.toTex();
27
27
  const roots = trinom.getRoots().map((e) => e.toTex());
@@ -29,7 +29,7 @@ const getAnswer = (identifiers) => {
29
29
  };
30
30
  const getInstruction = (identifiers) => {
31
31
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
32
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
32
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
33
33
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
34
34
  const firstRootTex = firstRoot.toTex();
35
35
  return `Soit $f$ la fonction polynôme du second degré définie sur $\\mathbb{R}$ par :
@@ -54,7 +54,7 @@ En remplaçant les valeurs par celles données dans l'énoncé, on peut détermi
54
54
  };
55
55
  const getCorrection = (identifiers) => {
56
56
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
57
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
57
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
58
58
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
59
59
  const cOverA = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify();
60
60
  return `On sait que le produit des racines $x_1$ et $x_2$ de $f$ vaut :
@@ -95,7 +95,7 @@ const getFindSecondRootQuestion = (ops) => {
95
95
  //first*second = c/a
96
96
  const identifiers = {
97
97
  firstRootIdentifiers: firstRoot.toTree().toIdentifiers(),
98
- trinomIdentifiers: new generalTrinom_1.GeneralTrinom(a, b, c).toIdentifiers(),
98
+ trinomIdentifiers: new trinomNode_1.TrinomNode(a, b, c).toIdentifiers(),
99
99
  };
100
100
  const question = {
101
101
  answer: getAnswer(identifiers),
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  type Identifiers = {
4
- trinomIdentifiers: GeneralTrinomIdentifiers;
4
+ trinomIdentifiers: TrinomNodeIdentifiers;
5
5
  };
6
6
  export declare const rootsProduct: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAO9C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -4,7 +4,7 @@ exports.rootsProduct = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
10
  const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
12
  const getPropositions = (n, { answer, trinomIdentifiers }) => {
13
13
  const propositions = [];
14
14
  (0, exercise_1.addValidProp)(propositions, answer);
15
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
15
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
16
16
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex());
17
17
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.c), trinom.a).simplify().toTex());
18
18
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
23
23
  };
24
24
  const getAnswer = (identifiers) => {
25
25
  const { trinomIdentifiers } = identifiers;
26
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
26
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
27
27
  const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex();
28
28
  return ans;
29
29
  };
30
30
  const getInstruction = (identifiers) => {
31
31
  const { trinomIdentifiers } = identifiers;
32
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
32
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
33
33
  return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
34
34
 
35
35
  $$
@@ -49,7 +49,7 @@ $$`;
49
49
  };
50
50
  const getCorrection = (identifiers) => {
51
51
  const { trinomIdentifiers } = identifiers;
52
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
52
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
53
53
  const aTex = trinom.a.toTex();
54
54
  const cTex = trinom.c.toTex();
55
55
  const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a);
@@ -77,8 +77,8 @@ const getRootsProductQuestion = (ops) => {
77
77
  //ac <= 0
78
78
  const a = (0, randint_1.randint)(-10, 10, [0]);
79
79
  const b = (0, randint_1.randint)(-10, 10);
80
- const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 10, !b ? [0] : []);
81
- const trinom = new generalTrinom_1.GeneralTrinom(a, b, c);
80
+ const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
81
+ const trinom = new trinomNode_1.TrinomNode(a, b, c);
82
82
  const identifiers = {
83
83
  trinomIdentifiers: trinom.toIdentifiers(),
84
84
  };
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  type Identifiers = {
4
- trinomIdentifiers: GeneralTrinomIdentifiers;
4
+ trinomIdentifiers: TrinomNodeIdentifiers;
5
5
  };
6
6
  export declare const rootsSum: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAO9C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AAqGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
1
+ {"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
@@ -4,7 +4,7 @@ exports.rootsSum = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
10
  const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
12
  const getPropositions = (n, { answer, trinomIdentifiers }) => {
13
13
  const propositions = [];
14
14
  (0, exercise_1.addValidProp)(propositions, answer);
15
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
15
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
16
16
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(trinom.b, trinom.a).simplify().toTex());
17
17
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex());
18
18
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
23
23
  };
24
24
  const getAnswer = (identifiers) => {
25
25
  const { trinomIdentifiers } = identifiers;
26
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
26
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
27
27
  const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex();
28
28
  return ans;
29
29
  };
30
30
  const getInstruction = (identifiers) => {
31
31
  const { trinomIdentifiers } = identifiers;
32
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
32
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
33
33
  return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
34
34
 
35
35
  $$
@@ -49,14 +49,14 @@ $$`;
49
49
  };
50
50
  const getCorrection = (identifiers) => {
51
51
  const { trinomIdentifiers } = identifiers;
52
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
52
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
53
53
  const aTex = trinom.a.toTex();
54
54
  const bTex = trinom.b.toTex();
55
55
  const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a);
56
56
  return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur somme $S$ vaut :
57
57
 
58
58
  $$
59
- S = \\frac{c}{a}
59
+ S = \\frac{-b}{a}
60
60
  $$
61
61
 
62
62
  Ici, on a $a = ${aTex}$ et $b = ${bTex}$, donc :
@@ -73,13 +73,12 @@ const isAnswerValid = (ans, { answer }) => {
73
73
  return (0, rationalVEA_1.rationalVEA)(ans, answer);
74
74
  };
75
75
  const getRootsSumQuestion = (ops) => {
76
- //(b,c) != 0
77
76
  //ac <= 0
78
77
  const a = (0, randint_1.randint)(-10, 10, [0]);
79
78
  const b = (0, randint_1.randint)(-10, 10);
80
- const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 10, !b ? [0] : []);
81
- // const trinom = GeneralTrinomConstructor.randomNiceRoots(2);
82
- const trinom = new generalTrinom_1.GeneralTrinom(a, b, c);
79
+ const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
80
+ // const trinom = TrinomNodeConstructor.randomNiceRoots(2);
81
+ const trinom = new trinomNode_1.TrinomNode(a, b, c);
83
82
  const identifiers = {
84
83
  trinomIdentifiers: trinom.toIdentifiers(),
85
84
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.trinomSignFromRoots = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
6
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
7
7
  const intervals_1 = require("../../../../math/sets/intervals/intervals");
8
8
  const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
9
9
  const closure_1 = require("../../../../tree/nodes/sets/closure");
@@ -13,7 +13,7 @@ const coinFlip_1 = require("../../../../utils/alea/coinFlip");
13
13
  const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
14
14
  const propositions = [];
15
15
  (0, exercise_1.addValidProp)(propositions, answer);
16
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(trinomCoeffs);
16
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
17
17
  const roots = trinom.getRoots();
18
18
  const a = trinomCoeffs[2];
19
19
  const b = trinomCoeffs[1];
@@ -26,7 +26,7 @@ const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
26
26
  return (0, exercise_1.shuffleProps)(propositions, n);
27
27
  };
28
28
  const getAnswerNode = (identifiers) => {
29
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
29
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
30
30
  const roots = trinom.getRoots();
31
31
  const a = identifiers.trinomCoeffs[2];
32
32
  return a > 0 === identifiers.isAskingPositive
@@ -40,7 +40,7 @@ const getAnswer = (identifiers) => {
40
40
  return getAnswerNode(identifiers).toTex();
41
41
  };
42
42
  const getInstruction = (identifiers) => {
43
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
43
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
44
44
  const roots = trinom.getRoots();
45
45
  return `Soit $f$ une fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par $f(x) = ${trinom.toTex()}$.
46
46
 
@@ -52,7 +52,7 @@ const getHint = (identifiers) => {
52
52
  return `Une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.`;
53
53
  };
54
54
  const getCorrection = (identifiers) => {
55
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
55
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
56
56
  const roots = trinom.getRoots();
57
57
  const a = identifiers.trinomCoeffs[2];
58
58
  const answer = getAnswer(identifiers);
@@ -79,7 +79,7 @@ const isAnswerValid = (ans, { answer, isAskingPositive, trinomCoeffs }) => {
79
79
  return texs.includes(ans);
80
80
  };
81
81
  const getTrinomSignFromRootsQuestion = () => {
82
- const trinom = generalTrinom_1.GeneralTrinomConstructor.randomNiceRoots(2);
82
+ const trinom = trinomNode_1.TrinomNodeConstructor.randomNiceRoots(2);
83
83
  const isAskingPositive = (0, coinFlip_1.coinFlip)();
84
84
  const identifiers = {
85
85
  isAskingPositive,
@@ -1,6 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
2
3
  type Identifiers = {
3
- sidesLengths: number[];
4
+ /**!! old */
5
+ triangleIdentifiers: TriangleIdentifiers;
4
6
  };
5
7
  export declare const rightTriangleArea: Exercise<Identifiers>;
6
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAgFF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
1
+ {"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKnE,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
@@ -4,31 +4,17 @@ exports.rightTriangleArea = 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 triangle_1 = require("../../../../math/geometry/triangle");
7
+ const rightTriangle_1 = require("../../../../math/geometry/rightTriangle");
8
8
  const rational_1 = require("../../../../math/numbers/rationals/rational");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
10
  const shuffle_1 = require("../../../../utils/alea/shuffle");
11
11
  const getRightTriangleArea = () => {
12
- const vertices = [];
13
- const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
14
- for (let i = 0; i < 3; i++)
15
- vertices.push(String.fromCharCode(code + i));
16
- const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
17
- minRapport: 0.4,
18
- maxRapport: 1.6,
19
- names: vertices,
12
+ const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
13
+ randomName: true,
20
14
  });
21
- const sidesLengths = [
22
- Math.round(triangle.getSideBnumber() / 2),
23
- Math.round(triangle.getSideCnumber() / 2),
24
- ];
25
- const commands = [
26
- ...triangle.generateCommands({
27
- showLabels: [triangle.getSideBName(), triangle.getSideCName()],
28
- setCaptions: [sidesLengths[0] + "", sidesLengths[1] + ""],
29
- }),
30
- ];
31
- const answer = ((sidesLengths[0] * sidesLengths[1]) / 2 + "").replace(".", ",");
15
+ triangle.showSidesLength([0]);
16
+ const commands = [...triangle.commands];
17
+ const answer = triangle.getArea().frenchify();
32
18
  const answerTex = answer + "\\text{cm}^2";
33
19
  const ggb = new geogebraConstructor_1.GeogebraConstructor({
34
20
  commands,
@@ -36,14 +22,16 @@ const getRightTriangleArea = () => {
36
22
  hideGrid: true,
37
23
  });
38
24
  const question = {
39
- instruction: `Calculer l'aire du triangle $${triangle.getTriangleName()}$ rectangle en ${triangle.getRightAngle()} sachant que $${triangle.getSideBName()} = ${sidesLengths[0]}$ cm et $${triangle.getSideCName()} = ${sidesLengths[1]}$ cm.`,
25
+ instruction: `Le triangle $${triangle.name}$ ci-dessous est rectangle en $${triangle.points[0].name}$, et tel que $${triangle.sides[1].toLengthTex()}$ cm et $${triangle.sides[2].toLengthTex()}$ cm.
26
+
27
+ Calculer l'aire de $${triangle.name}$.`,
40
28
  answer: answerTex,
41
29
  keys: ["cm", "cm2"],
42
30
  ggbOptions: ggb.getOptions({
43
31
  coords: triangle.generateCoords(),
44
32
  }),
45
33
  answerFormat: "tex",
46
- identifiers: { sidesLengths },
34
+ identifiers: { triangleIdentifiers: triangle.toIdentifiers() },
47
35
  };
48
36
  return question;
49
37
  };
@@ -1,5 +1,10 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- type Identifiers = {};
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
3
+ type Identifiers = {
4
+ triangleIdentifiers: TriangleIdentifiers;
5
+ height: number;
6
+ base: number;
7
+ };
3
8
  export declare const triangleArea: Exercise<Identifiers>;
4
9
  export {};
5
10
  //# sourceMappingURL=triangleArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA6GtB,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
1
+ {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAYtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -9,65 +9,51 @@ const rational_1 = require("../../../../math/numbers/rationals/rational");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
10
  const randomLetter_1 = require("../../../../utils/strings/randomLetter");
11
11
  const shuffle_1 = require("../../../../utils/alea/shuffle");
12
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
13
+ const point_1 = require("../../../../math/geometry/point");
14
+ const doWhile_1 = require("../../../../utils/doWhile");
15
+ const segment_1 = require("../../../../math/geometry/segment");
16
+ const round_1 = require("../../../../math/utils/round");
12
17
  const getTriangleArea = () => {
13
- const vertices = [];
14
- const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
15
- for (let i = 0; i < 3; i++)
16
- vertices.push(String.fromCharCode(code + i));
17
- const triangle = triangle_1.TriangleConstructor.createRandomTriangle({
18
- minAngle: 0.69,
19
- maxAngle: 1.5,
20
- names: vertices,
18
+ //segment de taille fixé
19
+ //puis hauteur de taille fixée placée sur segment (élargi)
20
+ //puis rotation
21
+ const base = (0, randfloat_1.randfloat)(1, 7, 1);
22
+ const height = (0, randfloat_1.randfloat)(1, 5, 1);
23
+ const angle = (0, randfloat_1.randfloat)(0, 2 * Math.PI);
24
+ const names = triangle_1.TriangleConstructor.randomName();
25
+ const A = point_1.PointConstructor.origin(names[0]);
26
+ const C = new point_1.Point(names[2], base.toTree(), (0).toTree()).rotate(angle, A);
27
+ const xH = (0, randfloat_1.randfloat)(-0.5 * base, 1.5 * base, 1, (x) => Math.abs(x) < 0.2 * base || Math.abs(x - base) < 0.2 * base);
28
+ const footName = (0, doWhile_1.doWhile)(() => (0, randomLetter_1.randomLetter)(true), (p) => names.includes(p));
29
+ const H = new point_1.Point(footName, xH.toTree(), (0).toTree()).rotate(angle, A);
30
+ const B = new point_1.Point(names[1], xH.toTree(), height.toTree()).rotate(angle, A);
31
+ const triangle = new triangle_1.Triangle([A, B, C], {
32
+ sidesLengths: [undefined, base.toTree(), undefined],
21
33
  });
22
- const sides = [
23
- triangle.getSideAName(),
24
- triangle.getSideBName(),
25
- triangle.getSideCName(),
26
- ];
27
- const sidesLengths = [
28
- triangle.getSideAnumber(),
29
- triangle.getSideBnumber(),
30
- triangle.getSideCnumber(),
31
- ].map((el) => Math.round(el / 2));
32
- const angles = [
33
- triangle.getAngleA(),
34
- triangle.getAngleB(),
35
- triangle.getAngleC(),
36
- ];
37
- const randoms = (0, shuffle_1.shuffle)([0, 1, 2]);
38
- const height = Math.round(sidesLengths[randoms[1]] * Math.sin(angles[randoms[2]]));
39
- const interceptName = (0, randomLetter_1.randomLetter)(true, vertices);
40
- const commands = [
41
- ...triangle.generateCommands({
42
- showLabels: [sides[randoms[0]]],
43
- setCaptions: [sidesLengths[randoms[0]] + ""],
44
- }),
45
- `poi = Intersect(PerpendicularLine(${vertices[randoms[0]]},${sides[randoms[0]]}),${sides[randoms[0]]})`,
46
- `SetCaption(poi, "${interceptName}")`,
47
- `ShowLabel(poi, true)`,
48
- `seg = Segment(${vertices[randoms[0]]}, poi)`,
49
- `ShowLabel(seg, true)`,
50
- `SetCaption(seg, "${height}")`,
51
- `SetLineStyle(seg, 1)`,
52
- `alpha = Angle(${vertices[randoms[0]]},poi ,${vertices[randoms[1]]}, Line(${vertices[randoms[0]]},poi))`,
53
- `ShowLabel(alpha, false)`,
54
- ];
34
+ const heightSegment = new segment_1.Segment(B, H, { lengthNode: height.toTree() });
35
+ triangle.drawHeight(1, { footName });
55
36
  const ggb = new geogebraConstructor_1.GeogebraConstructor({
56
- commands,
37
+ commands: triangle.commands,
57
38
  hideAxes: true,
58
39
  hideGrid: true,
59
40
  });
60
- const answer = ((sidesLengths[randoms[0]] * height) / 2 + "").replace(".", ",");
61
- const answerTex = answer + "\\text{cm}^2";
41
+ const answer = (0, round_1.round)((height * base) / 2, 1);
62
42
  const question = {
63
- instruction: `Calculer l'aire du triangle $${triangle.getTriangleName()}$ sachant que $${sides[randoms[0]]} = ${sidesLengths[randoms[0]]}$ cm et $${vertices[randoms[0]]}${interceptName} = ${height}$ cm.`,
64
- answer: answerTex,
43
+ instruction: `Calculer l'aire du triangle $${triangle.name}$ sachant que $${triangle.sides[1].toLengthTex()}$ cm et $${heightSegment.toLengthTex()}$ cm.
44
+
45
+ Arrondir à $0,1$ cm près.`,
46
+ answer: answer.frenchify() + "\\text{cm}^2",
65
47
  keys: ["cm", "cm2"],
66
48
  ggbOptions: ggb.getOptions({
67
- coords: triangle.generateCoords(),
49
+ coords: ggb.getCoordsForPoints([A, B, C, H]),
68
50
  }),
69
51
  answerFormat: "tex",
70
- identifiers: { sidesLengths },
52
+ identifiers: {
53
+ triangleIdentifiers: triangle.toIdentifiers(),
54
+ height,
55
+ base,
56
+ },
71
57
  };
72
58
  return question;
73
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAiIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAepE,CAAC"}
1
+ {"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAepE,CAAC"}
@@ -57,7 +57,10 @@ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
57
57
  const studentAns = ans.filter((c) => !["A", "B", "C", "D"].includes(c[0]));
58
58
  if (studentAns.length !== 1)
59
59
  return false;
60
- const coords = (0, ggbPointToCoords_1.ggbPointToCoords)(studentAns[0].split("=")[1]);
60
+ const studentPoint = studentAns[0].split("=")[1];
61
+ if (studentPoint === undefined)
62
+ return false;
63
+ const coords = (0, ggbPointToCoords_1.ggbPointToCoords)(studentPoint);
61
64
  const coordsAns = (0, ggbPointToCoords_1.ggbPointToCoords)(ggbAnswer[0].split("=")[1]);
62
65
  return ((0, approxEqual_1.approxEqual)(coords.x, coordsAns.x, 0.2) &&
63
66
  (0, approxEqual_1.approxEqual)(coords.y, coordsAns.y, 0.2));
@@ -9,4 +9,5 @@ export * from "./volumes";
9
9
  export * from "./euclidianConstructions";
10
10
  export * from "./shapes";
11
11
  export * from "./parametric";
12
+ export * from "./quadrilaterals";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
@@ -27,3 +27,4 @@ __exportStar(require("./euclidianConstructions"), exports);
27
27
  __exportStar(require("./shapes"), exports);
28
28
  // export * from "./euclidian";
29
29
  __exportStar(require("./parametric"), exports);
30
+ __exportStar(require("./quadrilaterals"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
1
+ {"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
@@ -1,9 +1,6 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
2
  import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
3
3
  type Identifiers = {
4
- sideA: string;
5
- sideB: string;
6
- sideC: string;
7
4
  triangleIdentifiers: TriangleIdentifiers;
8
5
  };
9
6
  export declare const pythagore: Exercise<Identifiers>;
@@ -1 +1 @@
1
- {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAStC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAiEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
1
+ {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
@@ -3,57 +3,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pythagore = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
- const triangle_1 = require("../../../../math/geometry/triangle");
7
- const randint_1 = require("../../../../math/utils/random/randint");
8
6
  const lengthNode_1 = require("../../../../tree/nodes/geometry/lengthNode");
9
7
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
10
8
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
11
9
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
10
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
11
+ const rightTriangle_1 = require("../../../../math/geometry/rightTriangle");
13
12
  const getPythagore = () => {
14
- const vertices = [];
15
- const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
16
- for (let i = 0; i < 3; i++)
17
- vertices.push(String.fromCharCode(code + i));
18
- const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
19
- minRapport: 0.7,
20
- maxRapport: 1.3,
21
- names: vertices,
13
+ const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
14
+ randomName: true,
22
15
  });
23
- const sideA = triangle.getSideAName();
24
- const sideB = triangle.getSideBName();
25
- const sideC = triangle.getSideCName();
26
16
  const triangleIdentifiers = triangle.toIdentifiers();
27
17
  const ggb = new geogebraConstructor_1.GeogebraConstructor({
28
- commands: triangle.generateCommands({}),
18
+ commands: triangle.commands,
29
19
  hideAxes: true,
30
20
  hideGrid: true,
31
21
  });
32
- const answer = `${sideA}^2=${sideB}^2+${sideC}^2`;
22
+ const answer = triangle.getPythagorianTex();
33
23
  const question = {
34
24
  instruction: "Écrire l'égalité de Pythagore pour le triangle rectangle suivant : ",
35
25
  answer,
36
- keys: [...vertices, "equal"],
26
+ keys: [...triangle.points.map((p) => p.name), "equal"],
37
27
  ggbOptions: ggb.getOptions({
38
28
  coords: triangle.generateCoords(),
39
29
  }),
40
30
  answerFormat: "tex",
41
- identifiers: { sideA, sideB, sideC, triangleIdentifiers },
31
+ identifiers: { triangleIdentifiers },
42
32
  };
43
33
  return question;
44
34
  };
45
- const getPropositions = (n, { answer, sideA, sideB, sideC }) => {
35
+ const getPropositions = (n, { answer, triangleIdentifiers }) => {
46
36
  const propositions = [];
47
37
  (0, exercise_1.addValidProp)(propositions, answer);
48
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA} = ${sideB} + ${sideC}`);
49
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2 = ${sideB}^2 - ${sideC}^2`);
50
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideB}^2 = ${sideA}^2 + ${sideC}^2`);
51
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideC}^2 = ${sideA}^2 + ${sideB}^2`);
52
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2 = ${sideB} + ${sideC}^2`);
53
- (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2 = ${sideB}^2 + ${sideC}`);
38
+ const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
39
+ const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
40
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}=${sideB}+${sideC}`);
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}^2-${sideC}^2`);
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideB}^2=${sideA}^2+${sideC}^2`);
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideC}^2= ${sideA}^2+${sideB}^2`);
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}+${sideC}^2`);
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}^2+${sideC}`);
54
46
  return (0, exercise_1.shuffleProps)(propositions, n);
55
47
  };
56
- const isAnswerValid = (ans, { sideA, sideB, sideC }) => {
48
+ const isAnswerValid = (ans, { triangleIdentifiers }) => {
49
+ const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
50
+ const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
57
51
  const answer = new equalNode_1.EqualNode(new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideA)), new addNode_1.AddNode(new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideB)), new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideC))));
58
52
  const texs = answer.toAllValidTexs();
59
53
  return texs.includes(ans);
@@ -1,8 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
2
  import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
3
3
  type Identifiers = {
4
- square: number;
5
- sideLengths: number[];
4
+ sideAsked: number;
6
5
  triangleIdentifiers: TriangleIdentifiers;
7
6
  };
8
7
  export declare const pythagoreCalcul: Exercise<Identifiers>;