math-exercises 3.0.201 → 3.0.203

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 (198) hide show
  1. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +2 -0
  2. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -1
  3. package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +2 -2
  4. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +2 -2
  5. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -1
  6. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +9 -2
  7. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +1 -1
  8. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +1 -0
  9. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -1
  10. package/lib/exercises/math/derivation/derivative/trigo/index.js +1 -1
  11. package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.js +1 -1
  12. package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.js +1 -1
  13. package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +1 -1
  14. package/lib/exercises/math/derivation/problems/index.d.ts +1 -0
  15. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -1
  16. package/lib/exercises/math/derivation/problems/index.js +1 -1
  17. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  18. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +31 -21
  19. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -1
  20. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +8 -128
  21. package/lib/exercises/math/derivation/tangent/index.d.ts +1 -0
  22. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
  23. package/lib/exercises/math/derivation/tangent/index.js +1 -1
  24. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  25. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  26. package/lib/exercises/math/derivation/variations/index.js +1 -1
  27. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
  28. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +47 -20
  29. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  30. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +29 -6
  31. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  32. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +33 -0
  33. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts +7 -0
  34. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts.map +1 -0
  35. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.js +86 -0
  36. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
  37. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +35 -7
  38. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  39. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  40. package/lib/exercises/math/equaDiff/index.js +1 -1
  41. package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/integral/integralExpU.js +48 -0
  43. package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/integral/integralFractions.js +52 -0
  45. package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/integral/integralTrinomials.js +40 -0
  47. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +2 -2
  48. package/lib/exercises/math/functions/logarithm/powerEquation.js +1 -1
  49. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +172 -51
  51. package/lib/exercises/math/geometry/angles/index.d.ts +1 -0
  52. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  53. package/lib/exercises/math/geometry/angles/index.js +1 -1
  54. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +30 -25
  56. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  57. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +52 -5
  58. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.d.ts.map +1 -1
  59. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.js +26 -35
  60. package/lib/exercises/math/integration/fromExpr/index.d.ts +1 -0
  61. package/lib/exercises/math/integration/fromExpr/index.d.ts.map +1 -1
  62. package/lib/exercises/math/integration/fromExpr/index.js +1 -1
  63. package/lib/exercises/math/limits/index.d.ts +1 -5
  64. package/lib/exercises/math/limits/index.d.ts.map +1 -1
  65. package/lib/exercises/math/limits/index.js +1 -5
  66. package/lib/exercises/math/limits/limitReading.d.ts.map +1 -1
  67. package/lib/exercises/math/limits/limitReading.js +70 -0
  68. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  69. package/lib/exercises/math/limits/polynomLimit.js +55 -4
  70. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  71. package/lib/exercises/math/limits/polynomLimitNoFI.js +35 -2
  72. package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
  73. package/lib/exercises/math/limits/sequenceGeometricLimit.js +45 -9
  74. package/lib/exercises/math/limits/sequencePolynomLimit.d.ts.map +1 -1
  75. package/lib/exercises/math/limits/sequencePolynomLimit.js +56 -3
  76. package/lib/exercises/math/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
  77. package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +32 -0
  78. package/lib/exercises/math/limits/sequencePolynomProductLimit.d.ts.map +1 -1
  79. package/lib/exercises/math/limits/sequencePolynomProductLimit.js +33 -3
  80. package/lib/exercises/math/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  81. package/lib/exercises/math/limits/sequenceRationalFracLimit.js +2 -2
  82. package/lib/exercises/math/limits/sequences/index.d.ts +6 -0
  83. package/lib/exercises/math/limits/sequences/index.d.ts.map +1 -0
  84. package/lib/exercises/math/limits/sequences/index.js +5 -0
  85. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts +9 -0
  86. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts.map +1 -0
  87. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.js +110 -0
  88. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts +7 -0
  89. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts.map +1 -0
  90. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.js +116 -0
  91. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts +7 -0
  92. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts.map +1 -0
  93. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.js +95 -0
  94. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts +8 -0
  95. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts.map +1 -0
  96. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.js +111 -0
  97. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts +8 -0
  98. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts.map +1 -0
  99. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.js +114 -0
  100. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  101. package/lib/exercises/math/primitive/constantPrimitive.js +25 -1
  102. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
  103. package/lib/exercises/math/primitive/exponentialPrimitive.js +17 -0
  104. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  105. package/lib/exercises/math/primitive/polynomialPrimitive.js +17 -1
  106. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  107. package/lib/exercises/math/primitive/sinCosPrimitive.js +20 -1
  108. package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
  109. package/lib/exercises/math/primitive/usualPrimitives.js +1 -0
  110. package/lib/exercises/math/sequences/index.d.ts +1 -0
  111. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  112. package/lib/exercises/math/sequences/index.js +1 -0
  113. package/lib/exercises/math/sequences/proofByInduction/index.d.ts +5 -0
  114. package/lib/exercises/math/sequences/proofByInduction/index.d.ts.map +1 -0
  115. package/lib/exercises/math/sequences/proofByInduction/index.js +4 -0
  116. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts +10 -0
  117. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts.map +1 -0
  118. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.js +236 -0
  119. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts +13 -0
  120. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts.map +1 -0
  121. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.js +244 -0
  122. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts +98 -0
  123. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts.map +1 -0
  124. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.js +175 -0
  125. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts +13 -0
  126. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts.map +1 -0
  127. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.js +317 -0
  128. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts +13 -0
  129. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts.map +1 -0
  130. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.js +265 -0
  131. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.js +4 -4
  132. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.js +3 -3
  133. package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.js +4 -4
  134. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js +1 -1
  135. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.d.ts.map +1 -1
  136. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.js +12 -25
  137. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts +1 -1
  138. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts.map +1 -1
  139. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.js +1 -2
  140. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.d.ts.map +1 -1
  141. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.js +11 -26
  142. package/lib/exercises/math/spaceGeometry/planes/index.d.ts +1 -0
  143. package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -1
  144. package/lib/exercises/math/spaceGeometry/planes/index.js +1 -1
  145. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.d.ts.map +1 -1
  146. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.js +11 -25
  147. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.d.ts.map +1 -1
  148. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.js +25 -5
  149. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts +1 -0
  150. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts.map +1 -1
  151. package/lib/exercises/math/spaceGeometry/scalarProduct/index.js +1 -1
  152. package/lib/exercises/math/spaceGeometry/vectors/findLinearDecompositionWrtCoplanarUVFromCoords.js +2 -2
  153. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -1
  154. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +87 -24
  155. package/lib/exercises/pc/mathExosInPC.d.ts +1 -1
  156. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  157. package/lib/exercises/pc/mathExosInPC.js +1 -1
  158. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -1
  159. package/lib/exercises/vea/polynomialVEA.js +4 -0
  160. package/lib/index.d.ts +104 -13
  161. package/lib/index.d.ts.map +1 -1
  162. package/lib/math/geometry/point.d.ts.map +1 -1
  163. package/lib/math/geometry/point.js +1 -1
  164. package/lib/math/geometry/spaceVector.d.ts +2 -0
  165. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  166. package/lib/math/geometry/spaceVector.js +40 -0
  167. package/lib/math/utils/functions/functionDecomposition.d.ts +2 -2
  168. package/lib/math/utils/functions/functionDecomposition.d.ts.map +1 -1
  169. package/lib/math/utils/polynomial/polynomialUtils.d.ts +2 -2
  170. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -1
  171. package/lib/math/utils/polynomial/polynomialUtils.js +5 -2
  172. package/lib/tests/exoTest.d.ts.map +1 -1
  173. package/lib/tests/exoTest.js +8 -12
  174. package/lib/tests/questionTest.d.ts.map +1 -1
  175. package/lib/tests/questionTest.js +14 -6
  176. package/lib/tests/singleExo.test.js +2 -2
  177. package/lib/tree/nodes/node.d.ts +2 -1
  178. package/lib/tree/nodes/node.d.ts.map +1 -1
  179. package/lib/tree/nodes/node.js +1 -0
  180. package/lib/tree/nodes/student/iDontKnowNode.d.ts +26 -0
  181. package/lib/tree/nodes/student/iDontKnowNode.d.ts.map +1 -0
  182. package/lib/tree/nodes/student/iDontKnowNode.js +63 -0
  183. package/lib/tree/parsers/latexParser.d.ts +3 -2
  184. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  185. package/lib/tree/parsers/latexParser.js +7 -0
  186. package/lib/tree/parsers/monomParser.d.ts +1 -1
  187. package/lib/tree/parsers/monomParser.d.ts.map +1 -1
  188. package/lib/tree/parsers/polynomialParser.d.ts +1 -1
  189. package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
  190. package/lib/tree/parsers/trinomParser.d.ts +1 -1
  191. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  192. package/lib/tree/utilities/nodeComparator.d.ts +3 -1
  193. package/lib/tree/utilities/nodeComparator.d.ts.map +1 -1
  194. package/lib/tree/utilities/nodeComparator.js +68 -8
  195. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -0
  196. package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
  197. package/lib/tree/utilities/nodeSimplifier.js +40 -0
  198. package/package.json +1 -1
