math-exercises 3.0.52 → 3.0.54

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 (238) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +0 -2
  3. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +0 -2
  5. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +0 -2
  7. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSum.js +0 -2
  9. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +3 -17
  11. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +0 -12
  13. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +0 -13
  15. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +0 -2
  17. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +8 -3
  18. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +53 -30
  20. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/equation/equa4.js +0 -2
  22. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +3 -0
  24. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +4 -4
  26. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -2
  28. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  29. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +0 -2
  30. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +2 -2
  31. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +52 -25
  33. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts +2 -2
  34. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  35. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +50 -33
  36. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +2 -1
  37. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +37 -17
  39. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  40. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +0 -2
  41. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/affines/affineExpressionReading.js +3 -2
  43. package/lib/exercises/math/functions/affines/interceptReading.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/affines/interceptReading.js +47 -18
  45. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.js +46 -13
  47. package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/angles/recognizeAngleType.js +33 -12
  49. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/areas/circleArea.js +45 -2
  51. package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/areas/squareArea.js +40 -7
  53. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +52 -7
  56. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts +9 -0
  57. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts.map +1 -0
  58. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +162 -0
  59. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts +10 -0
  60. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts.map +1 -0
  61. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +161 -0
  62. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts +4 -2
  63. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
  64. package/lib/exercises/math/geometry/cartesian/directionVector.js +110 -79
  65. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
  66. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +55 -11
  67. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  68. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +18 -2
  69. package/lib/exercises/math/geometry/cartesian/index.d.ts +2 -0
  70. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/cartesian/index.js +2 -0
  72. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +0 -2
  74. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +0 -2
  76. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
  77. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +0 -2
  78. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts +9 -0
  79. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts.map +1 -0
  80. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.js +108 -0
  81. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  82. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +20 -1
  83. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts +9 -0
  84. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -0
  85. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +115 -0
  86. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts +9 -0
  87. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts.map +1 -0
  88. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +122 -0
  89. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts +9 -0
  90. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts.map +1 -0
  91. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.js +121 -0
  92. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts +10 -0
  93. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -0
  94. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +124 -0
  95. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts +10 -0
  96. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts.map +1 -0
  97. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +123 -0
  98. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts +12 -0
  99. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +130 -0
  101. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts +10 -0
  102. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +109 -0
  104. package/lib/exercises/math/geometry/lines/index.d.ts +10 -0
  105. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/lines/index.js +10 -0
  107. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts +10 -0
  108. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/lines/reductEquationFindY.js +105 -0
  110. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts +10 -0
  111. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.js +149 -0
  113. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts +8 -0
  114. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/lines/reductEquationReading.js +142 -0
  116. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  117. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +58 -9
  118. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
  119. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +39 -6
  120. package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
  121. package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +40 -7
  122. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.d.ts.map +1 -1
  123. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +34 -7
  124. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/pythagore/pythagore.js +51 -15
  126. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  127. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +109 -19
  128. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/thales/thales.js +36 -5
  130. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/triangles/triangleNature.js +45 -14
  132. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.d.ts.map +1 -1
  133. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +78 -15
  134. package/lib/exercises/math/geometry/vectors/colinearity.d.ts +5 -4
  135. package/lib/exercises/math/geometry/vectors/colinearity.d.ts.map +1 -1
  136. package/lib/exercises/math/geometry/vectors/colinearity.js +82 -21
  137. package/lib/exercises/math/geometry/vectors/determinant.js +1 -1
  138. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +2 -0
  139. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -0
  140. package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +92 -0
  141. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.d.ts.map +1 -1
  142. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +117 -76
  143. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +1 -1
  144. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  145. package/lib/exercises/math/powers/calculateNegativePower.js +0 -2
  146. package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
  147. package/lib/exercises/math/powers/calculatePower.js +63 -8
  148. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  149. package/lib/exercises/math/powers/decimalToScientific.js +0 -15
  150. package/lib/exercises/math/powers/powerDefinition.d.ts.map +1 -1
  151. package/lib/exercises/math/powers/powerDefinition.js +39 -8
  152. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  153. package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -1
  154. package/lib/exercises/math/powers/powersPower.d.ts +5 -2
  155. package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
  156. package/lib/exercises/math/powers/powersPower.js +59 -28
  157. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  158. package/lib/exercises/math/powers/scientificToDecimal.js +0 -15
  159. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  160. package/lib/exercises/math/probaStat/index.d.ts +1 -0
  161. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  162. package/lib/exercises/math/probaStat/index.js +1 -0
  163. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +5 -0
  164. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -0
  165. package/lib/exercises/math/probaStat/randomVariable/index.js +4 -0
  166. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts +10 -0
  167. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -0
  168. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +81 -0
  169. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts +9 -0
  170. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts.map +1 -0
  171. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +95 -0
  172. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts +9 -0
  173. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts.map +1 -0
  174. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +106 -0
  175. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts +9 -0
  176. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts.map +1 -0
  177. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +105 -0
  178. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
  179. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +21 -0
  180. package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  181. package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
  182. package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
  183. package/lib/exercises/math/trigonometry/remarkableValues.js +3 -0
  184. package/lib/index.d.ts +76 -15
  185. package/lib/index.d.ts.map +1 -1
  186. package/lib/math/geometry/angle.d.ts.map +1 -1
  187. package/lib/math/geometry/angle.js +12 -7
  188. package/lib/math/geometry/line.d.ts +5 -10
  189. package/lib/math/geometry/line.d.ts.map +1 -1
  190. package/lib/math/geometry/line.js +71 -37
  191. package/lib/math/geometry/point.d.ts +2 -1
  192. package/lib/math/geometry/point.d.ts.map +1 -1
  193. package/lib/math/geometry/point.js +3 -0
  194. package/lib/math/geometry/segment.js +1 -1
  195. package/lib/math/geometry/triangles/triangle.d.ts.map +1 -1
  196. package/lib/math/geometry/triangles/triangle.js +11 -11
  197. package/lib/math/geometry/vector.d.ts +6 -0
  198. package/lib/math/geometry/vector.d.ts.map +1 -1
  199. package/lib/math/geometry/vector.js +30 -4
  200. package/lib/math/probability/randomVariable.d.ts +15 -0
  201. package/lib/math/probability/randomVariable.d.ts.map +1 -0
  202. package/lib/math/probability/randomVariable.js +56 -0
  203. package/lib/math/systems/generalSystem.d.ts +12 -1
  204. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  205. package/lib/math/systems/generalSystem.js +92 -55
  206. package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
  207. package/lib/math/trigonometry/remarkableValue.js +1 -1
  208. package/lib/playground.d.ts.map +1 -1
  209. package/lib/playground.js +1 -8
  210. package/lib/server.js +1 -1
  211. package/lib/tree/nodes/algebraicNode.d.ts +0 -1
  212. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  213. package/lib/tree/nodes/equations/equalNode.d.ts +3 -3
  214. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  215. package/lib/tree/nodes/equations/equalNode.js +3 -3
  216. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  217. package/lib/tree/nodes/functions/cosNode.js +11 -5
  218. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  219. package/lib/tree/nodes/functions/sinNode.js +11 -5
  220. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  221. package/lib/tree/nodes/functions/tanNode.js +11 -5
  222. package/lib/tree/nodes/node.d.ts +9 -8
  223. package/lib/tree/nodes/node.d.ts.map +1 -1
  224. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  225. package/lib/tree/nodes/nodeConstructor.js +1 -1
  226. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  227. package/lib/tree/nodes/numbers/numberNode.js +6 -2
  228. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +2 -1
  229. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  230. package/lib/tree/nodes/operators/binomialCoefficientNode.js +7 -2
  231. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  232. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  233. package/lib/tree/nodes/operators/powerNode.d.ts +4 -4
  234. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  235. package/lib/tree/nodes/operators/powerNode.js +5 -5
  236. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  237. package/lib/tree/parsers/latexParser.js +6 -0
  238. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAsEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAWvD,CAAC"}
