math-exercises 3.0.30 → 3.0.32

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 (189) hide show
  1. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +2 -2
  2. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +1 -3
  4. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +2 -2
  5. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
  7. package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.js +1 -1
  8. package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/fractions/simplifyFraction.js +19 -10
  10. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +3 -3
  11. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts +8 -0
  12. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts.map +1 -0
  13. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.js +155 -0
  14. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts +11 -0
  15. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -0
  16. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +147 -0
  17. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts +11 -0
  18. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -0
  19. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +150 -0
  20. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts +11 -0
  21. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -0
  22. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +143 -0
  23. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +4 -4
  24. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/distributivity/index.js +4 -4
  26. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +1 -0
  28. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +11 -0
  29. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -0
  30. package/lib/exercises/math/calculLitteral/equation/equa1.js +111 -0
  31. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +17 -0
  32. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -0
  33. package/lib/exercises/math/calculLitteral/equation/equa2.js +164 -0
  34. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +12 -0
  35. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -0
  36. package/lib/exercises/math/calculLitteral/equation/equa3.js +113 -0
  37. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +13 -0
  38. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -0
  39. package/lib/exercises/math/calculLitteral/equation/equa4.js +106 -0
  40. package/lib/exercises/math/calculLitteral/equation/index.d.ts +4 -4
  41. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  42. package/lib/exercises/math/calculLitteral/equation/index.js +4 -4
  43. package/lib/exercises/math/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/derivative/expDerivativeOne.js +0 -6
  45. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
  46. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +30 -0
  47. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  48. package/lib/exercises/math/functions/affines/leadingCoefficient.js +26 -11
  49. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  50. package/lib/exercises/math/functions/logarithm/logSimplifiying.js +1 -1
  51. package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
  52. package/lib/exercises/math/functions/sign/affineProductSign.js +3 -0
  53. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
  54. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +64 -72
  55. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
  56. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +1 -1
  57. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
  58. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +31 -14
  59. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  60. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +1 -2
  61. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
  62. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +3 -0
  63. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -1
  64. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +3 -0
  65. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +1 -1
  66. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  67. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
  68. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +1 -1
  69. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  70. package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
  71. package/lib/exercises/math/geometry/cartesian/midpoint.d.ts.map +1 -1
  72. package/lib/exercises/math/geometry/cartesian/midpoint.js +19 -6
  73. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  74. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
  76. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +2 -2
  77. package/lib/exercises/math/geometry/index.d.ts +1 -0
  78. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  79. package/lib/exercises/math/geometry/index.js +1 -1
  80. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +1 -1
  81. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  82. package/lib/exercises/math/geometry/pythagore/pythagore.js +1 -1
  83. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -1
  84. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  85. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
  86. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +4 -4
  87. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  88. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -4
  89. package/lib/exercises/math/geometry/thales/thales.d.ts +1 -1
  90. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  91. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  92. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +1 -1
  93. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  94. package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
  95. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -1
  96. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  98. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts +9 -0
  99. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/triangles/triangleNature.js +121 -0
  101. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts +9 -0
  102. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +134 -0
  104. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts +1 -1
  105. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +1 -1
  107. package/lib/exercises/math/percent/percentToDecimal.js +2 -2
  108. package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
  109. package/lib/exercises/math/probaStat/ballsBasicProbas.js +29 -16
  110. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  111. package/lib/exercises/math/probaStat/cardBasicProbas.js +44 -32
  112. package/lib/exercises/math/probaStat/stats1var/median.js +2 -2
  113. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  114. package/lib/exercises/math/probaStat/stats1var/medianList.js +28 -12
  115. package/lib/exercises/math/squareRoots/simpifySquareRoot.js +1 -1
  116. package/lib/exercises/math/squareRoots/squareRootsProducts.js +1 -1
  117. package/lib/exercises/math/trigonometry/trigonometry.d.ts +1 -1
  118. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  119. package/lib/exercises/math/trigonometry/trigonometry.js +1 -1
  120. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +1 -1
  121. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  122. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +1 -1
  123. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +1 -1
  124. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  125. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  126. package/lib/exercises/pc/index.d.ts +4 -4
  127. package/lib/exercises/pc/index.d.ts.map +1 -1
  128. package/lib/exercises/pc/index.js +4 -4
  129. package/lib/index.d.ts +18 -15
  130. package/lib/index.d.ts.map +1 -1
  131. package/lib/math/geometry/angle.d.ts +6 -0
  132. package/lib/math/geometry/angle.d.ts.map +1 -1
  133. package/lib/math/geometry/angle.js +20 -7
  134. package/lib/math/geometry/quadrilaterals/parallelogram.d.ts +23 -0
  135. package/lib/math/geometry/quadrilaterals/parallelogram.d.ts.map +1 -0
  136. package/lib/math/geometry/quadrilaterals/parallelogram.js +65 -0
  137. package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts +15 -0
  138. package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts.map +1 -0
  139. package/lib/math/geometry/quadrilaterals/quadrilateral.js +38 -0
  140. package/lib/math/geometry/quadrilaterals/rectangle.d.ts +24 -0
  141. package/lib/math/geometry/quadrilaterals/rectangle.d.ts.map +1 -0
  142. package/lib/math/geometry/quadrilaterals/rectangle.js +59 -0
  143. package/lib/math/geometry/quadrilaterals/rhombus.d.ts +19 -0
  144. package/lib/math/geometry/quadrilaterals/rhombus.d.ts.map +1 -0
  145. package/lib/math/geometry/quadrilaterals/rhombus.js +41 -0
  146. package/lib/math/geometry/quadrilaterals/square.d.ts +22 -0
  147. package/lib/math/geometry/quadrilaterals/square.d.ts.map +1 -0
  148. package/lib/math/geometry/quadrilaterals/square.js +38 -0
  149. package/lib/math/geometry/triangles/equilateralTriangle.d.ts +21 -0
  150. package/lib/math/geometry/triangles/equilateralTriangle.d.ts.map +1 -0
  151. package/lib/math/geometry/triangles/equilateralTriangle.js +52 -0
  152. package/lib/math/geometry/triangles/isoceleTriangle.d.ts +23 -0
  153. package/lib/math/geometry/triangles/isoceleTriangle.d.ts.map +1 -0
  154. package/lib/math/geometry/triangles/isoceleTriangle.js +66 -0
  155. package/lib/math/geometry/triangles/rightTriangle.d.ts +31 -0
  156. package/lib/math/geometry/triangles/rightTriangle.d.ts.map +1 -0
  157. package/lib/math/geometry/triangles/rightTriangle.js +108 -0
  158. package/lib/math/geometry/triangles/triangle.d.ts +68 -0
  159. package/lib/math/geometry/triangles/triangle.d.ts.map +1 -0
  160. package/lib/math/geometry/triangles/triangle.js +240 -0
  161. package/lib/math/geometry/vector.d.ts.map +1 -1
  162. package/lib/math/geometry/vector.js +0 -11
  163. package/lib/math/polynomials/trinom.d.ts +1 -1
  164. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  165. package/lib/math/polynomials/trinom.js +7 -17
  166. package/lib/tree/nodes/complex/complexNode.d.ts +9 -3
  167. package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
  168. package/lib/tree/nodes/complex/complexNode.js +18 -1
  169. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  170. package/lib/tree/nodes/node.d.ts +2 -1
  171. package/lib/tree/nodes/node.d.ts.map +1 -1
  172. package/lib/tree/nodes/node.js +1 -0
  173. package/lib/tree/nodes/sets/belongsNode.d.ts +0 -1
  174. package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
  175. package/lib/tree/nodes/sets/belongsNode.js +0 -3
  176. package/lib/tree/nodes/sets/discreteSetNode.d.ts +8 -2
  177. package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
  178. package/lib/tree/nodes/sets/discreteSetNode.js +20 -2
  179. package/lib/tree/nodes/sets/intervalNode.d.ts +6 -2
  180. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  181. package/lib/tree/nodes/sets/intervalNode.js +15 -1
  182. package/lib/tree/nodes/sets/setNode.d.ts +3 -1
  183. package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
  184. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +8 -2
  185. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  186. package/lib/tree/nodes/sets/unionIntervalNode.js +16 -0
  187. package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
  188. package/lib/tree/parsers/discreteSetParser.js +0 -2
  189. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAuHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