@@ -9,10 +9,45 @@ import { randfloat } from "../../../../math/utils/random/randfloat.js";
9
9
  import { round } from "../../../../math/utils/round.js";
10
10
  import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
11
11
  import { add } from "../../../../tree/nodes/operators/addNode.js";
12
- import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
13
- import { substract } from "../../../../tree/nodes/operators/substractNode.js";
12
+ import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
13
+ import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
14
+ import { substract, SubstractNode, } from "../../../../tree/nodes/operators/substractNode.js";
15
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
16
+ import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
14
17
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
15
18
  import { random } from "../../../../utils/alea/random.js";
19
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
20
+ class MyLine extends Line {
21
+ pointA;
22
+ pointB;
23
+ isVertical;
24
+ a;
25
+ b;
26
+ name;
27
+ unformatedName;
28
+ ggbName;
29
+ constructor(pointA, pointB, name) {
30
+ super(new Point("A", 0, 0), new Point("B", 1, 1), "L");
31
+ this.pointA = pointA;
32
+ this.pointB = pointB;
33
+ this.unformatedName = name ?? `${pointA.name}${pointB.name}`;
34
+ this.name = name ?? `\\left(${pointA.name}${pointB.name}\\right)`;
35
+ this.ggbName = name ?? `line${pointA.name}${pointB.name}`;
36
+ this.isVertical = pointA.x.equals(pointB.x);
37
+ if (this.isVertical) {
38
+ this.a = undefined;
39
+ this.b = undefined;
40
+ }
41
+ else {
42
+ this.a = new FractionNode(new SubstractNode(this.pointB.y, this.pointA.y), new SubstractNode(this.pointB.x, this.pointA.x))
43
+ .evaluate()
44
+ .toTree();
45
+ this.b = new SubstractNode(this.pointA.y, new MultiplyNode(this.a, this.pointA.x))
46
+ .evaluate()
47
+ .toTree();
48
+ }
49
+ }
50
+ }
16
51
  const createVector = (from, to, name, precision = 5) => {
17
52
  return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
18
53
  };
