math-exercises 2.2.55 → 2.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/lib/exercises/math/calcul/proportionality/index.d.ts +1 -0
  2. package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/proportionality/index.js +1 -0
  4. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts +8 -0
  5. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -0
  6. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +91 -0
  7. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +0 -1
  9. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
  10. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
  12. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  13. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  14. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  15. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
  16. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
  17. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
  18. package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
  19. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
  20. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
  21. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -0
  22. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  23. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
  24. package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
  25. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts +10 -0
  26. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
  27. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
  28. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
  29. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
  31. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
  32. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  34. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
  35. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +0 -1
  36. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  37. package/lib/exercises/math/geometry/thales/index.js +1 -0
  38. package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
  39. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  40. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  41. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
  42. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  43. package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
  44. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
  45. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
  46. package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
  47. package/lib/exercises/math/percent/index.d.ts +0 -1
  48. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  49. package/lib/exercises/math/percent/index.js +0 -1
  50. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
  51. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
  52. package/lib/exercises/math/probaStat/binomial/binomialInequation.js +159 -0
  53. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
  54. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
  55. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
  56. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
  57. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
  58. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
  59. package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
  60. package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
  61. package/lib/exercises/math/probaStat/binomial/index.js +20 -0
  62. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
  63. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
  64. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
  65. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
  66. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  67. package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
  68. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
  69. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  70. package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
  71. package/lib/exercises/math/probaStat/index.d.ts +1 -3
  72. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  73. package/lib/exercises/math/probaStat/index.js +1 -3
  74. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
  75. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  76. package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
  77. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +4 -1
  78. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  79. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -5
  80. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +0 -1
  81. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
  82. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  83. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
  84. package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
  85. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  86. package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
  87. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  88. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
  89. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  90. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
  91. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  92. package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
  93. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
  94. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  95. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  96. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
  97. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  98. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
  99. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
  100. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  101. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
  102. package/lib/exercises/pc/mole/molarMass.js +1 -1
  103. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
  104. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  105. package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
  106. package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
  107. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  108. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  109. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  110. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  111. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  112. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
  113. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  114. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
  115. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  116. package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
  117. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  118. package/lib/exercises/utils/getDistinctQuestions.js +11 -4
  119. package/lib/index.d.ts +94 -26
  120. package/lib/index.d.ts.map +1 -1
  121. package/lib/math/geometry/CloudPoints.d.ts +5 -1
  122. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  123. package/lib/math/geometry/CloudPoints.js +5 -0
  124. package/lib/math/geometry/line.d.ts +23 -1
  125. package/lib/math/geometry/line.d.ts.map +1 -1
  126. package/lib/math/geometry/line.js +53 -2
  127. package/lib/math/geometry/point.d.ts +15 -13
  128. package/lib/math/geometry/point.d.ts.map +1 -1
  129. package/lib/math/geometry/point.js +28 -12
  130. package/lib/math/geometry/segment.d.ts +11 -1
  131. package/lib/math/geometry/segment.d.ts.map +1 -1
  132. package/lib/math/geometry/segment.js +12 -0
  133. package/lib/math/geometry/triangle.d.ts +67 -0
  134. package/lib/math/geometry/triangle.d.ts.map +1 -0
  135. package/lib/math/geometry/triangle.js +227 -0
  136. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  137. package/lib/math/numbers/decimals/decimal.js +0 -2
  138. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  139. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  140. package/lib/math/numbers/rationals/rational.js +5 -0
  141. package/lib/math/polynomials/generalTrinom.d.ts +2 -2
  142. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
  143. package/lib/math/probability/binomial.d.ts +10 -0
  144. package/lib/math/probability/binomial.d.ts.map +1 -0
  145. package/lib/math/probability/binomial.js +30 -0
  146. package/lib/math/sets/intervals/intervals.d.ts +1 -1
  147. package/lib/math/systems/generalSystem.d.ts +11 -0
  148. package/lib/math/systems/generalSystem.d.ts.map +1 -0
  149. package/lib/math/systems/generalSystem.js +79 -0
  150. package/lib/playground.d.ts.map +1 -1
  151. package/lib/playground.js +1 -4
  152. package/lib/server.js +0 -2
  153. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
  154. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  155. package/lib/tree/nodes/inequations/inequationNode.js +1 -1
  156. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
  157. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/node.d.ts +2 -1
  159. package/lib/tree/nodes/node.d.ts.map +1 -1
  160. package/lib/tree/nodes/node.js +1 -0
  161. package/lib/tree/nodes/nodeConstructor.d.ts +4 -3
  162. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  163. package/lib/tree/nodes/nodeConstructor.js +4 -0
  164. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  165. package/lib/tree/nodes/operators/addNode.js +20 -8
  166. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
  167. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
  168. package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -0
  169. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  170. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  171. package/lib/tree/nodes/operators/fractionNode.js +2 -4
  172. package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
  173. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  174. package/lib/tree/nodes/operators/operatorNode.js +1 -0
  175. package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
  176. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  177. package/lib/tree/nodes/sets/intervalNode.js +1 -0
  178. package/lib/utils/alea/random.d.ts.map +1 -1
  179. package/package.json +1 -1
