math-exercises 3.0.9 → 3.0.11

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 (139) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -1
  3. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
  4. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +6 -2
  6. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts +1 -1
  7. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +54 -17
  9. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts +11 -0
  10. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +134 -0
  12. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts +3 -0
  13. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts.map +1 -0
  14. package/lib/exercises/math/functions/trinoms/devForm/index.js +2 -0
  15. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +9 -0
  16. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -0
  17. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +42 -0
  18. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts +9 -0
  19. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -0
  20. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +50 -0
  21. package/lib/exercises/math/functions/trinoms/equation/index.d.ts +5 -0
  22. package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -0
  23. package/lib/exercises/math/functions/trinoms/equation/index.js +4 -0
  24. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts +11 -0
  25. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -0
  26. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +102 -0
  27. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
  28. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
  29. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +131 -0
  30. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts +7 -0
  31. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
  32. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +69 -0
  33. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts +8 -0
  34. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -0
  35. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +72 -0
  36. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts +2 -0
  37. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -0
  38. package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
  39. package/lib/exercises/math/functions/trinoms/index.d.ts +7 -23
  40. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/trinoms/index.js +7 -23
  42. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +3 -0
  43. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -0
  44. package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
  45. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts +8 -0
  46. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -0
  47. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +285 -0
  48. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts +9 -0
  49. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -0
  50. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +112 -0
  51. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts +10 -0
  52. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -0
  53. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +124 -0
  54. package/lib/exercises/math/functions/trinoms/roots/index.d.ts +8 -0
  55. package/lib/exercises/math/functions/trinoms/roots/index.d.ts.map +1 -0
  56. package/lib/exercises/math/functions/trinoms/roots/index.js +7 -0
  57. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts +9 -0
  58. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -0
  59. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +54 -0
  60. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts +9 -0
  61. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -0
  62. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +55 -0
  63. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts +9 -0
  64. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -0
  65. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +67 -0
  66. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts +8 -0
  67. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -0
  68. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +109 -0
  69. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts +9 -0
  70. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -0
  71. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +63 -0
  72. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts +8 -0
  73. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -0
  74. package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +109 -0
  75. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +3 -0
  76. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -0
  77. package/lib/exercises/math/functions/trinoms/sign/index.js +2 -0
  78. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +8 -0
  79. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +120 -0
  81. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts +8 -0
  82. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -0
  83. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +119 -0
  84. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts +8 -0
  85. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -0
  86. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +49 -0
  87. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts +10 -0
  88. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -0
  89. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +64 -0
  90. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts +9 -0
  91. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -0
  92. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +48 -0
  93. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts +9 -0
  94. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -0
  95. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +55 -0
  96. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +9 -0
  97. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -0
  98. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +42 -0
  99. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +9 -0
  100. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -0
  101. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +8 -0
  102. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts +9 -0
  103. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -0
  104. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +90 -0
  105. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts +9 -0
  106. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -0
  107. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +55 -0
  108. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts +9 -0
  109. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -0
  110. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +59 -0
  111. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +2 -0
  112. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  113. package/lib/exercises/math/geometry/areas/triangleArea.js +56 -31
  114. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  115. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +34 -14
  116. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  117. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  118. package/lib/index.d.ts +43 -32
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/math/geometry/line.d.ts +1 -1
  121. package/lib/math/geometry/line.d.ts.map +1 -1
  122. package/lib/math/geometry/line.js +11 -1
  123. package/lib/math/geometry/parabola.d.ts +1 -1
  124. package/lib/math/geometry/parabola.d.ts.map +1 -1
  125. package/lib/math/geometry/parabola.js +4 -1
  126. package/lib/math/geometry/triangle.d.ts +1 -0
  127. package/lib/math/geometry/triangle.d.ts.map +1 -1
  128. package/lib/math/geometry/triangle.js +10 -2
  129. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  130. package/lib/tests/questionTest.d.ts.map +1 -1
  131. package/lib/tests/questionTest.js +1 -1
  132. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  133. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  134. package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
  135. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/polynomials/trinomNode.js +9 -0
  137. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  138. package/lib/tree/nodes/variables/variableNode.js +1 -3
  139. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const summitReading: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=summitReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randomColor } from "../../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