@@ -26,9 +61,16 @@ const degreesToRadians = (angleInDegrees, precision) => {
26
61
  const oneOver180 = 0.00555555555555555;
27
62
  return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
28
63
  };
64
+ const rotateVector = (vec, angle, name) => {
65
+ //x' = cos(t)*x -sin(t)*y
66
+ //y' = sin(t)*x + cos(t)*y
67
+ const cos = Math.cos(angle);
68
+ const sin = Math.sin(angle);
69
+ return new Vector(name, substract(multiply(cos, vec.x), multiply(sin, vec.y)).evaluate().toTree(), add(multiply(sin, vec.x), multiply(cos, vec.y)).evaluate().toTree());
70
+ };
29
71
  const rotatePoint = (target, angle, center, name, precision = 2) => {
30
72
  const vSrc = createVector(center, target, "vSrc", precision);
31
- const vRotated = vSrc.rotate(angle, "vRotated");
73
+ const vRotated = rotateVector(vSrc, angle, "vRotated");
32
74
  return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
33
75
  };
34
76
  const buildLines = (cAngleInDegreesTop, cAngleInDegreesBottom) => {
@@ -49,12 +91,12 @@ const buildLines = (cAngleInDegreesTop, cAngleInDegreesBottom) => {
49
91
  ].map((angleInDegrees) => degreesToRadians(angleInDegrees, precision));
50
92
  //build top line
51
93
  const heightAvgTopLine = 2;
52
- const lineTop = new Line(new Point("A", (-4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), new Point("B", (4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), "d_1");
94
+ const lineTop = new MyLine(new Point("A", (-4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), new Point("B", (4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), "d1");
53
95
  //build secant line
54
96
  const pointSTop = midPoint(lineTop.pointA, lineTop.pointB, "C", 5);
55
- const lineSecant = new Line(pointSTop, rotatePoint(lineTop.pointA, PiNode.value - cAngleTop, pointSTop, "D", 5), "s");
97
+ const lineSecant = new MyLine(pointSTop, rotatePoint(lineTop.pointA, PiNode.value - cAngleTop, pointSTop, "D", 5), "s");
56
98
  //build bottom line
57
- const lineBottom = new Line(lineSecant.pointB, rotatePoint(lineSecant.pointA, cAngleBottom, lineSecant.pointB, "E", 5), "d_2");
99
+ const lineBottom = new MyLine(lineSecant.pointB, rotatePoint(lineSecant.pointA, cAngleBottom, lineSecant.pointB, "E", 5), "d2");
58
100
  return {
59
101
  lineTop,
60
102
  lineSecant,
@@ -85,7 +127,7 @@ class IntersectionConstructor {
85
127
  const arrPointRotated = arrPointSrc.map((p) => {
86
128
  return rotatePoint(p, rotationAngle, rotationCenter, p.name, precision);
87
129
  });
88
- return new Intersection(arrPointRotated[0], new Line(arrPointRotated[1], arrPointRotated[2], intersectionSrc.lineH.name), new Line(arrPointRotated[3], arrPointRotated[4], intersectionSrc.lineV.name));
130
+ return new Intersection(arrPointRotated[0], new MyLine(arrPointRotated[1], arrPointRotated[2], intersectionSrc.lineH.name), new MyLine(arrPointRotated[3], arrPointRotated[4], intersectionSrc.lineV.name));
89
131
  }
90
132
  }
91
133
  class Intersection {
@@ -100,9 +142,9 @@ class Intersection {
100
142
  static createLineBothSideOfPoint(lineBase, pointCenter, lineIntersector, wrtAxis) {
101
143
  switch (wrtAxis) {
102
144
  case "x":
103
- return new Line(lineBase.intersect(lineIntersector.translate(-1, 0), pointCenter.name + "_xm"), lineBase.intersect(lineIntersector.translate(+1, 0), pointCenter.name + "_xM"), lineBase.name);
145
+ return new MyLine(lineBase.intersect(lineIntersector.translate(-1, 0), pointCenter.name + "xm"), lineBase.intersect(lineIntersector.translate(+1, 0), pointCenter.name + "xM"), lineBase.name);
104
146
  case "y":
105
- return new Line(lineBase.intersect(lineIntersector.translate(0, -1), pointCenter.name + "_ym"), lineBase.intersect(lineIntersector.translate(0, +1), pointCenter.name + "_yM"), lineBase.name);
147
+ return new MyLine(lineBase.intersect(lineIntersector.translate(0, -1), pointCenter.name + "ym"), lineBase.intersect(lineIntersector.translate(0, +1), pointCenter.name + "yM"), lineBase.name);
106
148
  }
107
149
  }
108
150
  getAngle(angleIndex) {
@@ -177,7 +219,6 @@ const getCorrection = (identifiers) => {
177
219
  return `alternes-internes`;
178
220
  case "correspondants":
179
221
  return `correspondants`;
180
- break;
181
222
  case "alternes-externes":
182
223
  return `alternes-externes`;
183
224
  case "autres":
@@ -222,13 +263,17 @@ const getGGBOptions = (identifiers, opts) => {
222
263
  arrIntersectionIds[0].lineV, //secant
223
264
  ]
224
265
  .map((lIds) => LineConstructor.fromIdentifiers(lIds))
266
+ .map((line, i) => {
267
+ line.ggbName = `d_${i}`;
268
+ return line;
269
+ })
225
270
  .flatMap((l, i) => l.toGGBCommands(false, {
226
271
  color: "black",
227
272
  showLabel: i < 2,
228
273
  }));
229
274
  const arrCommandAngles = arrAngle
230
275
  .map((angle, i) => {
231
- angle.name = `angle_${i}`;
276
+ angle.name = `angle${i}`;
232
277
  return angle;
233
278
  })
234
279
  .flatMap((a, i) => [
@@ -249,7 +294,7 @@ const getGGBOptions = (identifiers, opts) => {
249
294
  }),
250
295
  ]);
251
296
  const arrCommandOther = [
252
- `lb_parallel = Text("\\tex$d_1$${isParallel ? "∥" : "∦"}$d_2$", (${-4.5},${-3.1}), false, true, -1, -1)`,
297
+ `lbparallel = Text("\\tex$d_1$${isParallel ? "∥" : "∦"}$d_2$", (${-4.5},${-3.1}), false, true, -1, -1)`,
253
298
  ];
254
299
  const ggb = new GeogebraConstructor({
255
300
  commands: [
@@ -280,46 +325,22 @@ const getKeys = () => {
280
325
  ];
281
326
  };
282
327
  const isAnswerValid = (ans, { answer }) => {
283
- return ans === answer;
284
- };
285
- const optsDefault = {
286
- angleTypes: ["alternes-internes"],
287
- isFakeDisplay: true,
288
- nbDigits: "0",
328
+ if (ans === answer) {
329
+ return true;
330
+ }
331
+ try {
332
+ const nodeAns = parseAlgebraic(ans);
333
+ const nodeAnswer = parseAlgebraic(answer);
334
+ const isValid = NodeComparator.isEqualViaSub(nodeAns, nodeAnswer) ||
335
+ NodeComparator.isEqualViaFrac(nodeAns, nodeAnswer);
336
+ return isValid;
337
+ }
338
+ catch (err) {
339
+ return handleVEAError(err);
340
+ }
289
341
  };
290
- const options = [
291
- {
292
- id: "angleTypes",
293
- label: "Type d'angles",
294
- target: GeneratorOptionTarget.generation,
295
- type: GeneratorOptionType.multiselect,
296
- values: [
297
- "alternes-internes",
298
- "correspondants",
299
- "alternes-externes",
300
- "autres",
301
- ],
302
- defaultValue: optsDefault.angleTypes,
303
- },
304
- {
305
- id: "isFakeDisplay",
306
- label: "Affichage trompeur",
307
- target: GeneratorOptionTarget.generation,
308
- type: GeneratorOptionType.checkbox,
309
- defaultValue: optsDefault.isFakeDisplay,
310
- },
311
- {
312
- id: "nbDigits",
313
- label: "Nombre de décimales",
314
- target: GeneratorOptionTarget.generation,
315
- type: GeneratorOptionType.select,
316
- values: ["0", "1", "2"],
317
- defaultValue: optsDefault.nbDigits,
318
- },
319
- ];
320
- const getAnglesUsingIsParallelQuestion = (optsIn) => {
342
+ const createRandomIdentifiers = (opts) => {
321
343
  const isParallel = coinFlip();
322
- const opts = optsIn ?? optsDefault;
323
344
  //---create intersections---
324
345
  //this config will be used to create ggb lines
325
346
  function createConfigGeom(isParallelInGeom, isLookingParallel) {
@@ -412,6 +433,72 @@ const getAnglesUsingIsParallelQuestion = (optsIn) => {
412
433
  arrAngleIndex,
413
434
  arrAngleForLabel,
414
435
  };
436
+ return identifiers;
437
+ };
438
+ const isIdentifiersQCPassed = (identifiers) => {
439
+ const isExploding = (identifiers) => {
440
+ let isExploding = false;
441
+ try {
442
+ getAnswer(identifiers);
443
+ getCorrection(identifiers);
444
+ }
445
+ catch (_) {
446
+ isExploding = true;
447
+ }
448
+ return isExploding;
449
+ };
450
+ return !isExploding(identifiers);
451
+ };
452
+ const createQCPassedIdentifiers = (opts) => {
453
+ let identifiers;
454
+ let counter = -1;
455
+ let isValid = false;
456
+ while (!isValid && counter < 100) {
457
+ counter++;
458
+ let identifiersCandidate;
459
+ try {
460
+ identifiersCandidate = createRandomIdentifiers(opts);
461
+ isValid = isIdentifiersQCPassed(identifiersCandidate);
462
+ }
463
+ catch (_) {
464
+ isValid = false;
465
+ }
466
+ if (isValid) {
467
+ identifiers = identifiersCandidate;
468
+ }
469
+ }
470
+ {
471
+ identifiers = createRandomIdentifiers(opts);
472
+ isValid = true;
473
+ }
474
+ if (!isValid) {
475
+ const identifiersDefault = (() => {
476
+ const lineH1 = new MyLine(new Point("H11", -4, 3), new Point("H12", 8, 1), "h");
477
+ const lineV = new MyLine(new Point("V1", 1, 0), new Point("V2", 3, 4), "h");
478
+ const lineH2 = new MyLine(new Point("H21", -4, -2), new Point("H22", 6, -2), "h");
479
+ const intersection1 = IntersectionConstructor.fromBaselines("i1", lineH1, lineV);
480
+ const intersection2 = IntersectionConstructor.fromBaselines("i2", lineH2, lineV);
481
+ const angleType = "alternes-internes";
482
+ const arrAngleForLabel = [50, 130, 50, 130];
483
+ const arrAngleIndex = random([
484
+ [2, 0],
485
+ [3, 1],
486
+ ]);
487
+ return {
488
+ isParallel: false,
489
+ arrIntersectionIds: [intersection1, intersection2].map((intersection) => intersection.toIdentifiers()),
490
+ angleType,
491
+ arrAngleForLabel,
492
+ arrAngleIndex,
493
+ };
494
+ })();
495
+ identifiers = identifiersDefault;
496
+ }
497
+ return identifiers;
498
+ };
499
+ const getAnglesUsingIsParallelQuestion = (optsIn) => {
500
+ const opts = optsIn ?? optsDefault;
501
+ const identifiers = createQCPassedIdentifiers(opts);
415
502
  return getQuestionFromIdentifiers(identifiers, opts);
416
503
  };
417
504
  const getQuestionFromIdentifiers = (identifiers, opts) => {
@@ -427,6 +514,41 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
427
514
  };
428
515
  return question;
429
516
  };
517
+ const optsDefault = {
518
+ angleTypes: ["alternes-internes"],
519
+ isFakeDisplay: true,
520
+ nbDigits: "0",
521
+ };
522
+ const options = [
523
+ {
524
+ id: "angleTypes",
525
+ label: "Type d'angles",
526
+ target: GeneratorOptionTarget.generation,
527
+ type: GeneratorOptionType.multiselect,
528
+ values: [
529
+ "alternes-internes",
530
+ "correspondants",
531
+ "alternes-externes",
532
+ "autres",
533
+ ],
534
+ defaultValue: optsDefault.angleTypes,
535
+ },
536
+ {
537
+ id: "isFakeDisplay",
538
+ label: "Affichage trompeur",
539
+ target: GeneratorOptionTarget.generation,
540
+ type: GeneratorOptionType.checkbox,
541
+ defaultValue: optsDefault.isFakeDisplay,
542
+ },
543
+ {
544
+ id: "nbDigits",
545
+ label: "Nombre de décimales",
546
+ target: GeneratorOptionTarget.generation,
547
+ type: GeneratorOptionType.select,
548
+ values: ["0", "1", "2"],
549
+ defaultValue: optsDefault.nbDigits,
550
+ },
551
+ ];
430
552
  export const anglesUsingIsParallel = {
431
553
  id: "anglesUsingIsParallel",
432
554
  label: "Déterminer un angle issu d'une sécante en utilisant le parallélisme",
@@ -441,7 +563,6 @@ export const anglesUsingIsParallel = {
441
563
  getHint,
442
564
  getCorrection,
443
565
  hasHintAndCorrection: true,
444
- answerType: "QCU",
445
566
  getQuestionFromIdentifiers,
446
567
  hasGeogebra: true,
447
568
  };
@@ -1,3 +1,4 @@
1
1
  export * from "./recognizeAngleType.js";
2
2
  export * from "./parallelogramFourthAngle.js";
3
+ export * from "./anglesUsingIsParallel.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4BAA4B,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export * from "./recognizeAngleType.js";
2
2
  export * from "./parallelogramFourthAngle.js";
3
3
  //export * from "./isParallelUsingAngles.js";
4
- // export * from "./anglesUsingIsParallel.js";
4
+ export * from "./anglesUsingIsParallel.js";
@@ -1 +1 @@
1
- {"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6GF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAkBjE,CAAC"}
1
+ {"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAgHF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAmBjE,CAAC"}
@@ -33,29 +33,33 @@ où $t\\in \\mathbb{R}$.
33
33
  Donner les coordonnées d'un vecteur directeur de la droite $d$.
34
34
  `;
35
35
  };
36
- // const getHint: GetHint<Identifiers> = (identifiers) => {
37
- // return `Il suffit de remplacer $t$ par une valeur afin d'obtenir les coordonnées d'un point de la droite.`;
38
- // };
39
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
40
- // const line = new ParametricLine(
41
- // SpacePointConstructor.fromScalars(identifiers.startPoint),
42
- // SpaceVectorConstructor.fromScalars(identifiers.vector),
43
- // );
44
- // const detailedEquations = line.toDetailedEvaluation(new NumberNode(0));
45
- // const point = line.getPointCoords(new NumberNode(0));
46
- // return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
47
- // $$
48
- // \\left\\{\\begin{matrix}
49
- // x=${detailedEquations[0].toTex()} \\\\
50
- // y=${detailedEquations[1].toTex()} \\\\
51
- // z=${detailedEquations[2].toTex()}
52
- // \\end{matrix}
53
- // \\right.
54
- // $$
55
- // On en déduit que le point de coordonnées $\\left(${point
56
- // .map((e) => e.toTex())
57
- // .join(";")}\\right)$ appartient à la droite $d$.`;
58
- // };
36
+ const getHint = () => {
37
+ return `Dans un repère de l'espace, la droite $d$ passant par le point $A(x_0; y_0; z_0)$ et de vecteur directeur $\\overrightarrow{u}(a,b,c)$ a pour représentation paramétrique :
38
+
39
+ $$
40
+ \\left\\{\\begin{matrix}
41
+ x=x_0 + at \\\\
42
+ y=y_0 + bt \\\\
43
+ z=z_0 + ct
44
+ \\end{matrix}
45
+ \\right.
46
+ $$`;
47
+ };
48
+ const getCorrection = (identifiers) => {
49
+ const { startPoint, vector } = identifiers;
50
+ return `Dans un repère de l'espace, la droite $d$ passant par le point $A(x_0; y_0; z_0)$ et de vecteur directeur $\\overrightarrow{u}(a,b,c)$ a pour représentation paramétrique :
51
+
52
+ $$
53
+ \\left\\{\\begin{matrix}
54
+ x=x_0 + at \\\\
55
+ y=y_0 + bt \\\\
56
+ z=z_0 + ct
57
+ \\end{matrix}
58
+ \\right.
59
+ $$
60
+
61
+ Ici, la droite $d$ passe donc par le point $A(${startPoint[0]}; ${startPoint[1]}; ${startPoint[2]})$ et a pour vecteur directeur $\\overrightarrow{u}(${vector[0]}; ${vector[1]}; ${vector[2]})$.`;
62
+ };
59
63
  const getKeys = () => {
60
64
  return ["semicolon"];
61
65
  };
@@ -87,8 +91,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
87
91
  keys: getKeys(identifiers),
88
92
  answerFormat: "tex",
89
93
  identifiers,
90
- // hint: getHint(identifiers),
91
- // correction: getCorrection(identifiers),
94
+ hint: getHint(identifiers),
95
+ correction: getCorrection(identifiers),
92
96
  };
93
97
  return question;
94
98
  };
@@ -107,5 +111,6 @@ export const extractVectorFromParametricLine = {
107
111
  // getCorrection,
108
112
  getAnswer,
109
113
  getInstruction,
114
+ hasHintAndCorrection: true,
110
115
  getQuestionFromIdentifiers,
111
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/pointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAwFF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAmBzD,CAAC"}
1
+ {"version":3,"file":"pointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/pointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAkJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAoBzD,CAAC"}
@@ -4,7 +4,10 @@ import { ParametricLine } from "../../../../math/geometry/parametricLine.js";
4
4
  import { SpacePointConstructor } from "../../../../math/geometry/spacePoint.js";
5
5
  import { SpaceVectorConstructor } from "../../../../math/geometry/spaceVector.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
7
9
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
10
+ import { doWhile } from "../../../../utils/doWhile.js";
8
11
  import { randomLetter } from "../../../../utils/strings/randomLetter.js";
9
12
  const getPropositions = (n, { answer }) => {
10
13
  const propositions = [];
@@ -31,14 +34,57 @@ où $t\\in \\mathbb{R}$.
31
34
  Le point $${askedPoint.toTexWithCoords()}$ appartient-il à $d$ ?
32
35
  `;
33
36
  };
34
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
35
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
37
+ const getHint = () => {
38
+ return `Remplace $x$, $y$ et $z$ dans l'équation paramétrique par les coordonnées du point.
39
+
40
+ Le point appartient à la droite $d$ si et seulement s'il existe une valeur de $t$ qui est solution des trois équations.`;
41
+ };
42
+ const getCorrection = (identifiers) => {
43
+ const { isOnLine, askedPointName, askedPointCoords, startPoint, vector } = identifiers;
44
+ const askedPoint = SpacePointConstructor.fromScalars(askedPointCoords, askedPointName);
45
+ const line = new ParametricLine(SpacePointConstructor.fromScalars(startPoint), SpaceVectorConstructor.fromScalars(vector));
46
+ //t1 = x-p.x / v.x
47
+ const t1 = frac(substract(askedPointCoords[0], startPoint[0]), vector[0]);
48
+ const t2 = frac(substract(askedPointCoords[1], startPoint[1]), vector[1]);
49
+ const t3 = frac(substract(askedPointCoords[2], startPoint[2]), vector[2]);
50
+ return `On remplace $x$, $y$ et $z$ par les coordonnées du point :
51
+
52
+
53
+ $$
54
+ \\left\\{\\begin{matrix}
55
+ ${askedPoint.x.toTex()}=${line.equations[0].toTex()} \\\\
56
+ ${askedPoint.y.toTex()}=${line.equations[1].toTex()} \\\\
57
+ ${askedPoint.z.toTex()}=${line.equations[2].toTex()}
58
+ \\end{matrix}
59
+ \\right.
60
+ $$
61
+
62
+ On résout alors les trois équations :
63
+
64
+ $$
65
+ \\left\\{\\begin{matrix}
66
+ t=${t1.toSimplificationTex()} \\\\
67
+ t=${t2.toSimplificationTex()} \\\\
68
+ t=${t3.toSimplificationTex()}
69
+ \\end{matrix}
70
+ \\right.
71
+ $$
72
+
73
+ ${isOnLine
74
+ ? `Puisque $t = ${t1
75
+ .simplify()
76
+ .toTex()}$ est solution du système, le point $${askedPointName}$ appartient bien à la droite.`
77
+ : `Puisque ce système n'a pas de solution, le point $${askedPointName}$ n'appartient pas à la droite.`}
78
+ `;
79
+ };
36
80
  const getKeys = () => {
37
81
  return [];
38
82
  };
39
83
  const getPointFromParametricLineQuestion = () => {
40
84
  const startPoint = SpacePointConstructor.random("A");
41
- const vector = SpaceVectorConstructor.random("B");
85
+ const vector = doWhile(() => SpaceVectorConstructor.random("B"), (v) => v.x.equals((0).toTree()) ||
86
+ v.y.equals((0).toTree()) ||
87
+ v.z.equals((0).toTree()));
42
88
  const isOnLine = coinFlip();
43
89
  const askedPointName = randomLetter(true, ["O"]);
44
90
  let askedPoint;
@@ -68,8 +114,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
68
114
  keys: getKeys(identifiers),
69
115
  answerFormat: "tex",
70
116
  identifiers,
71
- // hint: getHint(identifiers),
72
- // correction: getCorrection(identifiers),
117
+ hint: getHint(identifiers),
118
+ correction: getCorrection(identifiers),
73
119
  };
74
120
  return question;
75
121
  };
@@ -90,4 +136,5 @@ export const pointFromParametricLine = {
90
136
  answerType: "QCU",
91
137
  getInstruction,
92
138
  getQuestionFromIdentifiers,
139
+ hasHintAndCorrection: true,
93
140
  };
@@ -1 +1 @@
1
- {"version":3,"file":"areaBetweenCrossingCurvesFixedPosFromExpr.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;CACnD,CAAC;AAojBF,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAkDF,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAsBR,CAAC"}
1
+ {"version":3,"file":"areaBetweenCrossingCurvesFixedPosFromExpr.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAgBrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;CACnD,CAAC;AA6iBF,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAkDF,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAsBR,CAAC"}
@@ -315,43 +315,34 @@ const createRandomIdentifiers = (opts) => {
315
315
  const [nodeBoundLow, nodeBoundHigh] = [valueBoundLow, valueBoundHigh].map((v) => v.toTree());
316
316
  const [nodePBottom, nodePTop] = (() => {
317
317
  const [point1, point2] = zip(["P1", "P2"], [nodeBoundLow, nodeBoundHigh]).map(([name, nodeAbscissa]) => new Point(name, nodeAbscissa, randint(0, 6)));
318
- switch (opts.typeCrossingCurves) {
319
- case "Trinôme/Trinôme": {
320
- const [nodeABottom, nodeATop] = [
321
- frac(randint(1, 3), 10),
322
- frac(randint(-2, 0), 10),
323
- ];
324
- const [nodePBottom, nodePTop] = [nodeABottom, nodeATop].map((nodeA) => createNodeFTrinomFromPoints(nodeA, [point1, point2]));
325
- return [nodePBottom, nodePTop];
318
+ const [nodeABottom, nodeATop] = (() => {
319
+ switch (opts.typeCrossingCurves) {
320
+ case "Trinôme/Trinôme": {
321
+ return [frac(randint(1, 3), 10), frac(randint(-2, 0), 10)];
322
+ }
323
+ case "Trinôme/Affine": {
324
+ return [(0).toTree(), frac(randint(-2, 0), 10)];
325
+ }
326
+ case "Affine/Trinôme": {
327
+ return [frac(randint(1, 3), 10), (0).toTree()];
328
+ }
329
+ default:
330
+ throw new Error("Unsupported opts.typeCrossingCurves: " + opts.typeCrossingCurves);
326
331
  }
327
- case "Trinôme/Affine": {
328
- const [nodeABottom, nodeATop] = [
329
- (0).toTree(),
330
- frac(randint(-2, 0), 10),
331
- ];
332
- const [nodePBottom, nodePTop] = [nodeABottom, nodeATop].map((nodeA) => createNodeFTrinomFromPoints(nodeA, [point1, point2]));
333
- return [nodePBottom, nodePTop];
334
- }
335
- case "Affine/Trinôme": {
336
- const [nodeABottom, nodeATop] = [frac(randint(1, 3), 10), (0).toTree()];
337
- const [nodePBottom, nodePTop] = [nodeABottom, nodeATop].map((nodeA) => createNodeFTrinomFromPoints(nodeA, [point1, point2]));
338
- return [nodePBottom, nodePTop];
339
- }
340
- default:
341
- throw new Error("Unsupported opts.typeCrossingCurves: " + opts.typeCrossingCurves);
342
- }
332
+ })();
333
+ const isShouldSimplify = true;
334
+ const simplifyOptionsPass1 = {
335
+ towardsDistribute: true,
336
+ calculatePowers: true,
337
+ forceAddFractions: true,
338
+ };
339
+ const simplifyOptionsPass2 = {
340
+ forbidFactorize: false,
341
+ forceAddFractions: true,
342
+ };
343
+ return [nodeABottom, nodeATop].map((nodeA) => createNodeFTrinomFromPoints(nodeA, [point1, point2], isShouldSimplify, simplifyOptionsPass1, simplifyOptionsPass2));
343
344
  })();
344
- const [nodeF, nodeG] = [nodePBottom, nodePTop].map((nodeP) => nodeP
345
- .simplify({
346
- towardsDistribute: true,
347
- calculatePowers: true,
348
- forceAddFractions: true,
349
- })
350
- .simplify({
351
- towardsDistribute: true,
352
- forceDistributeFractions: true,
353
- forbidFactorize: true,
354
- }));
345
+ const [nodeF, nodeG] = [nodePBottom, nodePTop];
355
346
  const identifiers = {
356
347
  nodeIdsF: nodeF.toIdentifiers(),
357
348
  nodeIdsG: nodeG.toIdentifiers(),
@@ -3,6 +3,7 @@ export * from "./byParts/index.js";
3
3
  export * from "./meanValue/index.js";
4
4
  export * from "./boundIntegralByManualRectanglesMethodFromExpr.js";
5
5
  export * from "./boundIntegralByBoundingFunctionWithAffinesFromExpr.js";
6
+ export * from "./areaBetweenCrossingCurvesFixedPosFromExpr.js";
6
7
  export * from "./integralFromExpr.js";
7
8
  export * from "./checkIsPrimitiveFromExpr.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oDAAoD,CAAC;AACnE,cAAc,yDAAyD,CAAC;AAExE,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oDAAoD,CAAC;AACnE,cAAc,yDAAyD,CAAC;AACxE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC"}
@@ -3,6 +3,6 @@ export * from "./byParts/index.js";
3
3
  export * from "./meanValue/index.js";
4
4
  export * from "./boundIntegralByManualRectanglesMethodFromExpr.js";
5
5
  export * from "./boundIntegralByBoundingFunctionWithAffinesFromExpr.js";
6
- // export * from "./areaBetweenCrossingCurvesFixedPosFromExpr.js";
6
+ export * from "./areaBetweenCrossingCurvesFixedPosFromExpr.js";
7
7
  export * from "./integralFromExpr.js";
8
8
  export * from "./checkIsPrimitiveFromExpr.js";
@@ -2,13 +2,9 @@ export * from "./polynomLimit.js";
2
2
  export * from "./polynomLimitNoFI.js";
3
3
  export * from "./rationalFracForbiddenValueLimit.js";
4
4
  export * from "./rationalFracLimit.js";
5
- export * from "./sequenceGeometricLimit.js";
6
- export * from "./sequencePolynomLimit.js";
7
- export * from "./sequencePolynomNoFILimit.js";
8
- export * from "./sequencePolynomProductLimit.js";
9
- export * from "./sequenceRationalFracLimit.js";
10
5
  export * from "./limitReading.js";
11
6
  export * from "./frac1XTimesALogXPlusBLimit.js";
12
7
  export * from "./kLogXPlusTrinomLimit.js";
13
8
  export * from "./logOfPolynomialLimit.js";
9
+ export * from "./sequences/index.js";
14
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AAEvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
@@ -2,12 +2,8 @@ export * from "./polynomLimit.js";
2
2
  export * from "./polynomLimitNoFI.js";
3
3
  export * from "./rationalFracForbiddenValueLimit.js";
4
4
  export * from "./rationalFracLimit.js";
5
- export * from "./sequenceGeometricLimit.js";
6
- export * from "./sequencePolynomLimit.js";
7
- export * from "./sequencePolynomNoFILimit.js";
8
- export * from "./sequencePolynomProductLimit.js";
9
- export * from "./sequenceRationalFracLimit.js";
10
5
  export * from "./limitReading.js";
11
6
  export * from "./frac1XTimesALogXPlusBLimit.js";
12
7
  export * from "./kLogXPlusTrinomLimit.js";
13
8
  export * from "./logOfPolynomialLimit.js";
9
+ export * from "./sequences/index.js";