@@ -1,5 +1,8 @@
1
1
  import { Exercise } from "../../../exercises/exercise";
2
- type Identifiers = {};
2
+ type Identifiers = {
3
+ ggbCommands: string[];
4
+ movementType: string;
5
+ };
3
6
  export declare const typeOfMovement: Exercise<Identifiers>;
4
7
  export {};
5
8
  //# sourceMappingURL=typeOfMovement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeOfMovement.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/typeOfMovement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkHtB,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
1
+ {"version":3,"file":"typeOfMovement.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/typeOfMovement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAkHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -18,7 +18,7 @@ const getTypeOfMovementQuestion = () => {
18
18
  }),
19
19
  keys: [],
20
20
  answerFormat: "raw",
21
- identifiers: {},
21
+ identifiers: { movementType: exo.answer, ggbCommands: ggb.commands },
22
22
  };
23
23
  return question;
24
24
  };
@@ -1,5 +1,7 @@
1
1
  import { Exercise } from "../../exercises/exercise";
2
- type Identifiers = {};
2
+ type Identifiers = {
3
+ commands: string[];
4
+ };
3
5
  export declare const recognizeRefractionOrReflectionAngles: Exercise<Identifiers>;
4
6
  export {};
5
7
  //# sourceMappingURL=recognizeRefractionOrReflectionAngles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeRefractionOrReflectionAngles.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/recognizeRefractionOrReflectionAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAmHtB,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAcvE,CAAC"}
1
+ {"version":3,"file":"recognizeRefractionOrReflectionAngles.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/recognizeRefractionOrReflectionAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAmHF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAcvE,CAAC"}
@@ -27,7 +27,7 @@ const getRecognizeRefractionOrReflectionAnglesQuestion = () => {
27
27
  coords: exo.coords,
28
28
  }),
29
29
  answerFormat: "raw",
30
- identifiers: {},
30
+ identifiers: { commands: exo.commands },
31
31
  };
32
32
  return question;
33
33
  };
@@ -2,5 +2,8 @@ export type ToGGBCommandsProps = {
2
2
  isFixed?: boolean;
3
3
  showLabel?: boolean;
4
4
  showUnderlyingPointsLabel?: boolean;
5
+ style?: number;
6
+ size?: number;
7
+ color?: string;
5
8
  };
6
9
  //# sourceMappingURL=toGGBCommandsProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -6,5 +6,9 @@ export declare const toolBarConstructor: (options: {
6
6
  intersect?: boolean;
7
7
  vector?: boolean;
8
8
  circleTwoPoints?: boolean;
9
+ circleRadius?: boolean;
10
+ segment?: boolean;
11
+ segmentFixed?: boolean;
12
+ polygon?: boolean;
9
13
  }) => string;
10
14
  //# sourceMappingURL=toolBarConstructor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAAa;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,WAUA,CAAC"}