+ import { Point } from "../../../../../math/geometry/point.js";
6
+ import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
7
+ import { randint } from "../../../../../math/utils/random/randint.js";
8
+ const getSummitReadingQuestion = () => {
9
+ const trinom = TrinomConstructor.randomCanonical();
10
+ const commands = [
11
+ `f(x) = ${trinom.toString()}`,
12
+ `SetColor(f, "${randomColor()}")`,
13
+ ];
14
+ const ggb = new GeogebraConstructor({
15
+ commands,
16
+ isGridSimple: true,
17
+ });
18
+ const answer = trinom.getSommet().toCoords();
19
+ const question = {
20
+ answer,
21
+ instruction: `Déterminer les coordonnées du sommet de la parabole représentée ci-dessous :`,
22
+ keys: ["leftParenthesis", "semicolon", "rightParenthesis"],
23
+ ggbOptions: ggb.getOptions({
24
+ coords: trinom.getCoords(),
25
+ }),
26
+ answerFormat: "tex",
27
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
28
+ };
29
+ return question;
30
+ };
31
+ const getPropositions = (n, { answer, a, b, c }) => {
32
+ const propositions = [];
33
+ const trinom = new Trinom(a, b, c);
34
+ const alpha = trinom.getAlpha();
35
+ const beta = trinom.getBeta();
36
+ addValidProp(propositions, answer);
37
+ tryToAddWrongProp(propositions, new Point("S", beta.toTree(), alpha.toTree()).toCoords());
38
+ while (propositions.length < n) {
39
+ tryToAddWrongProp(propositions, new Point("S", randint(-10, 10).toTree(), randint(-10, 10).toTree()).toCoords());
40
+ }
41
+ return shuffleProps(propositions, n);
42
+ };
43
+ const isAnswerValid = (ans, { answer }) => {
44
+ return ans === answer;
45
+ };
46
+ export const summitReading = {
47
+ id: "summitReading",
48
+ label: "Déterminer graphiquement les coordonnées du sommet d'une parabole",
49
+ levels: ["1rePro", "1reSpé"],
50
+ isSingleStep: true,
51
+ sections: ["Second degré"],
52
+ generator: (nb) => getDistinctQuestions(getSummitReadingQuestion, nb),
53
+ qcmTimer: 60,
54
+ freeTimer: 60,
55
+ getPropositions,
56
+ isAnswerValid,
57
+ hasGeogebra: true,
58
+ subject: "Mathématiques",
59
+ };
@@ -1,7 +1,9 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
3
+ import { SegmentIdentifiers } from "../../../../math/geometry/segment.js";
3
4
  type Identifiers = {
4
5
  triangleIdentifiers: TriangleIdentifiers;
6
+ heightIdentifiers: SegmentIdentifiers;
5
7
  height: number;
6
8
  base: number;
7
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAYzC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
1
+ {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -2,15 +2,44 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
5
- import { Rational } from "../../../../math/numbers/rationals/rational.js";
6
5
  import { randint } from "../../../../math/utils/random/randint.js";
7
6
  import { randomLetter } from "../../../../utils/strings/randomLetter.js";
8
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
9
8
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
10
9
  import { Point, PointConstructor } from "../../../../math/geometry/point.js";
11
10
  import { doWhile } from "../../../../utils/doWhile.js";
12
- import { Segment } from "../../../../math/geometry/segment.js";
11
+ import { Segment, SegmentConstructor, } from "../../../../math/geometry/segment.js";
13
12
  import { round } from "../../../../math/utils/round.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ import { valueParser } from "../../../../tree/parsers/valueParser.js";
15
+ const getInstruction = (identifiers) => {
16
+ const { triangleIdentifiers, heightIdentifiers, height, base } = identifiers;
17
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
18
+ const heightSegment = SegmentConstructor.fromIdentifiers(heightIdentifiers);
19
+ return `Calculer l'aire du triangle $${triangle.name}$ sachant que $${triangle.sides[1].toLengthTex()}$ cm et $${heightSegment.toLengthTex()}$ cm.
20
+
21
+ Arrondir à $0,1$ cm près.`;
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { height, base } = identifiers;
25
+ const answer = round((height * base) / 2, 1);
26
+ return answer.frenchify() + "\\text{cm}^2";
27
+ };
28
+ const getGGBOptions = (identifiers) => {
29
+ const { triangleIdentifiers, heightIdentifiers, height, base } = identifiers;
30
+ const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
31
+ const heightSegment = SegmentConstructor.fromIdentifiers(heightIdentifiers);
32
+ triangle.drawHeight(1, { footPoint: heightSegment.pointB });
33
+ const points = [...triangle.points, heightSegment.pointB];
34
+ const ggb = new GeogebraConstructor({
35
+ commands: triangle.commands,
36
+ hideAxes: true,
37
+ hideGrid: true,
38
+ });
39
+ return ggb.getOptions({
40
+ coords: ggb.getCoordsForPoints(points),
41
+ });
42
+ };
14
43
  const getTriangleArea = () => {
15
44
  //segment de taille fixé
16
45
  //puis hauteur de taille fixée placée sur segment (élargi)
@@ -30,27 +59,19 @@ const getTriangleArea = () => {
30
59
  });
31
60
  const heightSegment = new Segment(B, H, { lengthNode: height.toTree() });
32
61
  triangle.drawHeight(1, { footName });
33
- const ggb = new GeogebraConstructor({
34
- commands: triangle.commands,
35
- hideAxes: true,
36
- hideGrid: true,
37
- });
38
- const answer = round((height * base) / 2, 1);
62
+ const identifiers = {
63
+ triangleIdentifiers: triangle.toIdentifiers(),
64
+ height,
65
+ base,
66
+ heightIdentifiers: heightSegment.toIdentifiers(),
67
+ };
39
68
  const question = {
40
- instruction: `Calculer l'aire du triangle $${triangle.name}$ sachant que $${triangle.sides[1].toLengthTex()}$ cm et $${heightSegment.toLengthTex()}$ cm.
41
-
42
- Arrondir à $0,1$ cm près.`,
43
- answer: answer.frenchify() + "\\text{cm}^2",
69
+ instruction: getInstruction(identifiers),
70
+ answer: getAnswer(identifiers),
44
71
  keys: ["cm", "cm2"],
45
- ggbOptions: ggb.getOptions({
46
- coords: ggb.getCoordsForPoints([A, B, C, H]),
47
- }),
72
+ ggbOptions: getGGBOptions(identifiers),
48
73
  answerFormat: "tex",
49
- identifiers: {
50
- triangleIdentifiers: triangle.toIdentifiers(),
51
- height,
52
- base,
53
- },
74
+ identifiers,
54
75
  };
55
76
  return question;
56
77
  };
@@ -62,17 +83,18 @@ const getPropositions = (n, { answer }) => {
62
83
  }
63
84
  return shuffle(propositions);
64
85
  };
