math-exercises 2.2.56 → 2.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
  2. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
  3. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
  4. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  5. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  6. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  7. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
  9. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
  10. package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
  11. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
  12. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
  13. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -0
  14. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  15. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
  16. package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
  17. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts +10 -0
  18. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
  19. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
  20. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
  21. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  22. package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
  23. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
  24. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  25. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  26. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  27. package/lib/exercises/math/geometry/thales/index.js +1 -0
  28. package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
  29. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  31. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
  32. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
  34. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
  35. package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
  36. package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
  37. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
  38. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
  39. package/lib/exercises/math/probaStat/binomial/binomialInequation.js +159 -0
  40. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
  41. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
  42. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
  43. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
  44. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
  45. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
  46. package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
  47. package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
  48. package/lib/exercises/math/probaStat/binomial/index.js +20 -0
  49. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
  50. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
  51. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
  52. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
  53. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
  55. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
  56. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  57. package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
  58. package/lib/exercises/math/probaStat/index.d.ts +1 -3
  59. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  60. package/lib/exercises/math/probaStat/index.js +1 -3
  61. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
  62. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  63. package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
  64. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
  65. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  66. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
  67. package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
  68. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  69. package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
  70. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  71. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
  72. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  73. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
  74. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  75. package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
  76. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
  77. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  78. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  79. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
  80. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  81. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
  82. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
  83. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  84. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
  85. package/lib/exercises/pc/mole/molarMass.js +1 -1
  86. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
  87. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  88. package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
  89. package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
  90. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  91. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  92. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  93. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  94. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  95. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
  96. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  97. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
  98. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  99. package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
  100. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  101. package/lib/exercises/utils/getDistinctQuestions.js +11 -4
  102. package/lib/index.d.ts +88 -22
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/math/geometry/CloudPoints.d.ts +5 -1
  105. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  106. package/lib/math/geometry/CloudPoints.js +5 -0
  107. package/lib/math/geometry/line.d.ts +23 -1
  108. package/lib/math/geometry/line.d.ts.map +1 -1
  109. package/lib/math/geometry/line.js +53 -2
  110. package/lib/math/geometry/point.d.ts +15 -13
  111. package/lib/math/geometry/point.d.ts.map +1 -1
  112. package/lib/math/geometry/point.js +28 -12
  113. package/lib/math/geometry/segment.d.ts +11 -1
  114. package/lib/math/geometry/segment.d.ts.map +1 -1
  115. package/lib/math/geometry/segment.js +12 -0
  116. package/lib/math/geometry/triangle.d.ts +67 -0
  117. package/lib/math/geometry/triangle.d.ts.map +1 -0
  118. package/lib/math/geometry/triangle.js +227 -0
  119. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  120. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  121. package/lib/math/numbers/rationals/rational.js +5 -0
  122. package/lib/math/polynomials/generalTrinom.d.ts +2 -2
  123. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
  124. package/lib/math/probability/binomial.d.ts +10 -0
  125. package/lib/math/probability/binomial.d.ts.map +1 -0
  126. package/lib/math/probability/binomial.js +30 -0
  127. package/lib/math/sets/intervals/intervals.d.ts +1 -1
  128. package/lib/math/systems/generalSystem.d.ts +11 -0
  129. package/lib/math/systems/generalSystem.d.ts.map +1 -0
  130. package/lib/math/systems/generalSystem.js +79 -0
  131. package/lib/playground.d.ts.map +1 -1
  132. package/lib/playground.js +1 -4
  133. package/lib/server.js +0 -2
  134. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
  135. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/inequations/inequationNode.js +1 -1
  137. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
  138. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  139. package/lib/tree/nodes/node.d.ts +2 -1
  140. package/lib/tree/nodes/node.d.ts.map +1 -1
  141. package/lib/tree/nodes/node.js +1 -0
  142. package/lib/tree/nodes/nodeConstructor.d.ts +4 -3
  143. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  144. package/lib/tree/nodes/nodeConstructor.js +4 -0
  145. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  146. package/lib/tree/nodes/operators/addNode.js +20 -8
  147. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
  148. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
  149. package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -0
  150. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  151. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  153. package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
  154. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  155. package/lib/tree/nodes/operators/operatorNode.js +1 -0
  156. package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
  157. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  158. package/lib/tree/nodes/sets/intervalNode.js +1 -0
  159. package/lib/utils/alea/random.d.ts.map +1 -1
  160. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -760,6 +760,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