1
+ {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6FF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
@@ -8,6 +8,20 @@ import { SinNode } from "../../../tree/nodes/functions/sinNode.js";
8
8
  import { TanNode } from "../../../tree/nodes/functions/tanNode.js";
9
9
  import { DegreeNode } from "../../../tree/nodes/geometry/degree.js";
10
10
  import { random } from "../../../utils/alea/random.js";
11
+ const getHint = (identifiers) => {
12
+ return "Utilise la calculatrice, réglée en mode degrés.";
13
+ };
14
+ const getCorrection = (identifiers) => {
15
+ const { degree, trigoFunct } = identifiers;
16
+ const node = trigoFunct === "tan" ? TanNode : trigoFunct === "sin" ? SinNode : CosNode;
17
+ return `On utilise la calculatrice, réglée en mode degrés.
18
+
19
+ On obtient :
20
+
21
+ $$
22
+ ${new node(new DegreeNode(degree)).toTex()} \\approx ${getAnswer(identifiers)}
23
+ $$`;
24
+ };
11
25
  const getInstruction = (identifiers) => {
12
26
  const { degree, trigoFunct } = identifiers;
13
27
  const node = trigoFunct === "tan" ? TanNode : trigoFunct === "sin" ? SinNode : CosNode;
@@ -44,12 +58,17 @@ const getCalculateCosSinAndTanQuestion = () => {
44
58
  const trigoFunct = random(trigo);
45
59
  const degree = randint(1, 180);
46
60
  const identifiers = { degree, trigoFunct };
61
+ return getQuestionFromIdentifiers(identifiers);
62
+ };
63
+ const getQuestionFromIdentifiers = (identifiers) => {
47
64
  const question = {
48
65
  answer: getAnswer(identifiers),
49
66
  instruction: getInstruction(identifiers),
50
67
  keys: [],
51
68
  answerFormat: "tex",
52
69
  identifiers,
70
+ hint: getHint(identifiers),
71
+ correction: getCorrection(identifiers),
53
72
  };
54
73
  return question;
55
74
  };
@@ -77,4 +96,6 @@ export const calculateCosSinAndTan = {
77
96
  getPropositions,
78
97
  isAnswerValid,
79
98
  subject: "Mathématiques",
99
+ hasHintAndCorrection: true,
100
+ getQuestionFromIdentifiers,
80
101
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainRemarkableValues.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
1
+ {"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainRemarkableValues.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { mainTrigoValues, } from "../../../math/trigonometry/remarkableValues.js";
1
+ import { mainTrigoValues } from "../../../math/trigonometry/remarkableValues.js";
2
2
  import { randint } from "../../../math/utils/random/randint.js";
3
3
  import { cos } from "../../../tree/nodes/functions/cosNode.js";
4
4
  import { sin } from "../../../tree/nodes/functions/sinNode.js";
@@ -1 +1 @@
1
- {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/remarkableValues.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACL,QAAQ,EAWT,MAAM,mBAAmB,CAAC;AA2C3B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AA4CF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
1
+ {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/remarkableValues.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACL,QAAQ,EAYT,MAAM,mBAAmB,CAAC;AA2C3B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAkDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
@@ -52,6 +52,9 @@ const getRemarkableValues = () => {
52
52
  mainValue,
53
53
  angleIdentifiers: remarkableValue.angle.toIdentifiers(),
54
54
  };
55
+ return getQuestionFromIdentifiers(identifiers);
56
+ };
57
+ const getQuestionFromIdentifiers = (identifiers) => {
55
58
  const question = {
56
59
  instruction: getInstruction(identifiers),
57
60
  startStatement: getStartStatement(identifiers),
package/lib/index.d.ts CHANGED
@@ -320,9 +320,11 @@ declare const mathExercises: (Exercise<{
320
320
  op2?: string;
321
321
  };
322
322
  }, {}> | Exercise<{
323
- solutionNodeIds: any;
324
- equationNodeIds: any;
325
- }, {}> | Exercise<{
323
+ solutionNodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
324
+ equationNodeIds: import("./tree/nodes/equations/equalNode.js").EqualNodeIdentifiers;
325
+ }, {
326
+ degree: string;
327
+ }> | Exercise<{
326
328
  type: number;
327
329
  a: number;
328
330
  b: number;
@@ -420,13 +422,11 @@ declare const mathExercises: (Exercise<{
420
422
  b: number;
421
423
  monomFirst: boolean;
422
424
  }, {}> | Exercise<{
423
- coeffs: number[][];
424
- isXAsked: boolean;
425
+ coeffsIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[][];
425
426
  }, {}> | Exercise<{
426
- coeffs: number[][];
427
- isXAsked: boolean;
427
+ coeffsIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[][];
428
428
  }, {}> | Exercise<{
429
- sysCoeffs: number[][];
429
+ sysIds: import("./math/systems/generalSystem.js").GeneralSystemIdentifiers;
430
430
  x: number;
431
431
  y: number;
432
432
  }, {}> | Exercise<{
@@ -1018,8 +1018,10 @@ declare const mathExercises: (Exercise<{
1018
1018
  x: number;
1019
1019
  y: number;
1020
1020
  }, {}> | Exercise<{
1021
- xValue: number;
1022
- yValue: number;
1021
+ x1: number;
1022
+ x2: number;
1023
+ y1: number;
1024
+ y2: number;
1023
1025
  }, {}> | Exercise<{
1024
1026
  xValue: number;
1025
1027
  yValue: number;
@@ -1061,6 +1063,12 @@ declare const mathExercises: (Exercise<{
1061
1063
  absciss: number;
1062
1064
  abscissTex: string;
1063
1065
  coeff: number;
1066
+ }, {}> | Exercise<{
1067
+ vectorIdentifiers: import("./math/geometry/vector.js").VectorIdentifiers;
1068
+ pointIdentifiers: import("./math/geometry/point.js").PointIdentifiers;
1069
+ }, {}> | Exercise<{
1070
+ pointIdentifiers: import("./math/geometry/point.js").PointIdentifiers;
1071
+ pointBIdentifiers: import("./math/geometry/point.js").PointIdentifiers;
1064
1072
  }, {}> | Exercise<{
1065
1073
  coin: boolean;
1066
1074
  radius: number;
@@ -1120,10 +1128,10 @@ declare const mathExercises: (Exercise<{
1120
1128
  A: number[];
1121
1129
  B: number[];
1122
1130
  }, {}> | Exercise<{
1123
- xu: number;
1124
- yu: number;
1125
- xv: number;
1126
- yv: number;
1131
+ xu: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1132
+ yu: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1133
+ xv: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1134
+ yv: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1127
1135
  }, {}> | Exercise<{
1128
1136
  xA: number;
1129
1137
  xB: number;
@@ -1353,6 +1361,44 @@ declare const mathExercises: (Exercise<{
1353
1361
  x: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1354
1362
  y: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1355
1363
  isOnLine: boolean;
1364
+ }, {}> | Exercise<{
1365
+ pointIds: import("./math/geometry/point.js").PointIdentifiers;
1366
+ vectorIds: import("./math/geometry/vector.js").VectorIdentifiers;
1367
+ }, {}> | Exercise<{
1368
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1369
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1370
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1371
+ }, {}> | Exercise<{
1372
+ b: number;
1373
+ secondPoint: number[];
1374
+ }, {}> | Exercise<{
1375
+ a: number;
1376
+ b: number;
1377
+ isAskingA: boolean;
1378
+ }, {}> | Exercise<{
1379
+ xA: number;
1380
+ xB: number;
1381
+ yA: number;
1382
+ yB: number;
1383
+ }, {}> | Exercise<{
1384
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1385
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1386
+ }, {}> | Exercise<{
1387
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1388
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1389
+ fakeBIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1390
+ }, {}> | Exercise<{
1391
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1392
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1393
+ cIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1394
+ colinearityCoeffIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1395
+ fakeCIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1396
+ }, {}> | Exercise<{
1397
+ pointIds: import("./math/geometry/point.js").PointIdentifiers;
1398
+ vectorIds: import("./math/geometry/vector.js").VectorIdentifiers;
1399
+ }, {}> | Exercise<{
1400
+ cartesianCoeffs1: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1401
+ cartesianCoeffs2: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1356
1402
  }, {}> | Exercise<{
1357
1403
  triangleIdentifiers: import("./math/geometry/triangles/triangle.js").TriangleIdentifiers;
1358
1404
  type: number;
@@ -1483,7 +1529,9 @@ declare const mathExercises: (Exercise<{
1483
1529
  a: number;
1484
1530
  b: number;
1485
1531
  c: number;
1486
- }, {}> | Exercise<{
1532
+ }, {
1533
+ useOnlyPowersOfTen: boolean;
1534
+ }> | Exercise<{
1487
1535
  a: number;
1488
1536
  b: number;
1489
1537
  c: number;
@@ -1662,6 +1710,19 @@ declare const mathExercises: (Exercise<{
1662
1710
  }, {
1663
1711
  useFractions?: boolean;
1664
1712
  }> | Exercise<{
1713
+ xValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1714
+ yValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1715
+ }, {}> | Exercise<{
1716
+ xValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1717
+ yValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1718
+ }, {}> | Exercise<{
1719
+ xValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1720
+ yValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1721
+ isLaw: boolean;
1722
+ }, {}> | Exercise<{
1723
+ xValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1724
+ yValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1725
+ }, {}> | Exercise<{
1665
1726
  firstValue: number;
1666
1727
  askedRank: number;
1667
1728
  reason: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE,UAAU;IAmB/C,aAAa,IAAI,gBAAgB;IASjC,WAAW,CAAC,CAAC,EAAE,KAAK;IAIpB,MAAM,CAAC,CAAC,EAAE,KAAK;IAqBf,SAAS,CAAC,CAAC,EAAE,KAAK;IASlB,gBAAgB,CAAC,CAAC,EAAE,KAAK;IAyCzB,MAAM;IAMN,eAAe,CAAC,CAAC,EAAE,KAAK;IAwCxB,gBAAgB,CAAC,CAAC,EAAE,KAAK;IAqBzB,QAAQ,CAAC,QAAQ,UAAQ;IAkBzB,YAAY,CAAC,QAAQ,UAAQ;IAW7B,OAAO;IAIP,KAAK;IAIL,qBAAqB,CAAC,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,GACL,GAAE;QACD,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;KAC7C;IAgBN,UAAU,CAAC,IAAI,CAAC,EAAE;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CA2BF"}
@@ -91,10 +91,12 @@ export class Angle {
91
91
  return false;
92
92
  const apexesVec = VectorConstructor.fromPoints(this.points[1], a.points[1]);
93
93
  const line = new Line(this.points[1], a.points[1]);
94
- const aPointIndexOnLine = a.points.findIndex((p, i) => i !== 1 && line.includes(p, true));
95
- const thisPointIndexOnLine = this.points.findIndex((p, i) => i !== 1 && line.includes(p, true));
94
+ const aPointIndexOnLine = a.points.findIndex((p, i) => i !== 1 && line.includes(p, 0.00000001));
95
+ const thisPointIndexOnLine = this.points.findIndex((p, i) => i !== 1 && line.includes(p, 0.00000001));
96
+ console.log(aPointIndexOnLine, thisPointIndexOnLine);
96
97
  if (aPointIndexOnLine < 0 || thisPointIndexOnLine < 0)
97
98
  return false;
99
+ console.log("ok so far");
98
100
  const vecs = [
99
101
  [
100
102
  VectorConstructor.fromPoints(this.points[1], this.points[thisPointIndexOnLine]),
@@ -107,7 +109,7 @@ export class Angle {
107
109
  ];
108
110
  return (vecs[0][0].hasSameOrientation(apexesVec) &&
109
111
  vecs[1][0].hasOppositeOrientation(apexesVec) &&
110
- vecs[0][1].scalarProduct(vecs[1][1]).evaluate() < 0);
112
+ vecs[0][1].scalarProductNumber(vecs[1][1]) < 0);
111
113
  }
112
114
  isFlat() {
113
115
  return VectorConstructor.fromPoints(this.points[1], this.points[2]).isColinear(VectorConstructor.fromPoints(this.points[1], this.points[0]));
@@ -119,13 +121,15 @@ export class Angle {
119
121
  if (this.isFlat() || a.isFlat())
120
122
  return false;
121
123
  const line = new Line(this.points[1], a.points[1]);
122
- const aPointIndexOnLine = a.points.findIndex((p, i) => i !== 1 && line.includes(p, true));
123
- const thisPointIndexOnLine = this.points.findIndex((p, i) => i !== 1 && line.includes(p, true));
124
+ const aPointIndexOnLine = a.points.findIndex((p, i) => i !== 1 && line.includes(p, 0.0000001));
125
+ const thisPointIndexOnLine = this.points.findIndex((p, i) => i !== 1 && line.includes(p, 0.0000001));
126
+ console.log(aPointIndexOnLine, thisPointIndexOnLine);
124
127
  if (aPointIndexOnLine < 0 || thisPointIndexOnLine < 0)
125
128
  return false;
126
129
  //angle non plat
127
- if (line.includes(a.points[2 - aPointIndexOnLine], true))
130
+ if (line.includes(a.points[2 - aPointIndexOnLine], 0.0000001))
128
131
  return false;
132
+ console.log("ok so far");
129
133
  const vecs = [
130
134
  [
131
135
  VectorConstructor.fromPoints(this.points[1], this.points[thisPointIndexOnLine]),
@@ -137,11 +141,12 @@ export class Angle {
137
141
  ],
138
142
  ];
139
143
  return (vecs[0][0].hasSameOrientation(vecs[1][0]) &&
140
- vecs[0][1].scalarProduct(vecs[1][1]).evaluate() > 0);
144
+ vecs[0][1].scalarProductNumber(vecs[1][1]) > 0);
141
145
  }
142
146
  isSummitOpposite(a) {
143
147
  if (!this.hasSameApex(a))
144
148
  return false;
149
+ console.log("has same ap");
145
150
  const vecs = [
146
151
  [
147
152
  VectorConstructor.fromPoints(this.points[1], this.points[0]),
@@ -1,8 +1,6 @@
1
1
  import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps.js";
2
2
  import { AlgebraicNode } from "../../tree/nodes/algebraicNode.js";
3
3
  import { EqualNode } from "../../tree/nodes/equations/equalNode.js";
4
- import { AddNode } from "../../tree/nodes/operators/addNode.js";
5
- import { SubstractNode } from "../../tree/nodes/operators/substractNode.js";
6
4
  import { Point, PointIdentifiers } from "./point.js";
7
5
  import { Segment } from "./segment.js";
8
6
  import { Vector } from "./vector.js";
@@ -15,6 +13,8 @@ export declare abstract class LineConstructor {
15
13
  static random(name?: string): Line;
16
14
  static fromIdentifiers(identifiers: LineIdentifiers): Line;
17
15
  static fromSegment(segment: Segment): Line;
16
+ static fromPointAndVector(point: Point, vector: Vector): Line;
17
+ static fromCartesian(eq: EqualNode): Line;
18
18
  }
19
19
  export declare class Line {
20
20
  pointA: Point;
@@ -35,18 +35,13 @@ export declare class Line {
35
35
  getDirectorVector(): Vector;
36
36
  getParallele(point: Point): Line;
37
37
  getPerpendicular(point: Point): Line;
38
- includes(point: Point, allowApprox?: boolean): boolean;
38
+ includes(point: Point, margin?: number): boolean;
39
39
  getPointWithX(x: AlgebraicNode, name?: string): Point;
40
40
  getPointWithY(y: AlgebraicNode, name?: string): Point;
41
41
  getRandomPoint(name?: string): Point;
42
- getEquation: (u: Vector, a: Point) => EqualNode;
42
+ getReductEquation: () => EqualNode;
43
43
  getCartesianEquation(): EqualNode;
44
- toCartesian(): AddNode;
45
- toCartesianCoeffs(): {
46
- a: AlgebraicNode;
47
- b: import("../../tree/nodes/functions/oppositeNode.js").OppositeNode<AlgebraicNode>;
48
- c: SubstractNode;
49
- };
44
+ toCartesianCoeffs(): AlgebraicNode[];
50
45
  toTex(): string;
51
46
  toTexNoLeftRight(): string;
52
47
  toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, color, label, }?: ToGGBCommandsProps): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAG1F,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAS,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,OAAO,EAAO,MAAM,uCAAuC,CAAC;AAMrE,OAAO,EACL,aAAa,EAEd,MAAM,6CAA6C,CAAC;AAKrD,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AACF,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;IAO3B,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,eAAe;IAOnD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO;CAGpC;AACD,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,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QAAO,SAAS,CAO/B;IAEF,oBAAoB,IAAI,SAAS;IAUjC,iBAAiB;IA2BjB,KAAK;IAGL,gBAAgB;IAIhB,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,EAChC,oBAA2B,EAC3B,KAAiB,EACjB,KAAiB,GAClB,GAAE,kBAAuB;IA2C5B,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,MAAM;CAe7C"}
@@ -2,13 +2,16 @@ import { randomSegmentName } from "../../exercises/utils/geometry/randomSegmentN
2
2
  import { randomColor } from "../../geogebra/colors.js";
3
3
  import { equal, EqualNode } from "../../tree/nodes/equations/equalNode.js";
4
4
  import { opposite } from "../../tree/nodes/functions/oppositeNode.js";
5
+ import { hasVariableNode } from "../../tree/nodes/hasVariableNode.js";
5
6
  import { NumberNode } from "../../tree/nodes/numbers/numberNode.js";
6
7
  import { AddNode, add } from "../../tree/nodes/operators/addNode.js";
7
8
  import { FractionNode, frac } from "../../tree/nodes/operators/fractionNode.js";
8
9
  import { MultiplyNode, multiply, } from "../../tree/nodes/operators/multiplyNode.js";
9
10
  import { SubstractNode, substract, } from "../../tree/nodes/operators/substractNode.js";
10
11
  import { VariableNode } from "../../tree/nodes/variables/variableNode.js";
12
+ import { isInt } from "../../utils/isInt.js";
11
13
  import { GeneralSystem } from "../systems/generalSystem.js";
14
+ import { gcd } from "../utils/arithmetic/gcd.js";
12
15
  import { randint } from "../utils/random/randint.js";
13
16
  import { Point, PointConstructor } from "./point.js";
14
17
  import { VectorConstructor } from "./vector.js";
@@ -26,6 +29,26 @@ export class LineConstructor {
26
29
  static fromSegment(segment) {
27
30
  return new Line(segment.pointA, segment.pointB);
28
31
  }
32
+ static fromPointAndVector(point, vector) {
33
+ const pointB = vector.getEndPoint(point);
34
+ return new Line(point, pointB);
35
+ }
36
+ static fromCartesian(eq) {
37
+ if (!hasVariableNode(eq.leftChild, "y")) {
38
+ //vertical
39
+ const xEq = eq.isolate("x");
40
+ return new Line(new Point("A", xEq.rightChild, (0).toTree()), new Point("B", xEq.rightChild, (1).toTree()));
41
+ }
42
+ const yWithZero = eq
43
+ .toDetailedEvaluation({ x: (0).toTree() })
44
+ .isolate("y").rightChild;
45
+ const pointA = [(0).toTree(), yWithZero];
46
+ const yWithOne = eq
47
+ .toDetailedEvaluation({ x: (1).toTree() })
48
+ .isolate("y").rightChild;
49
+ const pointB = [(1).toTree(), yWithOne];
50
+ return new Line(new Point("A", pointA[0], pointA[1]), new Point("B", pointB[0], pointB[1]));
51
+ }
29
52
  }
30
53
  export class Line {
31
54
  pointA;
@@ -95,20 +118,33 @@ export class Line {
95
118
  const secondPoint = ortho.getEndPoint(point);
96
119
  return new Line(point, secondPoint);
97
120
  }
98
- includes(point, allowApprox = false) {
121
+ includes(point, margin = 0) {
99
122
  if (this.isVertical) {
100
- if (allowApprox) {
101
- return (Math.abs(point.x.evaluate() - this.pointA.x.evaluate()) < 0.0000001);
123
+ if (margin) {
124
+ return Math.abs(point.x.evaluate() - this.pointA.x.evaluate()) < margin;
102
125
  }
103
126
  else
104
127
  return point.x.equals(this.pointA.x);
105
128
  }
106
- const evaluation = new SubstractNode(point.y, new AddNode(new MultiplyNode(this.a, point.x), this.b)).evaluate({});
107
- if (allowApprox) {
108
- return Math.abs(evaluation) < 0.0000001;
129
+ // console.log(
130
+ // "y",
131
+ // point.y.toTex(),
132
+ // "a",
133
+ // this.a?.toTex(),
134
+ // "x",
135
+ // point.x.toTex(),
136
+ // "b",
137
+ // this.b?.toTex(),
138
+ // );
139
+ // console.log("y", this.pointA.y.toTex(), "x", this.pointA.x.toTex());
140
+ if (margin) {
141
+ const projOrtho = point.project(this);
142
+ return projOrtho.distanceTo(point) < margin;
109
143
  }
110
- else
144
+ else {
145
+ const evaluation = new SubstractNode(point.y, new AddNode(new MultiplyNode(this.a, point.x), this.b)).evaluate({});
111
146
  return evaluation === 0;
147
+ }
112
148
  }
113
149
  getPointWithX(x, name) {
114
150
  if (this.isVertical)
@@ -134,42 +170,39 @@ export class Line {
134
170
  const y = new AddNode(new MultiplyNode(this.a, x), this.b).simplify();
135
171
  return new Point(name ?? "A", x, y);
136
172
  }
137
- getEquation = (u, a) => {
138
- const x = new VariableNode("x");
139
- const y = new VariableNode("y");
140
- const uYDivuX = new FractionNode(u.y, u.x).simplify();
141
- const natural = u.getYAsNumber() % u.getXAsNumber() === 0;
142
- const aYuX = new MultiplyNode(a.y, u.x).simplify();
143
- const aXuY = new MultiplyNode(a.x, u.y).simplify();
144
- const rightSide = new AddNode(natural
145
- ? new MultiplyNode(uYDivuX, x).simplify()
146
- : new MultiplyNode(uYDivuX, x), new FractionNode(new SubstractNode(aYuX, aXuY).simplify(), u.x).simplify());
147
- const equation = new EqualNode(y, rightSide);
148
- return equation;
173
+ getReductEquation = () => {
174
+ if (this.isVertical)
175
+ return new EqualNode(new VariableNode("x"), this.pointA.y);
176
+ return new EqualNode(new VariableNode("y"), add(multiply(this.a, "x"), this.b));
149
177
  };
150
178
  getCartesianEquation() {
151
- const u = VectorConstructor.fromPoints(this.pointA, this.pointB);
152
- const b = opposite(u.x);
153
- const a = u.y;
154
- const c = add(opposite(multiply(a, this.pointA.x)), opposite(multiply(b, this.pointA.y)));
179
+ const [a, b, c] = this.toCartesianCoeffs();
155
180
  return equal(add(add(multiply(a, "x"), multiply(b, "y")), c).simplify({
156
181
  forbidFactorize: true,
157
182
  }), 0);
158
183
  }
159
- toCartesian() {
160
- const { a, b, c } = this.toCartesianCoeffs();
161
- return add(add(multiply(a, "x"), multiply(b, "x")), c);
162
- }
163
184
  toCartesianCoeffs() {
164
- //ax+by+c = 0
165
- //u(-b,a)
166
- //axA+byA+c = 0 donc c = -axA-byA
167
185
  const u = VectorConstructor.fromPoints(this.pointA, this.pointB);
168
- const a = u.y;
169
- const b = opposite(u.x);
170
- // const a = u.getYAsNumber();
171
- const c = substract(opposite(multiply(a, this.pointA.x)), multiply(b, this.pointA.y));
172
- return { a, b, c };
186
+ let b = opposite(u.x);
187
+ let a = u.y;
188
+ let c = add(opposite(multiply(a, this.pointA.x)), opposite(multiply(b, this.pointA.y)));
189
+ const aEv = a.evaluate();
190
+ const bEv = b.evaluate();
191
+ const cEv = c.evaluate();
192
+ if (aEv <= 0 && bEv <= 0 && cEv <= 0) {
193
+ a = opposite(a);
194
+ b = opposite(b);
195
+ c = opposite(c);
196
+ }
197
+ if (isInt(aEv) && isInt(bEv) && isInt(cEv)) {
198
+ const pgcd = gcd(aEv, bEv, cEv);
199
+ if (pgcd !== 1) {
200
+ a = frac(a, pgcd);
201
+ b = frac(b, pgcd);
202
+ c = frac(c, pgcd);
203
+ }
204
+ }
205
+ return [a.simplify(), b.simplify(), c.simplify()];
173
206
  }
174
207
  toTex() {
175
208
  return this.name;
@@ -211,12 +244,13 @@ export class Line {
211
244
  intersect(line, intersectName) {
212
245
  if (line.isParallele(this))
213
246
  throw Error("Lines are parallel");
214
- const { a, b, c } = this.toCartesianCoeffs();
215
- const { a: a2, b: b2, c: c2 } = line.toCartesianCoeffs();
247
+ const [a, b, c] = this.toCartesianCoeffs();
248
+ const [a2, b2, c2] = line.toCartesianCoeffs();
216
249
  const sys = new GeneralSystem([
217
250
  [a, b, opposite(c)],
218
251
  [a2, b2, opposite(c2)],
219
252
  ]);
253
+ console.log("presolve", [a, b, c, a2, b2, c2].map((e) => e.toTex()));
220
254
  const solve = sys.solve();
221
255
  return new Point(intersectName ?? "I", solve.x, solve.y);
222
256
  }
@@ -1,4 +1,4 @@
1
- import { AlgebraicNode } from "../../tree/nodes/algebraicNode.js";
1
+ import { AlgebraicNode, SimplifyOptions } from "../../tree/nodes/algebraicNode.js";
2
2
  import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps.js";
3
3
  import { NodeIdentifiers } from "../../tree/nodes/nodeConstructor.js";
4
4
  import { Line } from "./line.js";
@@ -49,5 +49,6 @@ export declare class Point {
49
49
  centralSymetric(center: Point, name?: string): Point;
50
50
  project(line: Line, name?: string): Point;
51
51
  axialSymetric(line: Line, name?: string): Point;
52
+ simplify(opts?: SimplifyOptions): Point;
52
53
  }
53
54
  //# sourceMappingURL=point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AACF,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;IAKhC,MAAM,CAAC,MAAM,CAAC,IAAI,SAAM;IAGxB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAM,EAAE,GAAG,SAAK,GAAG,KAAK;IAMvD,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,gBAAgB;IAQpD,MAAM,CAAC,SAAS,CACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,EACE,OAAa,EACb,WAAW,GACZ,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO;IAQpD,MAAM,CAAC,eAAe,CACpB,KAAK,EAAE,MAAM,EACb,EACE,KAAK,EACL,WAAW,EACX,mBAAm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);
160
160
  return this.centralSymetric(projOrtho, name);
161
161
  }
162
+ simplify(opts) {
163
+ return new Point(this.name, this.x.simplify(opts), this.y.simplify(opts));
164
+ }
162
165
  }
@@ -124,7 +124,7 @@ export class Segment {
124
124
  const pointVec = VectorConstructor.fromPoints(this.pointA, point);
125
125
  if (!vec.isColinear(pointVec))
126
126
  return false;
127
- const product = vec.scalarProduct(pointVec).evaluate();
127
+ const product = vec.scalarProductNumber(pointVec);
128
128
  return product >= 0 && product <= this.getLength() ** 2;
129
129
  }
130
130
  toVector() {
@@ -1 +1 @@
1
- {"version":3,"file":"triangle.d.ts","sourceRoot":"","sources":["../../../../src/math/geometry/triangles/triangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAEL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAG7C,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAEF,8BAAsB,mBAAmB;IACvC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,mBAAmB,GAAG,QAAQ;IAgBlE,MAAM,CAAC,eAAe,CAAC,EACrB,KAAuB,EACvB,UAAkB,EAClB,QAAgB,EAChB,QAAY,GACb;;;;;KAAA,GAAG,QAAQ;IA+CZ,MAAM,CAAC,UAAU;CAQlB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,CAAC,eAAe,GAAG,SAAS,CAAC,EAAE,CAAC;IAC/C,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;IACvC,kBAAkB,CAAC,EAAE,eAAe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AAE,IAAI,CAAC,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;CAgB5E"}
@@ -195,17 +195,17 @@ export class Triangle {
195
195
  this.points[(summitIndex + 1) % 3],
196
196
  ]);
197
197
  this.commands.push(...foot.toGGBCommand(), ...height.toGGBCommands(false, { style: 2 }), ...angle.toCommands());
198
- if (!this.sides[summitIndex].includes(foot)) {
199
- const distancesToSideSummits = [
200
- this.sides[summitIndex].pointA,
201
- this.sides[summitIndex].pointB,
202
- ].map((p) => p.distanceTo(foot));
203
- const closestPoint = distancesToSideSummits[0] < distancesToSideSummits[1]
204
- ? this.sides[summitIndex].pointA
205
- : this.sides[summitIndex].pointB;
206
- const prolongement = new Segment(closestPoint, foot);
207
- this.commands.push(...prolongement.toGGBCommands(false, { style: 2 }));
208
- }
198
+ // if (!this.sides[summitIndex].includes(foot)) {
199
+ const distancesToSideSummits = [
200
+ this.sides[summitIndex].pointA,
201
+ this.sides[summitIndex].pointB,
202
+ ].map((p) => p.distanceTo(foot));
203
+ const closestPoint = distancesToSideSummits[0] < distancesToSideSummits[1]
204
+ ? this.sides[summitIndex].pointA
205
+ : this.sides[summitIndex].pointB;
206
+ const prolongement = new Segment(closestPoint, foot);
207
+ this.commands.push(...prolongement.toGGBCommands(false, { style: 2 }));
208
+ // }
209
209
  }
210
210
  generateCoords() {
211
211
  const coords = this.points.map((p) => [p.x.evaluate(), p.y.evaluate()]);