1
+ {"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAAa;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,WAcA,CAAC"}
@@ -17,6 +17,14 @@ const toolBarConstructor = (options) => {
17
17
  customToolBar += "||7";
18
18
  if (options.circleTwoPoints)
19
19
  customToolBar += "||10";
20
+ if (options.segment)
21
+ customToolBar += "||15";
22
+ if (options.segmentFixed)
23
+ customToolBar += "||45";
24
+ if (options.circleRadius)
25
+ customToolBar += "||34";
26
+ if (options.polygon)
27
+ customToolBar += "||16";
20
28
  return customToolBar;
21
29
  };
22
30
  exports.toolBarConstructor = toolBarConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,MAC/B,MAAM,QACJ,MAAM,wBACS,SAAS,GAAG,EAAE,GAAG,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,kBAC1E,SAAS,GAAG,EAAE,GAAG,CAAC,EAapB,CAAC"}
1
+ {"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,MAC/B,MAAM,QACJ,MAAM,wBACS,SAAS,GAAG,EAAE,GAAG,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,kBAC1E,SAAS,GAAG,EAAE,GAAG,CAAC,EAapB,CAAC"}
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getDistinctQuestions = exports.equalTab = void 0;
7
+ const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
4
8
  function equalTab(array1, array2) {
5
9
  if (!array1 && !array2)
6
10
  return true;
@@ -38,8 +42,11 @@ const compare = (q1, q2, discriminator) => {
38
42
  if (!!discriminator) {
39
43
  return discriminator(q1, q2);
40
44
  }
41
- return (q1.instruction === q2.instruction &&
42
- q1.answer === q2.answer &&
43
- (!q1.ggbOptions?.commands ||
44
- equalTab(q1.ggbOptions?.commands, q2.ggbOptions?.commands)));
45
+ return (0, lodash_isequal_1.default)(q1.identifiers, q2.identifiers);
46
+ // return (
47
+ // q1.instruction === q2.instruction &&
48
+ // q1.answer === q2.answer &&
49
+ // (!q1.ggbOptions?.commands ||
50
+ // equalTab(q1.ggbOptions?.commands, q2.ggbOptions?.commands!))
51
+ // );
45
52
  };
package/lib/index.d.ts CHANGED
@@ -137,6 +137,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
137
137
  xValues: any[];
138
138
  yValues: any[];
139
139
  type: number;
140
+ }, {}> | import("./exercises/exercise").Exercise<{
141
+ xValues: number[];
142
+ yValues: number[];
140
143
  }, {}> | import("./exercises/exercise").Exercise<{
141
144
  precisionAsked: number;
142
145
  decimal: number;
@@ -757,6 +760,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
757
760
  }, {}> | import("./exercises/exercise").Exercise<{
758
761
  trinomCoeffs: number[];
759
762
  isAskingPositive: boolean;
763
+ }, {}> | import("./exercises/exercise").Exercise<{
764
+ aIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
765
+ bIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
766
+ cIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
767
+ isAsking: string;
760
768
  }, {}> | import("./exercises/exercise").Exercise<{
761
769
  a: number;
762
770
  k: number;
@@ -938,9 +946,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
938
946
  sideA: string;
939
947
  sideB: string;
940
948
  sideC: string;
949
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
941
950
  }, {}> | import("./exercises/exercise").Exercise<{
942
951
  square: number;
943
952
  sideLengths: number[];
953
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
944
954
  }, {}> | import("./exercises/exercise").Exercise<{
945
955
  isRight: boolean;
946
956
  a: number;
@@ -949,12 +959,21 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
949
959
  vertices: string[];
950
960
  }, {}> | import("./exercises/exercise").Exercise<{
951
961
  vertices: string[];
962
+ xA: number;
963
+ yA: number;
964
+ xB: number;
965
+ yB: number;
966
+ xC: number;
967
+ yC: number;
968
+ factor: number;
952
969
  }, {}> | import("./exercises/exercise").Exercise<{
953
- sideLengths: number[];
954
- rand: number;
955
- rand2: number;
956
- isAskingC: boolean;
957
- }, {}> | import("./exercises/exercise").Exercise<{
970
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
971
+ insidePointsIdentifiers: import("./math/geometry/point").PointIdentifiers[];
972
+ segmentAsked: import("./math/geometry/segment").SegmentIdentifiers;
973
+ isPapillon: boolean;
974
+ }, {
975
+ configurationType: string;
976
+ }> | import("./exercises/exercise").Exercise<{
958
977
  randLetters: string[];
959
978
  vectors: string[];
960
979
  }, {}> | import("./exercises/exercise").Exercise<{
@@ -1081,6 +1100,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1081
1100
  }, {}> | import("./exercises/exercise").Exercise<{
1082
1101
  A: number[];
1083
1102
  B: number[];
1103
+ }, {}> | import("./exercises/exercise").Exercise<{
1104
+ lengths: number[];
1105
+ }, {}> | import("./exercises/exercise").Exercise<{
1106
+ points: import("./math/geometry/point").PointIdentifiers[];
1107
+ startPoint: string;
1108
+ translationPoints: string[];
1084
1109
  }, {}> | import("./exercises/exercise").Exercise<{
1085
1110
  type: number;
1086
1111
  commands: string[];
@@ -1165,9 +1190,6 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1165
1190
  }, {}> | import("./exercises/exercise").Exercise<{
1166
1191
  total: number;
1167
1192
  lefties: number;
1168
- }, {}> | import("./exercises/exercise").Exercise<{
1169
- xValues: number[];
1170
- yValues: number[];
1171
1193
  }, {}> | import("./exercises/exercise").Exercise<{
1172
1194
  evolution: number;
1173
1195
  }, {}> | import("./exercises/exercise").Exercise<{
@@ -1249,6 +1271,8 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1249
1271
  colorAskedIndex: number;
1250
1272
  }, {}> | import("./exercises/exercise").Exercise<{
1251
1273
  questionType: string;
1274
+ value?: string | undefined;
1275
+ color?: import("./exercises/utils/cardsData").CardsColor | undefined;
1252
1276
  }, {}> | import("./exercises/exercise").Exercise<{
1253
1277
  flip: number;
1254
1278
  pA?: number | undefined;
@@ -1260,6 +1284,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1260
1284
  isParityQuestion: boolean;
1261
1285
  isEvenQuestion: boolean;
1262
1286
  nbFaces: number;
1287
+ faceAsked: number;
1263
1288
  }, {}> | import("./exercises/exercise").Exercise<{
1264
1289
  type: number;
1265
1290
  A: number;
@@ -1300,12 +1325,15 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1300
1325
  yValues: number[];
1301
1326
  }, {}> | import("./exercises/exercise").Exercise<{
1302
1327
  isJustified: boolean;
1328
+ cloudPointsIdentifiers: import("./math/geometry/CloudPoints").CloudPointsIdentifiers;
1303
1329
  }, {}> | import("./exercises/exercise").Exercise<{
1304
1330
  pA: number;
1305
1331
  pB: number;
1306
1332
  pUnion: number;
1307
1333
  }, {}> | import("./exercises/exercise").Exercise<{
1308
1334
  questionType: string;
1335
+ value?: string | undefined;
1336
+ color?: string | undefined;
1309
1337
  }, {}> | import("./exercises/exercise").Exercise<{
1310
1338
  aCapB: number;
1311
1339
  aCapBBarre: number;
@@ -1314,7 +1342,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1314
1342
  event: string;
1315
1343
  type: string;
1316
1344
  probaFrac: number[];
1317
- }, {}> | import("./exercises/exercise").Exercise<{
1345
+ }, {
1346
+ allowNonIrreductible?: boolean | undefined;
1347
+ }> | import("./exercises/exercise").Exercise<{
1318
1348
  aCapB: number;
1319
1349
  aCapBBarre: number;
1320
1350
  aBarreCapB: number;
@@ -1325,6 +1355,13 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1325
1355
  }, {
1326
1356
  allowNonIrreductible?: boolean | undefined;
1327
1357
  }> | import("./exercises/exercise").Exercise<{
1358
+ exerciseVars: {
1359
+ n: number;
1360
+ k: number;
1361
+ a: number;
1362
+ b: number;
1363
+ };
1364
+ }, {}> | import("./exercises/exercise").Exercise<{
1328
1365
  nX: number;
1329
1366
  a: number;
1330
1367
  b: number;
@@ -1333,13 +1370,14 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1333
1370
  a: number;
1334
1371
  b: number;
1335
1372
  }, {}> | import("./exercises/exercise").Exercise<{
1336
- exerciseVars: {
1337
- n: number;
1338
- k: number;
1339
- a: number;
1340
- b: number;
1341
- };
1342
- }, {}> | import("./exercises/exercise").Exercise<{
1373
+ n: number;
1374
+ p: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
1375
+ interval: import("./tree/nodes/sets/intervalNode").IntervalNodeIdentifiers;
1376
+ type: number;
1377
+ isSentence: boolean;
1378
+ }, {
1379
+ instructionType: string;
1380
+ }> | import("./exercises/exercise").Exercise<{
1343
1381
  firstValue: number;
1344
1382
  askedRank: number;
1345
1383
  reason: number;
@@ -1538,6 +1576,8 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1538
1576
  randSideQuestion: number;
1539
1577
  }, {}> | import("./exercises/exercise").Exercise<{
1540
1578
  angleValue: number;
1579
+ angleIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
1580
+ point: string;
1541
1581
  }, {}> | import("./exercises/exercise").Exercise<{
1542
1582
  trigFunction: string;
1543
1583
  trigValue: number;
@@ -1681,12 +1721,21 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1681
1721
  isLog10: boolean;
1682
1722
  }, {}> | import("./exercises/exercise").Exercise<{
1683
1723
  vertices: string[];
1724
+ xA: number;
1725
+ yA: number;
1726
+ xB: number;
1727
+ yB: number;
1728
+ xC: number;
1729
+ yC: number;
1730
+ factor: number;
1684
1731
  }, {}> | import("./exercises/exercise").Exercise<{
1685
- sideLengths: number[];
1686
- rand: number;
1687
- rand2: number;
1688
- isAskingC: boolean;
1689
- }, {}> | import("./exercises/exercise").Exercise<{
1732
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
1733
+ insidePointsIdentifiers: import("./math/geometry/point").PointIdentifiers[];
1734
+ segmentAsked: import("./math/geometry/segment").SegmentIdentifiers;
1735
+ isPapillon: boolean;
1736
+ }, {
1737
+ configurationType: string;
1738
+ }> | import("./exercises/exercise").Exercise<{
1690
1739
  xA: number;
1691
1740
  xB: number;
1692
1741
  yA: number;
@@ -1870,7 +1919,12 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1870
1919
  }, {}> | import("./exercises/exercise").Exercise<{
1871
1920
  firstReagentVariables: number[];
1872
1921
  secondReagentVariables: number[];
1873
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
1922
+ }, {}> | import("./exercises/exercise").Exercise<{
1923
+ instruction: string;
1924
+ answer: string;
1925
+ nA: number;
1926
+ nB: number;
1927
+ }, {}> | import("./exercises/exercise").Exercise<{
1874
1928
  a: number;
1875
1929
  b: number;
1876
1930
  vA: number;
@@ -1909,7 +1963,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1909
1963
  r: number;
1910
1964
  R: number;
1911
1965
  isAsking: string;
1912
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
1966
+ }, {}> | import("./exercises/exercise").Exercise<{
1967
+ ggbCommands: string[];
1968
+ type: string;
1969
+ }, {}> | import("./exercises/exercise").Exercise<{
1913
1970
  isAsking: string;
1914
1971
  uAB: number;
1915
1972
  uED: number;
@@ -1970,7 +2027,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1970
2027
  variable: "P_in" | "P_out" | "η";
1971
2028
  }, {}> | import("./exercises/exercise").Exercise<{
1972
2029
  norm: number;
1973
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
2030
+ }, {}> | import("./exercises/exercise").Exercise<{
2031
+ ggbCommands: string[];
2032
+ movementType: string;
2033
+ }, {}> | import("./exercises/exercise").Exercise<{
1974
2034
  distance: {
1975
2035
  value: number;
1976
2036
  unitIndex: number;
@@ -1979,7 +2039,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1979
2039
  value: number;
1980
2040
  unitIndex: number;
1981
2041
  };
1982
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
2042
+ }, {}> | import("./exercises/exercise").Exercise<{
2043
+ typeOfAcceleration: string;
2044
+ ggbCommands: string[];
2045
+ }, {}> | import("./exercises/exercise").Exercise<{
1983
2046
  object1: string;
1984
2047
  object2: string;
1985
2048
  reference: "à l'autre" | "au sol";
@@ -1991,6 +2054,7 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1991
2054
  }, {}> | import("./exercises/exercise").Exercise<{
1992
2055
  epsilon: number;
1993
2056
  l: number;
2057
+ molecule: string;
1994
2058
  }, {}> | import("./exercises/exercise").Exercise<{
1995
2059
  moleculeName: string;
1996
2060
  concentration: number;
@@ -2015,7 +2079,11 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
2015
2079
  }, {}> | import("./exercises/exercise").Exercise<{
2016
2080
  atomicMass: number;
2017
2081
  atomicNumber: number;
2018
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
2082
+ isAsking: string;
2083
+ symbol: string;
2084
+ }, {}> | import("./exercises/exercise").Exercise<{
2085
+ commands: string[];
2086
+ }, {}> | import("./exercises/exercise").Exercise<{
2019
2087
  order: number;
2020
2088
  multiplier: number;
2021
2089
  }, {}> | import("./exercises/exercise").Exercise<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -1,6 +1,9 @@