65
- const isAnswerValid = (ans, { answer }) => {
66
- const double = Number(answer.split("\\text")[0].replace(",", ".")) * 2;
67
- const area = new Rational(double, 2)
68
- .simplify()
69
- .toTree({ allowFractionToDecimal: true });
70
- const numberTexs = area.toAllValidTexs();
71
- const texs = [
72
- ...numberTexs,
73
- ...numberTexs.map((tex) => tex + "\\text{cm}^2"),
74
- ];
75
- return texs.includes(ans);
86
+ const isAnswerValid = (ans, { answer, base, height }) => {
87
+ const formated = ans.replaceAll("\\text{cm}^2", "");
88
+ try {
89
+ const parsed = valueParser(formated);
90
+ if (parsed === false)
91
+ return false;
92
+ const aera = round((height * base) / 2, 1);
93
+ return parsed === aera;
94
+ }
95
+ catch (err) {
96
+ return handleVEAError(err);
97
+ }
76
98
  };
77
99
  export const triangleArea = {
78
100
  id: "triangleArea",
@@ -88,4 +110,7 @@ export const triangleArea = {
88
110
  isAnswerValid,
89
111
  hasGeogebra: true,
90
112
  subject: "Mathématiques",
113
+ getInstruction,
114
+ getAnswer,
115
+ getGGBOptions,
91
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2DF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAYhD,CAAC"}
1
+ {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA6EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
@@ -3,31 +3,48 @@ import { isGGBPoint } from "../../../../exercises/utils/geogebra/isGGBPoint.js";
3
3
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
4
  import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
5
5
  import { Point } from "../../../../math/geometry/point.js";
6
- import { AffineConstructor } from "../../../../math/polynomials/affine.js";
6
+ import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
7
7
  import { arrayEqual } from "../../../../utils/arrays/arrayEqual.js";
8
8
  import { deleteObjectNamesFromAnswer } from "../../../../geogebra/deleteObjectNamesFromAnswer.js";
9
9
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
10
- const getDrawAlineInGgbQuestion = () => {
11
- const f = AffineConstructor.random({ min: -3, max: 3 });
12
- const yA = f.b;
13
- const yB = f.a + f.b;
14
- const yMax = Math.max(yA, yB, 0);
15
- const yMin = Math.min(yA, yB, 0);
10
+ import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
11
+ const getInstruction = (identifiers) => {
12
+ const { correctA, correctB } = identifiers;
13
+ const f = new Affine(correctA, correctB);
14
+ return `Tracer la droite $d$ d'équation $y=${f.toTex()}$.`;
15
+ };
16
+ const getStudentGGBOptions = (identifiers) => {
17
+ const { correctA, correctB } = identifiers;
18
+ const yA = correctB;
19
+ const yB = correctA + correctB;
16
20
  const studentGGB = new GeogebraConstructor({
17
21
  isGridSimple: true,
18
22
  customToolBar: toolBarConstructor({
19
23
  join: true,
20
24
  }),
21
25
  });
26
+ const yMax = Math.max(yA, yB, 0);
27
+ const yMin = Math.min(yA, yB, 0);
28
+ return studentGGB.getOptions({
29
+ coords: [-6, 6, yMin - 5, yMax + 5],
30
+ });
31
+ };
32
+ const getGGBAnswer = (identifiers) => {
33
+ const { correctA, correctB } = identifiers;
34
+ const yA = correctB;
35
+ const yB = correctA + correctB;
36
+ return [`(0,${yA})`, `(1,${yB})`, `Line[A, B]`];
37
+ };
38
+ const getDrawAlineInGgbQuestion = () => {
39
+ const f = AffineConstructor.random({ min: -3, max: 3 });
40
+ const identifiers = { correctA: f.a, correctB: f.b };
22
41
  const question = {
23
- ggbAnswer: [`(0,${yA})`, `(1,${yB})`, `Line[A, B]`],
24
- instruction: `Tracer la droite $d$ d'équation $y=${f.toTex()}$.`,
42
+ ggbAnswer: getGGBAnswer(identifiers),
43
+ instruction: getInstruction(identifiers),
25
44
  keys: [],
26
45
  answerFormat: "tex",
27
- studentGgbOptions: studentGGB.getOptions({
28
- coords: [-6, 6, yMin - 5, yMax + 5],
29
- }),
30
- identifiers: { correctA: f.a, correctB: f.b },
46
+ studentGgbOptions: getStudentGGBOptions(identifiers),
47
+ identifiers,
31
48
  };
32
49
  return question;
33
50
  };
@@ -45,7 +62,7 @@ const isGGBAnswerValid = (ans, { ggbAnswer, correctA, correctB }) => {
45
62
  const B = getPoint(studentAnswer[1], "B");
46
63
  const a = (B.getYnumber() - A.getYnumber()) / (B.getXnumber() - A.getXnumber());
47
64
  const b = A.getYnumber() - a * A.getXnumber();
48
- return a === correctA && b === correctB;
65
+ return approxEqual(a, correctA, 1) && approxEqual(b, correctB, 1);
49
66
  };
50
67
  const getPoint = (command, pointName) => {
51
68
  const splitted = command.split(",");
@@ -64,4 +81,7 @@ export const drawAlineInGGB = {
64
81
  ggbTimer: 60,
65
82
  isGGBAnswerValid,
66
83
  subject: "Mathématiques",
84
+ getGGBAnswer,
85
+ getInstruction,
86
+ getStudentGGBOptions,
67
87
  };
@@ -7,5 +7,6 @@ export type ToGGBCommandsProps = {
7
7
  size?: number;
8
8
  color?: string;
9
9
  showLength?: boolean;
10
+ label?: string;
10
11
  };
11
12
  //# 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;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,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,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -685,7 +685,7 @@ declare const mathExercises: (Exercise<{
685
685
  functionType: string;
686
686
  x: number;
687
687
  y?: number;
688
- wrongY: number;
688
+ wrongY?: number;
689
689
  otherPoints: number[][];
690
690
  functionCommand?: string;
691
691
  }, {
@@ -746,13 +746,14 @@ declare const mathExercises: (Exercise<{
746
746
  c: number;
747
747
  d: number;
748
748
  }, {}> | Exercise<{
749
- param: string;
750
- coeffs: number[];
749
+ quadrinomial: number[];
750
+ leftbound: number;
751
+ rightbound: number;
751
752
  }, {}> | Exercise<{
752
- param: string;
753
- a: number;
754
- alpha: number;
755
- beta: number;
753
+ aIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
754
+ bIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
755
+ cIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
756
+ isAsking: string;
756
757
  }, {}> | Exercise<{
757
758
  a: number;
758
759
  b: number;
@@ -765,14 +766,19 @@ declare const mathExercises: (Exercise<{
765
766
  a: number;
766
767
  b: number;
767
768
  c: number;
769
+ ineqType: import("./math/inequations/inequation.js").InegalitySymbols;
768
770
  }, {}> | Exercise<{
769
771
  a: number;
770
772
  b: number;
771
- c: number;
773
+ type: number;
774
+ }, {}> | Exercise<{
775
+ coeffs: number[];
772
776
  }, {}> | Exercise<{
777
+ roots: number[];
773
778
  a: number;
774
- b: number;
775
- c: number;
779
+ }, {}> | Exercise<{
780
+ trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
781
+ firstRootIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
776
782
  }, {}> | Exercise<{
777
783
  a: number;
778
784
  b: number;
@@ -785,18 +791,36 @@ declare const mathExercises: (Exercise<{
785
791
  a: number;
786
792
  b: number;
787
793
  c: number;
794
+ }, {}> | Exercise<{
795
+ trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
788
796
  }, {}> | Exercise<{
789
797
  a: number;
790
798
  b: number;
791
799
  c: number;
792
- ineqType: import("./math/inequations/inequation.js").InegalitySymbols;
800
+ }, {}> | Exercise<{
801
+ trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
802
+ }, {}> | Exercise<{
803
+ trinomCoeffs: number[];
804
+ isAskingPositive: boolean;
805
+ }, {}> | Exercise<{
806
+ trinomCoeffs: number[];
807
+ isAskingPositive: boolean;
808
+ }, {}> | Exercise<{
809
+ param: string;
810
+ coeffs: number[];
811
+ }, {}> | Exercise<{
812
+ param: string;
813
+ a: number;
814
+ alpha: number;
815
+ beta: number;
793
816
  }, {}> | Exercise<{
794
817
  a: number;
795
818
  b: number;
796
819
  c: number;
797
820
  }, {}> | Exercise<{
798
- roots: number[];
799
821
  a: number;
822
+ b: number;
823
+ c: number;
800
824
  }, {}> | Exercise<{
801
825
  a: number;
802
826
  b: number;
@@ -809,31 +833,17 @@ declare const mathExercises: (Exercise<{
809
833
  a: number;
810
834
  b: number;
811
835
  c: number;
812
- }, {}> | Exercise<{
813
- quadrinomial: number[];
814
- leftbound: number;
815
- rightbound: number;
816
836
  }, {}> | Exercise<{
817
837
  a: number;
818
838
  b: number;
819
- type: number;
820
- }, {}> | Exercise<{
821
- coeffs: number[];
822
- }, {}> | Exercise<{
823
- trinomCoeffs: number[];
824
- isAskingPositive: boolean;
825
- }, {}> | Exercise<{
826
- aIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
827
- bIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
828
- cIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
829
- isAsking: string;
830
- }, {}> | Exercise<{
831
- trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
839
+ c: number;
832
840
  }, {}> | Exercise<{
833
- trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
841
+ type: number;
842
+ points: number[][];
834
843
  }, {}> | Exercise<{
835
- trinomIdentifiers: import("./tree/nodes/polynomials/trinomNode.js").TrinomNodeIdentifiers;
836
- firstRootIdentifiers: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
844
+ a: number;
845
+ x1: number;
846
+ x2: number;
837
847
  }, {}> | Exercise<{
838
848
  a: number;
839
849
  k: number;
@@ -941,6 +951,7 @@ declare const mathExercises: (Exercise<{
941
951
  side: number;
942
952
  }, {}> | Exercise<{
943
953
  triangleIdentifiers: import("./math/geometry/triangle.js").TriangleIdentifiers;
954
+ heightIdentifiers: import("./math/geometry/segment.js").SegmentIdentifiers;
944
955
  height: number;
945
956
  base: number;
946
957
  }, {}> | Exercise<{
@@ -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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -49,7 +49,7 @@ export declare class Line {
49
49
  };
50
50
  toTex(): string;
51
51
  toTexNoLeftRight(): string;
52
- toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, }?: ToGGBCommandsProps): string[];
52
+ toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, color, label, }?: ToGGBCommandsProps): string[];
53
53
  intersect(line: Line, intersectName?: string): Point;
54
54
  }
55
55
  //# 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,sDAAsD,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,OAAO,EAAO,MAAM,uCAAuC,CAAC;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;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;IAYtB,iBAAiB;IAIjB,YAAY,CAAC,KAAK,EAAE,KAAK;IAYzB,gBAAgB,CAAC,KAAK,EAAE,KAAK;IAW7B,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,OAAe;IAgBnD,aAAa,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAK7C,aAAa,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAW7C,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,EAChC,oBAA2B,EAC3B,KAAiB,EACjB,KAAiB,GAClB,GAAE,kBAAuB;IA2C5B,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,MAAM;CAW7C"}
@@ -1,4 +1,5 @@
1
1
  import { randomSegmentName } from "../../exercises/utils/geometry/randomSegmentName.js";
2
+ import { randomColor } from "../../geogebra/colors.js";
2
3
  import { EqualNode } from "../../tree/nodes/equations/equalNode.js";
3
4
  import { opposite } from "../../tree/nodes/functions/oppositeNode.js";
4
5
  import { NumberNode } from "../../tree/nodes/numbers/numberNode.js";
@@ -176,7 +177,7 @@ export class Line {
176
177
  toTexNoLeftRight() {
177
178
  return this.name.replace("\\left", "").replace("\\right", "");
178
179
  }
179
- toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, showUnderlyingPoints = true, } = {}) {
180
+ toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, showUnderlyingPoints = true, color = undefined, label = undefined, } = {}) {
180
181
  const commands = [];
181
182
  if (shouldBuildPoints) {
182
183
  const ACommands = this.pointA.toGGBCommand({
@@ -196,6 +197,15 @@ export class Line {
196
197
  `SetFixed(${this.ggbName},${isFixed ? "true" : "false"})`,
197
198
  `ShowLabel(${this.ggbName},${showLabel ? "true" : "false"})`,
198
199
  ]);
200
+ if (label) {
201
+ commands.push(`SetCaption(${this.ggbName}, "${label}")`);
202
+ }
203
+ if (color) {
204
+ commands.push(`SetColor(${this.ggbName},"${color}")`);
205
+ }
206
+ else {
207
+ commands.push(`SetColor(${this.ggbName},"${randomColor()}")`);
208
+ }
199
209
  return commands;
200
210
  }
201
211
  intersect(line, intersectName) {
@@ -6,6 +6,6 @@ export declare class Parabola {
6
6
  unformatedName: string;
7
7
  ggbName: string;
8
8
  constructor(points: Point[], name?: string);
9
- toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, }?: ToGGBCommandsProps): string[];
9
+ toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, label, }?: ToGGBCommandsProps): string[];
10
10
  }
11
11
  //# sourceMappingURL=parabola.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parabola.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/parabola.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,QAAQ;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM;IAS1C,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,EAChC,oBAA2B,GAC5B,GAAE,kBAAuB;CA+B7B"}
1
+ {"version":3,"file":"parabola.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/parabola.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,QAAQ;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM;IAS1C,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,EAChC,oBAA2B,EAC3B,KAAiB,GAClB,GAAE,kBAAuB;CAkC7B"}
@@ -11,7 +11,7 @@ export class Parabola {
11
11
  this.name = name ?? `\\mathcal{P}_${points.map((p) => p.name)}`;
12
12
  this.ggbName = name ?? `parabola_{${points.map((p) => p.name)}}`;
13
13
  }
14
- toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, showUnderlyingPoints = true, } = {}) {
14
+ toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, showUnderlyingPoints = true, label = undefined, } = {}) {
15
15
  const commands = [];
16
16
  if (shouldBuildPoints) {
17
17
  const pointsCommands = this.points.map((p) => p.toGGBCommand({
@@ -23,6 +23,9 @@ export class Parabola {
23
23
  else {
24
24
  commands.push(`${this.ggbName}=Polynomial(${this.points[0].toMathString()},${this.points[1].toMathString()},${this.points[2].toMathString()})`);
25
25
  }
26
+ if (label) {
27
+ commands.push(`SetCaption(${this.ggbName}, "${label}")`);
28
+ }
26
29
  commands.push(...[
27
30
  `SetFixed(${this.ggbName},${isFixed ? "true" : "false"})`,
28
31
  `ShowLabel(${this.ggbName},${showLabel ? "true" : "false"})`,
@@ -61,6 +61,7 @@ export declare class Triangle {
61
61
  }): Segment;
62
62
  drawHeight(summitIndex: number, opts?: {
63
63
  footName?: string;
64
+ footPoint?: Point;
64
65
  }): void;
65
66
  generateCoords(): number[];
66
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"triangle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/triangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAKnC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAEL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,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,GACnB;;;KAAA,GAAG,QAAQ;IA8BZ,MAAM,CAAC,UAA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MAAM,EAAE;CAkB3B"}
@@ -165,8 +165,16 @@ export class Triangle {
165
165
  return segmentHeight;
166
166
  }
167
167
  drawHeight(summitIndex, opts) {
168
- const height = this.getHeight(summitIndex, opts);
169
- const foot = height.pointB;
168
+ let height;
169
+ let foot;
170
+ if (opts?.footPoint) {
171
+ foot = opts.footPoint;
172
+ height = new Segment(this.points[summitIndex], foot);
173
+ }
174
+ else {
175
+ height = this.getHeight(summitIndex, opts);
176
+ foot = height.pointB;
177
+ }
170
178
  const angle = new Angle([
171
179
  this.points[summitIndex],
172
180
  foot,
@@ -1 +1 @@
1
- {"version":3,"file":"generalSystem.d.ts","sourceRoot":"","sources":["../../../src/math/systems/generalSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAgBlE,qBAAa,aAAa;IACxB,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC;gBAWd,MAAM,EAAE,aAAa,EAAE,EAAE;IAGrC,KAAK;;;;IA4CL,KAAK;CAYN"}
1
+ {"version":3,"file":"generalSystem.d.ts","sourceRoot":"","sources":["../../../src/math/systems/generalSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAgBlE,qBAAa,aAAa;IACxB,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC;gBAWd,MAAM,EAAE,aAAa,EAAE,EAAE;IAGrC,KAAK;;;;IA2CL,KAAK;CAYN"}
@@ -1 +1 @@
1
- {"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;CAyK7D,CAAC"}
1
+ {"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;CA2K7D,CAAC"}
@@ -105,7 +105,7 @@ export const questionTest = (exo, question) => {
105
105
  let before = Date.now();
106
106
  console.log("will test vea : ", exo.id);
107
107
  if (!exo.isAnswerValid(answer, { answer, ...question.identifiers })) {
108
- throw new Error(`exo ${exo.id} has invalid VEA, ids ${question.identifiers}, answer ${question.answer}`);
108
+ throw new Error(`exo ${exo.id} has invalid VEA, ids ${JSON.stringify(question.identifiers)}, answer ${question.answer}`);
109
109
  }
110
110
  let after = Date.now();
111
111
  veaTime = after - before;
@@ -7,6 +7,7 @@ export type SimplifyOptions = {
7
7
  isDegree?: boolean;
8
8
  towardsDistribute?: boolean;
9
9
  decimalToFractions?: boolean;
10
+ decimalToFractionsPrecisionAllowed?: boolean;
10
11
  forceIsolateMonomCoeffs?: boolean;
11
12
  forbidAdditions?: boolean;
12
13
  forbidTrigo?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AACF,MAAM,WA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