760
760
  }, {}> | import("./exercises/exercise").Exercise<{
761
761
  trinomCoeffs: number[];
762
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;
763
768
  }, {}> | import("./exercises/exercise").Exercise<{
764
769
  a: number;
765
770
  k: number;
@@ -941,9 +946,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
941
946
  sideA: string;
942
947
  sideB: string;
943
948
  sideC: string;
949
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
944
950
  }, {}> | import("./exercises/exercise").Exercise<{
945
951
  square: number;
946
952
  sideLengths: number[];
953
+ triangleIdentifiers: import("./math/geometry/triangle").TriangleIdentifiers;
947
954
  }, {}> | import("./exercises/exercise").Exercise<{
948
955
  isRight: boolean;
949
956
  a: number;
@@ -952,12 +959,21 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
952
959
  vertices: string[];
953
960
  }, {}> | import("./exercises/exercise").Exercise<{
954
961
  vertices: string[];
962
+ xA: number;
963
+ yA: number;
964
+ xB: number;
965
+ yB: number;
966
+ xC: number;
967
+ yC: number;
968
+ factor: number;
955
969
  }, {}> | import("./exercises/exercise").Exercise<{
956
- sideLengths: number[];
957
- rand: number;
958
- rand2: number;
959
- isAskingC: boolean;
960
- }, {}> | 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<{
961
977
  randLetters: string[];
962
978
  vectors: string[];
963
979
  }, {}> | import("./exercises/exercise").Exercise<{
@@ -1084,6 +1100,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1084
1100
  }, {}> | import("./exercises/exercise").Exercise<{
1085
1101
  A: number[];
1086
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[];
1087
1109
  }, {}> | import("./exercises/exercise").Exercise<{
1088
1110
  type: number;
1089
1111
  commands: string[];
@@ -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;
@@ -1327,6 +1355,13 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1327
1355
  }, {
1328
1356
  allowNonIrreductible?: boolean | undefined;
1329
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<{
1330
1365
  nX: number;
1331
1366
  a: number;
1332
1367
  b: number;
@@ -1335,13 +1370,14 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1335
1370
  a: number;
1336
1371
  b: number;
1337
1372
  }, {}> | import("./exercises/exercise").Exercise<{
1338
- exerciseVars: {
1339
- n: number;
1340
- k: number;
1341
- a: number;
1342
- b: number;
1343
- };
1344
- }, {}> | 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<{
1345
1381
  firstValue: number;
1346
1382
  askedRank: number;
1347
1383
  reason: number;
@@ -1540,6 +1576,8 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1540
1576
  randSideQuestion: number;
1541
1577
  }, {}> | import("./exercises/exercise").Exercise<{
1542
1578
  angleValue: number;
1579
+ angleIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
1580
+ point: string;
1543
1581
  }, {}> | import("./exercises/exercise").Exercise<{
1544
1582
  trigFunction: string;
1545
1583
  trigValue: number;
@@ -1683,12 +1721,21 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1683
1721
  isLog10: boolean;
1684
1722
  }, {}> | import("./exercises/exercise").Exercise<{
1685
1723
  vertices: string[];
1724
+ xA: number;
1725
+ yA: number;
1726
+ xB: number;
1727
+ yB: number;
1728
+ xC: number;
1729
+ yC: number;
1730
+ factor: number;
1686
1731
  }, {}> | import("./exercises/exercise").Exercise<{
1687
- sideLengths: number[];
1688
- rand: number;
1689
- rand2: number;
1690
- isAskingC: boolean;
1691
- }, {}> | 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<{
1692
1739
  xA: number;
1693
1740
  xB: number;
1694
1741
  yA: number;
@@ -1872,7 +1919,12 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1872
1919
  }, {}> | import("./exercises/exercise").Exercise<{
1873
1920
  firstReagentVariables: number[];
1874
1921
  secondReagentVariables: number[];
1875
- }, {}> | 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<{
1876
1928
  a: number;
1877
1929
  b: number;
1878
1930
  vA: number;
@@ -1911,7 +1963,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1911
1963
  r: number;
1912
1964
  R: number;
1913
1965
  isAsking: string;
1914
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
1966
+ }, {}> | import("./exercises/exercise").Exercise<{
1967
+ ggbCommands: string[];
1968
+ type: string;
1969
+ }, {}> | import("./exercises/exercise").Exercise<{
1915
1970
  isAsking: string;
1916
1971
  uAB: number;
1917
1972
  uED: number;
@@ -1972,7 +2027,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1972
2027
  variable: "P_in" | "P_out" | "η";
1973
2028
  }, {}> | import("./exercises/exercise").Exercise<{
1974
2029
  norm: number;
1975
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
2030
+ }, {}> | import("./exercises/exercise").Exercise<{
2031
+ ggbCommands: string[];
2032
+ movementType: string;
2033
+ }, {}> | import("./exercises/exercise").Exercise<{
1976
2034
  distance: {
1977
2035
  value: number;
1978
2036
  unitIndex: number;
@@ -1981,7 +2039,10 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1981
2039
  value: number;
1982
2040
  unitIndex: number;
1983
2041
  };
1984
- }, {}> | import("./exercises/exercise").Exercise<{}, {}> | import("./exercises/exercise").Exercise<{
2042
+ }, {}> | import("./exercises/exercise").Exercise<{
2043
+ typeOfAcceleration: string;
2044
+ ggbCommands: string[];
2045
+ }, {}> | import("./exercises/exercise").Exercise<{
1985
2046
  object1: string;
1986
2047
  object2: string;
1987
2048
  reference: "à l'autre" | "au sol";
@@ -1993,6 +2054,7 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
1993
2054
  }, {}> | import("./exercises/exercise").Exercise<{
1994
2055
  epsilon: number;
1995
2056
  l: number;
2057
+ molecule: string;
1996
2058
  }, {}> | import("./exercises/exercise").Exercise<{
1997
2059
  moleculeName: string;
1998
2060
  concentration: number;
@@ -2017,7 +2079,11 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
2017
2079
  }, {}> | import("./exercises/exercise").Exercise<{
2018
2080
  atomicMass: number;
2019
2081
  atomicNumber: number;
2020
- }, {}> | 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<{
2021
2087
  order: number;
2022
2088
  multiplier: number;
2023
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,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;CAK5B;AACD,q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,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AACF,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;IAK3B,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,eAAe;CAOpD;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,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM;IAsBvD,aAAa;;;;;IAOb,WAAW,CAAC,IAAI,EAAE,IAAI;IAStB,YAAY,CAAC,KAAK,EAAE,KAAK;IAWzB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,OAAe;IAenD,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM;IAa5B,WAAW,MAAO,MAAM,KAAK,KAAK,KAAG,SAAS,CAmB5C;IAEF,oBAAoB,IAAI,SAAS;IAuBjC,WAAW;IAMX,iBAAiB;;;;;IAcjB,KAAK;IAGL,gBAAgB;IAIhB,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,GACjC,GAAE,kBAAuB;IAqB5B,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,MAAM;CAY7C"}
@@ -3,12 +3,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;
@@ -1,8 +1,19 @@
1
- import { NodeIds } from "../../tree/nodes/node";
2
1
  import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
3
2
  import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps";
3
+ import { NodeIdentifiers } from "../../tree/nodes/nodeConstructor";
4
+ export type PointIdentifiers = {
5
+ id: "point";
6
+ name: string;
7
+ x: NodeIdentifiers;
8
+ y: NodeIdentifiers;
9
+ };
4
10
  export declare abstract class PointConstructor {
5
- static random(name: string): Point;
11
+ static random(name: string, min?: number, max?: number): Point;
12
+ static fromIdentifiers(identifiers: PointIdentifiers): Point;
13
+ static onSegment(A: Point, B: Point, name: string, { spacing, coefficient, }?: {
14
+ spacing?: number;
15
+ coefficient?: number;
16
+ }): Point;
6
17
  static randomDifferent(names: string[]): Point[];
7
18
  static fromGGBCommand(str: string): Point;
8
19
  }
@@ -12,16 +23,7 @@ export declare class Point {
12
23
  y: AlgebraicNode;
13
24
  constructor(name: string, x: AlgebraicNode, y: AlgebraicNode);
14
25
  toTex(): string;
15
- toIdentifiers(): {
16
- id: string;
17
- name: string;
18
- x: {
19
- id: NodeIds;
20
- } & Record<string, any>;
21
- y: {
22
- id: NodeIds;
23
- } & Record<string, any>;
24
- };
26
+ toIdentifiers(): PointIdentifiers;
25
27
  toTexWithCoords(): string;
26
28
  toCoords(): string;
27
29
  getXnumber(): number;
@@ -30,6 +32,6 @@ export declare class Point {
30
32
  distanceTo(B: Point): number;
31
33
  equals(B: Point): boolean;
32
34
  isAligned(B: Point, C: Point): boolean;
33
- toGGBCommand({ isFixed, showLabel }?: ToGGBCommandsProps): string[];
35
+ toGGBCommand({ isFixed, showLabel, style, size, color, }?: ToGGBCommandsProps): string[];
34
36
  }
35
37
  //# sourceMappingURL=point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IAetC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM;CAclC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAM5D,KAAK,IAAI,MAAM;IAGf,aAAa;;;;;;;;;;IAQb,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAMpB,UAAU,IAAI,MAAM;IAMpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAA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,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,MAAM;IAIpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;IAM5B,YAAY,CAAC,EACX,OAAc,EACd,SAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,GACN,GAAE,kBAAuB;CAiB3B"}
@@ -6,12 +6,23 @@ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
6
6
  const rational_1 = require("../numbers/rationals/rational");
7
7
  const vector_1 = require("./vector");
8
8
  const randint_1 = require("../utils/random/randint");
9
+ const nodeConstructor_1 = require("../../tree/nodes/nodeConstructor");
10
+ const randfloat_1 = require("../utils/random/randfloat");
9
11
  class PointConstructor {
10
- static random(name) {
11
- const x = (0, randint_1.randint)(-10, 11);
12
- const y = (0, randint_1.randint)(-10, 11);
12
+ static random(name, min = -10, max = 11) {
13
+ const x = (0, randint_1.randint)(min, max);
14
+ const y = (0, randint_1.randint)(min, max);
13
15
  return new Point(name, new numberNode_1.NumberNode(x), new numberNode_1.NumberNode(y));
14
16
  }
17
+ static fromIdentifiers(identifiers) {
18
+ return new Point(identifiers.name, nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.x), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.y));
19
+ }
20
+ static onSegment(A, B, name, { spacing = 0.1, coefficient, } = {}) {
21
+ const coeff = coefficient ?? (0, randfloat_1.randfloat)(spacing, 1 - spacing);
22
+ const vector = vector_1.VectorConstructor.fromPoints(A, B).times(coeff.toTree());
23
+ const point = vector.getEndPoint(A, name);
24
+ return point;
25
+ }
15
26
  static randomDifferent(names) {
16
27
  const res = [];
17
28
  const points = [];
@@ -63,14 +74,10 @@ class Point {
63
74
  return `\\left(${this.x.toTex()};${this.y.toTex()}\\right)`;
64
75
  }
65
76
  getXnumber() {
66
- if (this.x.type !== node_1.NodeType.number)
67
- throw Error("general point not implemented yet");
68
- return this.x.value;
77
+ return this.x.evaluate();
69
78
  }
70
79
  getYnumber() {
71
- if (this.y.type !== node_1.NodeType.number)
72
- throw Error("general point not implemented yet");
73
- return this.y.value;
80
+ return this.y.evaluate();
74
81
  }
75
82
  midpoint(B, name = "I") {
76
83
  const types = [this.x.type, this.y.type, B.x.type, B.y.type];
@@ -96,13 +103,22 @@ class Point {
96
103
  const AC = vector_1.VectorConstructor.fromPoints(this, C);
97
104
  return AB.isColinear(AC);
98
105
  }
99
- toGGBCommand({ isFixed = true, showLabel = true } = {}) {
100
- return [
106
+ toGGBCommand({ isFixed = true, showLabel = true, style, size, color, } = {}) {
107
+ const commands = [
101
108
  `${this.name} = (${this.x.toMathString()}, ${this.y.toMathString()})`,
102
109
  `SetFixed(${this.name},${isFixed ? "true" : "false"})`,
103
110
  `ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
104
- `SetPointStyle(${this.name}, 1)`,
105
111
  ];
112
+ if (style !== undefined) {
113
+ commands.push(`SetPointStyle(${this.name}, ${style})`);
114
+ }
115
+ if (size) {
116
+ commands.push(`SetPointSize(${this.name}, ${size})`);
117
+ }
118
+ if (color) {
119
+ commands.push(`SetColor(${this.name}, "${color}")`);
120
+ }
121
+ return commands;
106
122
  }
107
123
  }
108
124
  exports.Point = Point;
@@ -1,7 +1,12 @@
1
1
  import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps";
2
- import { Point } from "./point";
2
+ import { Point, PointIdentifiers } from "./point";
3
+ export type SegmentIdentifiers = {
4
+ pointA: PointIdentifiers;
5
+ pointB: PointIdentifiers;
6
+ };
3
7
  export declare abstract class SegmentConstructor {
4
8
  static random(): Segment;
9
+ static fromIdentifiers(identifiers: SegmentIdentifiers): Segment;
5
10
  }
6
11
  export declare class Segment {
7
12
  pointA: Point;
@@ -9,8 +14,13 @@ export declare class Segment {
9
14
  name: string;
10
15
  ggbName: string;
11
16
  constructor(pointA: Point, pointB: Point);
17
+ toIdentifiers(): {
18
+ pointA: PointIdentifiers;
19
+ pointB: PointIdentifiers;
20
+ };
12
21
  getLength(): number;
13
22
  toTex(): string;
23
+ toInsideName(): string;
14
24
  toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, }?: ToGGBCommandsProps): string[];
15
25
  }
16
26
  //# sourceMappingURL=segment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAC;AAElD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM;CAKd;AACD,qBAAa,OAAO;IAClB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAMxC,SAAS;IAGT,KAAK;IAGL,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,GACjC,GAAE,kBAAuB;CAoB7B"}
1
+ {"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AACF,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM;IAKb,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,kBAAkB;CAMvD;AACD,qBAAa,OAAO;IAClB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAOxC,aAAa;;;;IAMb,SAAS;IAGT,KAAK;IAGL,YAAY;IAGZ,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,GACjC,GAAE,kBAAuB;CAoB7B"}
@@ -9,6 +9,9 @@ class SegmentConstructor {
9
9
  const points = point_1.PointConstructor.randomDifferent(name.split(""));
10
10
  return new Segment(points[0], points[1]);
11
11
  }
12
+ static fromIdentifiers(identifiers) {
13
+ return new Segment(point_1.PointConstructor.fromIdentifiers(identifiers.pointA), point_1.PointConstructor.fromIdentifiers(identifiers.pointB));
14
+ }
12
15
  }
13
16
  exports.SegmentConstructor = SegmentConstructor;
14
17
  class Segment {
@@ -18,12 +21,21 @@ class Segment {
18
21
  this.name = `[${pointA.name}${pointB.name}]`;
19
22
  this.ggbName = `segment_{${pointA.name}${pointB.name}}`;
20
23
  }
24
+ toIdentifiers() {
25
+ return {
26
+ pointA: this.pointA.toIdentifiers(),
27
+ pointB: this.pointB.toIdentifiers(),
28
+ };
29
+ }
21
30
  getLength() {
22
31
  return this.pointA.distanceTo(this.pointB);
23
32
  }
24
33
  toTex() {
25
34
  return this.name;
26
35
  }
36
+ toInsideName() {
37
+ return `${this.pointA.name}${this.pointB.name}`;
38
+ }
27
39
  toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, } = {}) {
28
40
  const commands = [
29
41
  `${this.ggbName}=Segment(${this.pointA.name},${this.pointB.name})`,