1
- import { Point } from "./point";
1
+ import { Point, PointIdentifiers } from "./point";
2
2
  import { EqualNode } from "../../tree/nodes/equations/equalNode";
3
3
  import { NumberNode } from "../../tree/nodes/numbers/numberNode";
4
+ export type CloudPointsIdentifiers = {
5
+ pointsIdentifiers: PointIdentifiers[];
6
+ };
4
7
  export declare abstract class CloudPointsConstructor {
5
8
  static random(nbPoints: number): CloudPoints;
6
9
  static randomLinear(nbPoints: number): CloudPoints;
@@ -8,6 +11,7 @@ export declare abstract class CloudPointsConstructor {
8
11
  export declare class CloudPoints {
9
12
  points: Point[];
10
13
  constructor(points: Point[]);
14
+ toIdentifiers(): CloudPointsIdentifiers;
11
15
  getFineAdjustement(): EqualNode;
12
16
  getCorrelationCoeff(): NumberNode;
13
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CloudPoints.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/CloudPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAgB,MAAM,qCAAqC,CAAC;AAM/E,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAQ9B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;CAyBrC;AAED,qBAAa,WAAW;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;gBAEJ,MAAM,EAAE,KAAK,EAAE;IAI3B,kBAAkB,IAAI,SAAS;IA8C/B,mBAAmB;CAsBpB"}
1
+ {"version":3,"file":"CloudPoints.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/CloudPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAgB,MAAM,qCAAqC,CAAC;AAM/E,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AACF,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAQ9B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;CAyBrC;AAED,qBAAa,WAAW;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;gBAEJ,MAAM,EAAE,KAAK,EAAE;IAI3B,aAAa,IAAI,sBAAsB;IAMvC,kBAAkB,IAAI,SAAS;IA8C/B,mBAAmB;CAsBpB"}
@@ -41,6 +41,11 @@ class CloudPoints {
41
41
  constructor(points) {
42
42
  this.points = points;
43
43
  }
44
+ toIdentifiers() {
45
+ return {
46
+ pointsIdentifiers: this.points.map((p) => p.toIdentifiers()),
47
+ };
48
+ }
44
49
  getFineAdjustement() {
45
50
  const xValues = this.points.map((element) => {
46
51
  return element.getXnumber();
@@ -1,10 +1,18 @@
1
1
  import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps";
2
2
  import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
3
3
  import { EqualNode } from "../../tree/nodes/equations/equalNode";
4
- import { Point } from "./point";
4
+ import { AddNode } from "../../tree/nodes/operators/addNode";
5
+ import { SubstractNode } from "../../tree/nodes/operators/substractNode";
6
+ import { Point, PointIdentifiers } from "./point";
5
7
  import { Vector } from "./vector";
8
+ export type LineIdentifiers = {
9
+ name?: string;
10
+ pointA: PointIdentifiers;
11
+ pointB: PointIdentifiers;
12
+ };
6
13
  export declare abstract class LineConstructor {
7
14
  static random(name?: string): Line;
15
+ static fromIdentifiers(identifiers: LineIdentifiers): Line;
8
16
  }
9
17
  export declare class Line {
10
18
  pointA: Point;
@@ -13,15 +21,29 @@ export declare class Line {
13
21
  a: AlgebraicNode | undefined;
14
22
  b: AlgebraicNode | undefined;
15
23
  name: string;
24
+ unformatedName: string;
16
25
  ggbName: string;
17
26
  constructor(pointA: Point, pointB: Point, name?: string);
27
+ toIdentifiers(): {
28
+ name: string;
29
+ pointA: PointIdentifiers;
30
+ pointB: PointIdentifiers;
31
+ };
32
+ isParallele(line: Line): boolean;
18
33
  getParallele(point: Point): Line;
19
34
  includes(point: Point, allowApprox?: boolean): boolean;
20
35
  getRandomPoint(name?: string): Point;
21
36
  getEquation: (u: Vector, a: Point) => EqualNode;
22
37
  getCartesianEquation(): EqualNode;
38
+ toCartesian(): AddNode;
39
+ toCartesianCoeffs(): {
40
+ a: AlgebraicNode;
41
+ b: import("../../tree/nodes/functions/oppositeNode").OppositeNode;
42
+ c: SubstractNode;
43
+ };
23
44
  toTex(): string;
24
45
  toTexNoLeftRight(): string;
25
46
  toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, }?: ToGGBCommandsProps): string[];
47
+ intersect(line: Line, intersectName?: string): Point;
26
48
  }
27
49
  //# sourceMappingURL=line.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAoB,M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14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Line = exports.LineConstructor = void 0;
4
4
  const randomSegmentName_1 = require("../../exercises/utils/geometry/randomSegmentName");
5
5
  const equalNode_1 = require("../../tree/nodes/equations/equalNode");
6
+ const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
6
7
  const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
7
8
  const addNode_1 = require("../../tree/nodes/operators/addNode");
8
9
  const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
9
10
  const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
10
11
  const substractNode_1 = require("../../tree/nodes/operators/substractNode");
11
12
  const variableNode_1 = require("../../tree/nodes/variables/variableNode");
13
+ const generalSystem_1 = require("../systems/generalSystem");
12
14
  const randint_1 = require("../utils/random/randint");
13
15
  const point_1 = require("./point");
14
16
  const vector_1 = require("./vector");
@@ -18,6 +20,9 @@ class LineConstructor {
18
20
  const points = point_1.PointConstructor.randomDifferent(names.split(""));
19
21
  return new Line(points[0], points[1], name);
20
22
  }
23
+ static fromIdentifiers(identifiers) {
24
+ return new Line(point_1.PointConstructor.fromIdentifiers(identifiers.pointA), point_1.PointConstructor.fromIdentifiers(identifiers.pointB), identifiers.name);
25
+ }
21
26
  }
22
27
  exports.LineConstructor = LineConstructor;
23
28
  class Line {
@@ -37,6 +42,7 @@ class Line {
37
42
  };
38
43
  this.pointA = pointA;
39
44
  this.pointB = pointB;
45
+ this.unformatedName = name ?? `${pointA.name}${pointB.name}`;
40
46
  this.name = name ?? `\\left(${pointA.name}${pointB.name}\\right)`;
41
47
  this.ggbName = name ?? `line_{${pointA.name}${pointB.name}}`;
42
48
  this.isVertical = pointA.x.equals(pointB.x);
@@ -49,13 +55,31 @@ class Line {
49
55
  this.b = new substractNode_1.SubstractNode(this.pointA.y, new multiplyNode_1.MultiplyNode(this.a, this.pointA.x)).simplify();
50
56
  }
51
57
  }
58
+ toIdentifiers() {
59
+ return {
60
+ name: this.unformatedName,
61
+ pointA: this.pointA.toIdentifiers(),
62
+ pointB: this.pointB.toIdentifiers(),
63
+ };
64
+ }
65
+ isParallele(line) {
66
+ if (this.isVertical) {
67
+ return line.isVertical;
68
+ }
69
+ if (line.isVertical) {
70
+ return this.isVertical;
71
+ }
72
+ return this.a.equals(line.a);
73
+ }
52
74
  getParallele(point) {
53
75
  if (this.isVertical) {
54
- throw Error("Parallel vertical lines not implemented");
76
+ const y = (0, addNode_1.add)(point.y, 1).simplify();
77
+ const secondPoint = new point_1.Point("P", point.x, y);
78
+ return new Line(point, secondPoint);
55
79
  }
56
80
  const x = new addNode_1.AddNode(point.x, new numberNode_1.NumberNode(1)).simplify();
57
81
  const y = new addNode_1.AddNode(point.y, this.a).simplify();
58
- const secondPoint = new point_1.Point("D", x, y);
82
+ const secondPoint = new point_1.Point("P", x, y);
59
83
  return new Line(point, secondPoint);
60
84
  }
61
85
  includes(point, allowApprox = false) {
@@ -90,6 +114,21 @@ class Line {
90
114
  const y = new variableNode_1.VariableNode("y");
91
115
  return new equalNode_1.EqualNode(new addNode_1.AddNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), x).simplify(), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(b), y).simplify()), new numberNode_1.NumberNode(c)).simplify({ forbidFactorize: true }), new numberNode_1.NumberNode(0));
92
116
  }
117
+ toCartesian() {
118
+ const { a, b, c } = this.toCartesianCoeffs();
119
+ return (0, addNode_1.add)((0, addNode_1.add)((0, multiplyNode_1.multiply)(a, "x"), (0, multiplyNode_1.multiply)(b, "x")), c);
120
+ }
121
+ toCartesianCoeffs() {
122
+ //ax+by+c = 0
123
+ //u(-b,a)
124
+ //axA+byA+c = 0 donc c = -axA-byA
125
+ const u = vector_1.VectorConstructor.fromPoints(this.pointA, this.pointB);
126
+ const a = u.y;
127
+ const b = (0, oppositeNode_1.opposite)(u.x);
128
+ // const a = u.getYAsNumber();
129
+ const c = (0, substractNode_1.substract)((0, oppositeNode_1.opposite)((0, multiplyNode_1.multiply)(a, this.pointA.x)), (0, multiplyNode_1.multiply)(b, this.pointA.y));
130
+ return { a, b, c };
131
+ }
93
132
  toTex() {
94
133
  return this.name;
95
134
  }
@@ -115,5 +154,17 @@ class Line {
115
154
  }
116
155
  return commands;
117
156
  }
157
+ intersect(line, intersectName) {
158
+ if (line.isParallele(this))
159
+ throw Error("Lines are parallel");
160
+ const { a, b, c } = this.toCartesianCoeffs();
161
+ const { a: a2, b: b2, c: c2 } = line.toCartesianCoeffs();
162
+ const sys = new generalSystem_1.GeneralSystem([
163
+ [a, b, (0, oppositeNode_1.opposite)(c)],
164
+ [a2, b2, (0, oppositeNode_1.opposite)(c2)],
165
+ ]);
166
+ const solve = sys.solve();
167
+ return new point_1.Point(intersectName ?? "I", solve.x, solve.y);
168
+ }
118
169
  }
119
170
  exports.Line = Line;