1
+ {"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAuHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAoBrD,CAAC"}
@@ -116,4 +116,7 @@ export const trinomSignFromRoots = {
116
116
  getAnswer,
117
117
  hasHintAndCorrection: true,
118
118
  getInstruction,
119
+ pdfOptions: {
120
+ shouldSpreadPropositions: true,
121
+ },
119
122
  };
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  /**!! old */
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -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,6BAA6B,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,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,6BAA6B,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAKhF,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
4
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
5
5
  import { Rational } from "../../../../math/numbers/rationals/rational.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  import { SegmentIdentifiers } from "../../../../math/geometry/segment.js";
4
4
  type Identifiers = {
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AASnD,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
4
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
6
  import { randomLetter } from "../../../../utils/strings/randomLetter.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -1 +1 @@
1
- {"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAuEF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
1
+ {"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAmFF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
@@ -5,18 +5,31 @@ import { distinctRandTupleInt } from "../../../../math/utils/random/randTupleInt
5
5
  import { PointNode } from "../../../../tree/nodes/geometry/pointNode.js";
6
6
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
8
+ const getPoints = (identifiers) => {
9
+ const { coordsA, coordsB } = identifiers;
10
+ const A = new Point("A", new NumberNode(coordsA[0]), new NumberNode(coordsA[1]));
11
+ const B = new Point("B", new NumberNode(coordsB[0]), new NumberNode(coordsB[1]));
12
+ return [A, B];
13
+ };
14
+ const getInstruction = (identifiers) => {
15
+ const [A, B] = getPoints(identifiers);
16
+ return `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`;
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const [A, B] = getPoints(identifiers);
20
+ const answer = A.midpoint(B).toTexWithCoords();
21
+ return answer;
22
+ };
8
23
  const getMidpointQuestion = () => {
9
24
  const [coords1, coords2] = distinctRandTupleInt(2, 2, { from: -9, to: 10 });
10
- const A = new Point("A", new NumberNode(coords1[0]), new NumberNode(coords1[1]));
11
- const B = new Point("B", new NumberNode(coords2[0]), new NumberNode(coords2[1]));
12
- const answer = A.midpoint(B).toTexWithCoords();
25
+ const identifiers = { coordsA: coords1, coordsB: coords2 };
13
26
  const question = {
14
- instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`,
27
+ instruction: getInstruction(identifiers),
15
28
  startStatement: "I",
16
- answer,
29
+ answer: getAnswer(identifiers),
17
30
  keys: ["I", "semicolon"],
18
31
  answerFormat: "tex",
19
- identifiers: { coordsA: coords1, coordsB: coords2 },
32
+ identifiers,
20
33
  };
21
34
  return question;
22
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pointCoordinates.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
1
+ {"version":3,"file":"pointCoordinates.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pointCoordinatesNoAxisNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6HF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
1
+ {"version":3,"file":"pointCoordinatesNoAxisNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6HF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pointCoordinatesNoOrthonorm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2GF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
1
+ {"version":3,"file":"pointCoordinatesNoOrthonorm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2GF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
@@ -3,9 +3,9 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Angle } from "../../../../math/geometry/angle.js";
5
5
  import { PointConstructor, } from "../../../../math/geometry/point.js";
6
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
7
  import { Segment, } from "../../../../math/geometry/segment.js";
8
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
8
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
9
9
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
10
10
  import { round } from "../../../../math/utils/round.js";
11
11
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
@@ -13,4 +13,5 @@ export * from "./parametric/index.js";
13
13
  export * from "./quadrilaterals/index.js";
14
14
  export * from "./angles/index.js";
15
15
  export * from "./lines/index.js";
16
+ export * from "./triangles/index.js";
16
17
  //# 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,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -6,7 +6,6 @@ export * from "./thales/index.js";
6
6
  export * from "./vectors/index.js";
7
7
  export * from "./convexity/index.js";
8
8
  export * from "./volumes/index.js";
9
- // export * from "./triangles.js";
10
9
  export * from "./euclidianConstructions/index.js";
11
10
  export * from "./shapes/index.js";
12
11
  export * from "./euclidian/index.js";
@@ -14,3 +13,4 @@ export * from "./parametric/index.js";
14
13
  export * from "./quadrilaterals/index.js";
15
14
  export * from "./angles/index.js";
16
15
  export * from "./lines/index.js";
16
+ export * from "./triangles/index.js";
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  triangleIdentifiers: TriangleIdentifiers;
5
5
  };
@@ -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,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAUzC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,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,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAUnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
@@ -5,7 +5,7 @@ import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
5
5
  import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
6
6
  import { SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
7
7
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
8
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
8
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
9
9
  const getPythagore = () => {
10
10
  const triangle = RightTriangleConstructor.randomNiceSides({
11
11
  randomName: true,
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  sideAsked: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAiBzC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA+EF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
1
+ {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAiBnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA+EF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
@@ -3,7 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
5
  import { random } from "../../../../utils/alea/random.js";
6
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
7
  import { sqrtVEA } from "../../../../exercises/vea/sqrtVEA.js";
8
8
  import { square } from "../../../../tree/nodes/operators/powerNode.js";
9
9
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
@@ -1,8 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { ParallelogramIdentifiers } from "../../../../math/geometry/parallelogram.js";
3
- import { RectangleIdentifiers } from "../../../../math/geometry/rectangle.js";
4
- import { RhombusIdentifiers } from "../../../../math/geometry/rhombus.js";
5
- import { SquareIdentifiers } from "../../../../math/geometry/square.js";
2
+ import { ParallelogramIdentifiers } from "../../../../math/geometry/quadrilaterals/parallelogram.js";
3
+ import { RectangleIdentifiers } from "../../../../math/geometry/quadrilaterals/rectangle.js";
4
+ import { RhombusIdentifiers } from "../../../../math/geometry/quadrilaterals/rhombus.js";
5
+ import { SquareIdentifiers } from "../../../../math/geometry/quadrilaterals/square.js";
6
6
  type Identifiers = {
7
7
  shape: string;
8
8
  showDiagonals: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAEL,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAIvC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA0MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAoB1D,CAAC"}
1
+ {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,iBAAiB,EAClB,MAAM,8CAA8C,CAAC;AAItD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA0MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAoB1D,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { ParallelogramConstructor, } from "../../../../math/geometry/parallelogram.js";
5
- import { RectangleConstructor, } from "../../../../math/geometry/rectangle.js";
6
- import { RhombusConstructor, } from "../../../../math/geometry/rhombus.js";
7
- import { SquareConstructor, } from "../../../../math/geometry/square.js";
4
+ import { ParallelogramConstructor, } from "../../../../math/geometry/quadrilaterals/parallelogram.js";
5
+ import { RectangleConstructor, } from "../../../../math/geometry/quadrilaterals/rectangle.js";
6
+ import { RhombusConstructor, } from "../../../../math/geometry/quadrilaterals/rhombus.js";
7
+ import { SquareConstructor, } from "../../../../math/geometry/quadrilaterals/square.js";
8
8
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
9
9
  import { random } from "../../../../utils/alea/random.js";
10
10
  const getPropositions = (n, { answer }) => {
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  ratio: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAuBzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAoIF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjD,CAAC"}
1
+ {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAuBnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAoIF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjD,CAAC"}
@@ -2,7 +2,7 @@ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrong
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Segment } from "../../../../math/geometry/segment.js";
5
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
5
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
6
6
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
7
7
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
8
8
  import { MultiEqualNode } from "../../../../tree/nodes/equations/multiEqualNode.js";
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  ratio: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAQzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,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,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAQnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
@@ -3,7 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
5
  import { Segment } from "../../../../math/geometry/segment.js";
6
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
6
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
7
7
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
8
8
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
9
9
  import { round } from "../../../../math/utils/round.js";
@@ -1,2 +1,2 @@
1
- export {};
1
+ export * from "./triangleThirdAngleValue.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":"AAEA,cAAc,8BAA8B,CAAC"}
@@ -1,2 +1,3 @@
1
- export {};
2
1
  // export * from './traceMedianInTriangle'
2
+ // export * from "./triangleNature.js";
3
+ export * from "./triangleThirdAngleValue.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
+ type Identifiers = {
4
+ triangleIdentifiers: TriangleIdentifiers;
5
+ type: number;
6
+ };
7
+ export declare const triangleNature: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=triangleNature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAInD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA+GF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { addValidProp, shuffleProps, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { EquilateralTriangleConstructor } from "../../../../math/geometry/triangles/equilateralTriangle.js";
5
+ import { IsoceleTriangleConstructor } from "../../../../math/geometry/triangles/isoceleTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
+ import { TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ const getPropositions = (n, { answer }) => {
10
+ const propositions = [];
11
+ addValidProp(propositions, answer);
12
+ while (propositions.length < n) {
13
+ throw Error("QCM not implemented");
14
+ }
15
+ return shuffleProps(propositions, n);
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ return "";
19
+ };
20
+ const getInstruction = (identifiers) => {
21
+ return "";
22
+ };
23
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
24
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
25
+ const getGGBOptions = (identifiers) => {
26
+ const { triangleIdentifiers, type } = identifiers;
27
+ let triangle;
28
+ switch (type) {
29
+ case 0:
30
+ triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
31
+ break;
32
+ case 1:
33
+ triangle =
34
+ IsoceleTriangleConstructor.fromIdentifiers(triangleIdentifiers);
35
+ triangle.drawSidesDecoration();
36
+ break;
37
+ case 2:
38
+ triangle =
39
+ EquilateralTriangleConstructor.fromIdentifiers(triangleIdentifiers);
40
+ triangle.drawSidesDecoration();
41
+ break;
42
+ case 3:
43
+ default:
44
+ triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
45
+ break;
46
+ }
47
+ const ggb = new GeogebraConstructor({
48
+ commands: triangle.commands,
49
+ hideAxes: true,
50
+ hideGrid: true,
51
+ });
52
+ return ggb.getOptions({
53
+ coords: triangle.generateCoords(),
54
+ });
55
+ };
56
+ const getKeys = (identifiers) => {
57
+ return [];
58
+ };
59
+ const isAnswerValid = (ans, { answer }) => {
60
+ throw Error("VEA not implemented");
61
+ };
62
+ const getTriangleNatureQuestion = (opts) => {
63
+ // const type = random(["scalène","isocèle","équilatéral", "rectangle", "rectangle et isocèle"]);
64
+ const type = randint(0, 4);
65
+ let triangle;
66
+ switch (type) {
67
+ case 0:
68
+ triangle = TriangleConstructor.randomNiceSides({
69
+ randomName: true,
70
+ });
71
+ break;
72
+ case 1:
73
+ triangle = IsoceleTriangleConstructor.randomNiceSides({
74
+ randomName: true,
75
+ });
76
+ break;
77
+ case 2:
78
+ triangle = EquilateralTriangleConstructor.randomNiceSides({
79
+ randomName: true,
80
+ });
81
+ break;
82
+ case 3:
83
+ default:
84
+ triangle = RightTriangleConstructor.randomNiceSides({
85
+ randomName: true,
86
+ });
87
+ }
88
+ const identifiers = {
89
+ triangleIdentifiers: triangle.toIdentifiers(),
90
+ type,
91
+ };
92
+ const question = {
93
+ answer: getAnswer(identifiers),
94
+ instruction: getInstruction(identifiers),
95
+ keys: getKeys(identifiers),
96
+ answerFormat: "tex",
97
+ identifiers,
98
+ // hint: getHint(identifiers),
99
+ // correction: getCorrection(identifiers),
100
+ ggbOptions: getGGBOptions(identifiers),
101
+ };
102
+ return question;
103
+ };
104
+ export const triangleNature = {
105
+ id: "triangleNature",
106
+ label: "Déterminer la nature d'un triangle",
107
+ isSingleStep: true,
108
+ generator: (nb, opts) => getDistinctQuestions(() => getTriangleNatureQuestion(opts), nb),
109
+ qcmTimer: 60,
110
+ freeTimer: 60,
111
+ getPropositions,
112
+ isAnswerValid,
113
+ subject: "Mathématiques",
114
+ // getHint,
115
+ // getCorrection,
116
+ getInstruction,
117
+ getAnswer,
118
+ getGGBOptions,
119
+ hasGeogebra: true,
120
+ answerType: "QCM",
121
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
+ type Identifiers = {
4
+ triangleIdentifiers: TriangleIdentifiers;
5
+ angleAsked: number;
6
+ };
7
+ export declare const triangleThirdAngleValue: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=triangleThirdAngleValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triangleThirdAngleValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleThirdAngleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EAEpB,MAAM,2CAA2C,CAAC;AAQnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAkIF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAmBzD,CAAC"}
@@ -0,0 +1,134 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { round } from "../../../../math/utils/round.js";
7
+ import { DegreeNode } from "../../../../tree/nodes/geometry/degree.js";
8
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
9
+ import { degreeParser } from "../../../../tree/parsers/degreeParser.js";
10
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
11
+ const getPropositions = (n, { answer }) => {
12
+ const propositions = [];
13
+ addValidProp(propositions, answer);
14
+ tryToAddWrongProp(propositions, "180^{\\circ}");
15
+ while (propositions.length < n) {
16
+ tryToAddWrongProp(propositions, randint(20, 160) + "^{\\circ}");
17
+ }
18
+ return shuffleProps(propositions, n);
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { triangleIdentifiers, angleAsked } = identifiers;
22
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
23
+ return triangle.angles[angleAsked].getValueNode(true).toTex() + "^{\\circ}";
24
+ };
25
+ const getInstruction = (identifiers) => {
26
+ const { triangleIdentifiers, angleAsked } = identifiers;
27
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
28
+ const angles = [
29
+ `${triangle.angles[(angleAsked + 1) % 3].toTex()}=${triangle.angles[(angleAsked + 1) % 3]
30
+ .getValueNode(true)
31
+ .toTex()}^{\\circ}`,
32
+ `${triangle.angles[(angleAsked + 2) % 3].toTex()}=${triangle.angles[(angleAsked + 2) % 3]
33
+ .getValueNode(true)
34
+ .toTex()}^{\\circ}`,
35
+ ];
36
+ return `Dans le triangle $${triangle.name}$ ci-dessous, on a $${angles[0]}$ et $${angles[1]}$.
37
+
38
+ Que vaut l'angle $${triangle.angles[angleAsked].toTex()}$?`;
39
+ };
40
+ const getHint = (identifiers) => {
41
+ return `Dans un triangle, la somme des angles est égale à $${new DegreeNode(180).toTex()}$`;
42
+ };
43
+ const getCorrection = (identifiers) => {
44
+ const { triangleIdentifiers, angleAsked } = identifiers;
45
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
46
+ const angles = [
47
+ triangle.angles[(angleAsked + 1) % 3].getValueNode(true),
48
+ triangle.angles[(angleAsked + 2) % 3].getValueNode(true),
49
+ ];
50
+ const addAngles = add(angles[0], angles[1]);
51
+ const simp = addAngles.simplify();
52
+ return `Dans un triangle, la somme des angles est égale à $${new DegreeNode(180).toTex()}$.
53
+
54
+ En additionnant les deux angles donnés dans l'énoncé, on obtient :
55
+
56
+ $$
57
+ ${addAngles.toTex()}=${simp.toTex()}
58
+ $$
59
+
60
+ L'angle recherché a donc une mesure de :
61
+
62
+ $$
63
+ 180 - ${simp.toTex()}=${getAnswer(identifiers)}
64
+ $$`;
65
+ };
66
+ const getGGBOptions = (identifiers) => {
67
+ const { triangleIdentifiers, angleAsked } = identifiers;
68
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
69
+ triangle.drawAngles([angleAsked], { fitCaption: true, color: "red" });
70
+ const ggb = new GeogebraConstructor({
71
+ commands: [...triangle.commands],
72
+ hideAxes: true,
73
+ hideGrid: true,
74
+ });
75
+ return ggb.getOptions({
76
+ coords: triangle.generateCoords(),
77
+ });
78
+ };
79
+ const getKeys = (identifiers) => {
80
+ return ["degree"];
81
+ };
82
+ const isAnswerValid = (ans, { answer }) => {
83
+ try {
84
+ const parsed = degreeParser(ans, true);
85
+ if (parsed === false)
86
+ return false;
87
+ return parsed === answer;
88
+ }
89
+ catch (err) {
90
+ return handleVEAError(err);
91
+ }
92
+ };
93
+ const getTriangleThirdAngleValueQuestion = (opts) => {
94
+ const baseTriangle = TriangleConstructor.randomNiceSides({
95
+ randomName: true,
96
+ });
97
+ const triangle = new Triangle(baseTriangle.points, {
98
+ anglesDegreeValues: baseTriangle.angles.map((e) => round(e.evaluate(false), 0).toTree()),
99
+ });
100
+ const identifiers = {
101
+ triangleIdentifiers: triangle.toIdentifiers(),
102
+ angleAsked: randint(0, 3),
103
+ };
104
+ const question = {
105
+ answer: getAnswer(identifiers),
106
+ instruction: getInstruction(identifiers),
107
+ keys: getKeys(identifiers),
108
+ answerFormat: "tex",
109
+ identifiers,
110
+ hint: getHint(identifiers),
111
+ correction: getCorrection(identifiers),
112
+ ggbOptions: getGGBOptions(identifiers),
113
+ };
114
+ return question;
115
+ };
116
+ export const triangleThirdAngleValue = {
117
+ id: "triangleThirdAngleValue",
118
+ connector: "=",
119
+ label: "Déterminer la valeur du troisième angle d'un triangle",
120
+ isSingleStep: true,
121
+ generator: (nb, opts) => getDistinctQuestions(() => getTriangleThirdAngleValueQuestion(opts), nb),
122
+ qcmTimer: 60,
123
+ freeTimer: 60,
124
+ getPropositions,
125
+ isAnswerValid,
126
+ subject: "Mathématiques",
127
+ getHint,
128
+ getCorrection,
129
+ getInstruction,
130
+ getAnswer,
131
+ getGGBOptions,
132
+ hasGeogebra: true,
133
+ hasHintAndCorrection: true,
134
+ };
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  triangleIdentifiers: TriangleIdentifiers;
5
5
  };