math-exercises 3.0.201 → 3.0.202

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 (113) 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/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.d.ts.map +1 -1
  12. package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +1 -1
  13. package/lib/exercises/math/derivation/problems/index.d.ts +1 -0
  14. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -1
  15. package/lib/exercises/math/derivation/problems/index.js +1 -1
  16. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  17. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +31 -21
  18. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -1
  19. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +8 -128
  20. package/lib/exercises/math/derivation/tangent/index.d.ts +1 -0
  21. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
  22. package/lib/exercises/math/derivation/tangent/index.js +1 -1
  23. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  24. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  25. package/lib/exercises/math/derivation/variations/index.js +1 -1
  26. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
  27. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +47 -20
  28. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  29. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +29 -6
  30. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  31. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +33 -0
  32. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts +7 -0
  33. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts.map +1 -0
  34. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.js +86 -0
  35. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
  36. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +35 -7
  37. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  38. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  39. package/lib/exercises/math/equaDiff/index.js +1 -1
  40. package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/integral/integralExpU.js +48 -0
  42. package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
  43. package/lib/exercises/math/functions/integral/integralFractions.js +52 -0
  44. package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/integral/integralTrinomials.js +40 -0
  46. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +2 -2
  47. package/lib/exercises/math/functions/logarithm/powerEquation.js +1 -1
  48. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  49. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +30 -25
  50. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  51. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +52 -5
  52. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.d.ts.map +1 -1
  53. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.js +26 -35
  54. package/lib/exercises/math/integration/fromExpr/index.d.ts +1 -0
  55. package/lib/exercises/math/integration/fromExpr/index.d.ts.map +1 -1
  56. package/lib/exercises/math/integration/fromExpr/index.js +1 -1
  57. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  58. package/lib/exercises/math/primitive/constantPrimitive.js +25 -1
  59. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
  60. package/lib/exercises/math/primitive/exponentialPrimitive.js +17 -0
  61. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  62. package/lib/exercises/math/primitive/polynomialPrimitive.js +17 -1
  63. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  64. package/lib/exercises/math/primitive/sinCosPrimitive.js +20 -1
  65. package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
  66. package/lib/exercises/math/primitive/usualPrimitives.js +1 -0
  67. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.js +4 -4
  68. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.js +3 -3
  69. package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.js +4 -4
  70. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js +1 -1
  71. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.d.ts.map +1 -1
  72. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.js +12 -25
  73. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts +1 -1
  74. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts.map +1 -1
  75. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.js +1 -2
  76. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.d.ts.map +1 -1
  77. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.js +11 -26
  78. package/lib/exercises/math/spaceGeometry/planes/index.d.ts +1 -0
  79. package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -1
  80. package/lib/exercises/math/spaceGeometry/planes/index.js +1 -1
  81. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.d.ts.map +1 -1
  82. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.js +11 -25
  83. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.d.ts.map +1 -1
  84. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.js +25 -5
  85. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts +1 -0
  86. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts.map +1 -1
  87. package/lib/exercises/math/spaceGeometry/scalarProduct/index.js +1 -1
  88. package/lib/exercises/math/spaceGeometry/vectors/findLinearDecompositionWrtCoplanarUVFromCoords.js +2 -2
  89. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -1
  90. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +87 -24
  91. package/lib/exercises/pc/mathExosInPC.d.ts +1 -1
  92. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  93. package/lib/exercises/pc/mathExosInPC.js +1 -1
  94. package/lib/index.d.ts +55 -0
  95. package/lib/index.d.ts.map +1 -1
  96. package/lib/math/geometry/spaceVector.d.ts +2 -0
  97. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  98. package/lib/math/geometry/spaceVector.js +40 -0
  99. package/lib/math/utils/polynomial/polynomialUtils.d.ts +2 -2
  100. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -1
  101. package/lib/math/utils/polynomial/polynomialUtils.js +5 -2
  102. package/lib/tests/exoTest.js +1 -1
  103. package/lib/tests/questionTest.d.ts.map +1 -1
  104. package/lib/tests/questionTest.js +7 -3
  105. package/lib/tests/singleExo.test.d.ts.map +1 -1
  106. package/lib/tests/singleExo.test.js +2 -2
  107. package/lib/tree/utilities/nodeComparator.d.ts +1 -1
  108. package/lib/tree/utilities/nodeComparator.d.ts.map +1 -1
  109. package/lib/tree/utilities/nodeComparator.js +6 -4
  110. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -0
  111. package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
  112. package/lib/tree/utilities/nodeSimplifier.js +40 -0
  113. package/package.json +1 -1
@@ -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";
@@ -1 +1 @@
1
- {"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAOJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAMxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,0BAA0B,CAClF,WAAW,EACX,OAAO,CAaR,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,WAAW,EAAE,OAAO,CAmB/E,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAQpE,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc5D,CAAC"}
1
+ {"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EASJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAyDF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAMxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,0BAA0B,CAClF,WAAW,EACX,OAAO,CAeR,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CACzD,WAAW,EACX,OAAO,CAoBR,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAQpE,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe5D,CAAC"}
@@ -16,13 +16,34 @@ const getInstruction = (identifiers, opts) => {
16
16
  const { c } = identifiers;
17
17
  const isAskingParticularPrimitive = opts?.askParticularPrimitive;
18
18
  return `${isAskingParticularPrimitive
19
- ? "Déterminer une primitive en particulier de la fonction constante $f$ définie par"
19
+ ? "Donner une des primitives de la fonction constante $f$ définie par"
20
20
  : "Déterminer la forme générale des primitives de la fonction constante $f$ définie par"} :
21
21
 
22
22
  $$
23
23
  f(x) = ${c}
24
24
  $$`;
25
25
  };
26
+ const getHint = (identifiers) => {
27
+ const { c } = identifiers;
28
+ return `Quelles sont les fonctions qui ont pour dérivée $x\\mapsto ${c}$ ?`;
29
+ };
30
+ const getCorrection = (identifiers, opts) => {
31
+ if (opts?.askParticularPrimitive)
32
+ return `Une primitive de $f$ est :
33
+
34
+ $$
35
+ F(x) = ${getAnswerNode(identifiers, opts).toTex()}
36
+ $$
37
+
38
+ En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
39
+ return `La forme générale des primitives de la fonction $f$ est :
40
+
41
+ $$
42
+ F(x) = ${getAnswerNode(identifiers, opts).toTex()}
43
+ $$
44
+
45
+ où $C$ est un réel. En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
46
+ };
26
47
  const getAnswer = (identifiers, opts) => {
27
48
  return getAnswerNode(identifiers, opts).toTex();
28
49
  };
@@ -39,6 +60,8 @@ export const getConstantPrimitiveQuestionFromIdentifiers = (identifiers, opts) =
39
60
  keys: opts?.askParticularPrimitive ? ["x"] : ["x", "C"],
40
61
  answerFormat: "tex",
41
62
  identifiers,
63
+ hint: getHint(identifiers, opts),
64
+ correction: getCorrection(identifiers, opts),
42
65
  options: opts,
43
66
  };
44
67
  return question;
@@ -82,4 +105,5 @@ export const constantPrimitive = {
82
105
  subject: "Mathématiques",
83
106
  getQuestionFromIdentifiers: getConstantPrimitiveQuestionFromIdentifiers,
84
107
  options,
108
+ hasHintAndCorrection: true,
85
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAKJ,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwBF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAIlE,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0BAA0B,CACrF,WAAW,CAYZ,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAKJ,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwBF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAIlE,CAAC;AAqBF,eAAO,MAAM,8CAA8C,EAAE,0BAA0B,CACrF,WAAW,CAcZ,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -28,6 +28,20 @@ export const getExponentialPrimitive = () => {
28
28
  const identifiers = { a };
29
29
  return getExponentialPrimitiveQuestionFromIdentifiers(identifiers);
30
30
  };
31
+ const getHint = (identifiers) => {
32
+ const { a } = identifiers;
33
+ const integratedFuction = new MultiplyNode(new NumberNode(a), new ExpNode(new VariableNode("x")));
34
+ return `Quelles sont les fonctions qui ont pour dérivée $x\\mapsto ${integratedFuction.toTex()}$ ?`;
35
+ };
36
+ const getCorrection = (identifiers) => {
37
+ return `La forme générale des primitives de la fonction $f$ est :
38
+
39
+ $$
40
+ F(x) = ${getAnswer(identifiers)}
41
+ $$
42
+
43
+ où $C$ est un réel. En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
44
+ };
31
45
  export const getExponentialPrimitiveQuestionFromIdentifiers = (identifiers) => {
32
46
  const question = {
33
47
  instruction: getInstruction(identifiers),
@@ -36,6 +50,8 @@ export const getExponentialPrimitiveQuestionFromIdentifiers = (identifiers) => {
36
50
  keys: ["x", "C", "epower", "exp"],
37
51
  answerFormat: "tex",
38
52
  identifiers,
53
+ hint: getHint(identifiers),
54
+ correction: getCorrection(identifiers),
39
55
  };
40
56
  return question;
41
57
  };
@@ -80,4 +96,5 @@ export const exponentialPrimitive = {
80
96
  subject: "Mathématiques",
81
97
  pdfOptions: { shouldSpreadPropositions: true },
82
98
  getQuestionFromIdentifiers: getExponentialPrimitiveQuestionFromIdentifiers,
99
+ hasHintAndCorrection: true,
83
100
  };
@@ -1 +1 @@
1
- {"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAKjE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,0BAA0B,CACpF,WAAW,CAYZ,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CA8B7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAYrD,CAAC"}
1
+ {"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiCF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAKjE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,0BAA0B,CACpF,WAAW,CAcZ,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CA8B7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
@@ -6,13 +6,26 @@ import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
6
6
  import { shuffle } from "../../../utils/alea/shuffle.js";
7
7
  import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
8
8
  const getInstruction = (identifiers) => {
9
- const polynomial = new Polynomial(identifiers.coeffs);
9
+ const polynomial = new Polynomial(identifiers.coeffs).toTree();
10
10
  return `Déterminer la forme générale des primitives de la fonction polynomiale $f$ définie par :
11
11
 
12
12
  $$
13
13
  f(x) = ${polynomial.toTex()}
14
14
  $$`;
15
15
  };
16
+ const getHint = (identifiers) => {
17
+ const polynomial = new Polynomial(identifiers.coeffs).toTree();
18
+ return `Quelles sont les fonctions qui ont pour dérivée $x\\mapsto ${polynomial.toTex()}$ ?`;
19
+ };
20
+ const getCorrection = (identifiers) => {
21
+ return `La forme générale des primitives de la fonction $f$ est :
22
+
23
+ $$
24
+ F(x) = ${getAnswer(identifiers)}
25
+ $$
26
+
27
+ où $C$ est un réel. En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
28
+ };
16
29
  const getAnswer = (identifiers) => {
17
30
  const polynomial = new Polynomial(identifiers.coeffs);
18
31
  const integralPolynomial = polynomial.integrateToNode();
@@ -33,6 +46,8 @@ export const getPolynomialPrimitiveQuestionFromIdentifiers = (identifiers) => {
33
46
  keys: ["x", "C"],
34
47
  answerFormat: "tex",
35
48
  identifiers,
49
+ hint: getHint(identifiers),
50
+ correction: getCorrection(identifiers),
36
51
  };
37
52
  return question;
38
53
  };
@@ -85,4 +100,5 @@ export const polynomialPrimitive = {
85
100
  isAnswerValid: isPolynomialPrimitiveAnswerValid,
86
101
  subject: "Mathématiques",
87
102
  getQuestionFromIdentifiers: getPolynomialPrimitiveQuestionFromIdentifiers,
103
+ hasHintAndCorrection: true,
88
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sinCosPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinCosPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAwBF,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,WAAW,CAM7D,CAAC;AAEF,eAAO,MAAM,yCAAyC,EAAE,0BAA0B,CAChF,WAAW,CAYZ,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CA4BpE,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,GAAG,CAAC,WAAW,CAYzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
1
+ {"version":3,"file":"sinCosPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinCosPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAwBF,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,WAAW,CAM7D,CAAC;AAoBF,eAAO,MAAM,yCAAyC,EAAE,0BAA0B,CAChF,WAAW,CAcZ,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CA4BpE,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,GAAG,CAAC,WAAW,CAYzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
@@ -34,6 +34,22 @@ export const getSinCosPrimitive = () => {
34
34
  const identifiers = { a, isCos };
35
35
  return getSinCosPrimitiveQuestionFromIdentifiers(identifiers);
36
36
  };
37
+ const getHint = (identifiers) => {
38
+ const { a, isCos } = identifiers;
39
+ const selectedFunction = isCos
40
+ ? new MultiplyNode(new NumberNode(a), new CosNode(new VariableNode("x")))
41
+ : new MultiplyNode(new NumberNode(a), new SinNode(new VariableNode("x")));
42
+ return `Quelles sont les fonctions qui ont pour dérivée $x\\mapsto ${selectedFunction.toTex()}$ ?`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ return `La forme générale des primitives de la fonction $f$ est :
46
+
47
+ $$
48
+ F(x) = ${getAnswer(identifiers)}
49
+ $$
50
+
51
+ où $C$ est un réel. En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
52
+ };
37
53
  export const getSinCosPrimitiveQuestionFromIdentifiers = (identifiers) => {
38
54
  const question = {
39
55
  instruction: getInstruction(identifiers),
@@ -42,6 +58,8 @@ export const getSinCosPrimitiveQuestionFromIdentifiers = (identifiers) => {
42
58
  keys: ["x", "C", "sin", "cos"],
43
59
  answerFormat: "tex",
44
60
  identifiers,
61
+ hint: getHint(identifiers),
62
+ correction: getCorrection(identifiers),
45
63
  };
46
64
  return question;
47
65
  };
@@ -74,7 +92,7 @@ export const isSinCosPrimitiveAnswerValid = (ans, { isCos, a }) => {
74
92
  export const sinCosPrimitive = {
75
93
  id: "sinCosPrimitive",
76
94
  connector: "=",
77
- label: "Primitive de sin et cos",
95
+ label: "Primitive de $\\sin$ et $\\cos$",
78
96
  isSingleStep: false,
79
97
  generator: (nb) => getDistinctQuestions(getSinCosPrimitive, nb),
80
98
  qcmTimer: 60,
@@ -83,4 +101,5 @@ export const sinCosPrimitive = {
83
101
  isAnswerValid: isSinCosPrimitiveAnswerValid,
84
102
  subject: "Mathématiques",
85
103
  getQuestionFromIdentifiers: getSinCosPrimitiveQuestionFromIdentifiers,
104
+ hasHintAndCorrection: true,
86
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"usualPrimitives.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/usualPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,6BAA6B,CAAC;AA4BrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AA+HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
1
+ {"version":3,"file":"usualPrimitives.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/usualPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,6BAA6B,CAAC;AA4BrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AA+HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
@@ -131,4 +131,5 @@ export const usualPrimitives = {
131
131
  subject: "Mathématiques",
132
132
  pdfOptions: { shouldSpreadPropositions: true },
133
133
  getQuestionFromIdentifiers,
134
+ hasHintAndCorrection: true,
134
135
  };
@@ -75,21 +75,21 @@ avec comme premier élément un élement de $D$, et comme deuxième élément un
75
75
  Voici un exemple :
76
76
 
77
77
  $$
78
- C = \\lbrace 32, 42, 52 \\rbrace
78
+ C = \\lbrace 32 ; 42 ; 52 \\rbrace
79
79
  $$
80
80
 
81
81
  $$
82
- D = \\lbrace u, v \\rbrace
82
+ D = \\lbrace u ; v \\rbrace
83
83
  $$
84
84
 
85
85
  Voici les couples appartenant à $D \\times C$ :
86
86
 
87
87
  $$
88
- (u,32),(u,42),(u,52),
88
+ (u;32),(u;42),(u;52),
89
89
  $$
90
90
 
91
91
  $$
92
- (v,32),(v,42),(v,52)
92
+ (v;32),(v;42),(v;52)
93
93
  $$
94
94
 
95
95
  Le cardinal de $D \\times C$ est donc $2\\times3=6$.`;
@@ -108,15 +108,15 @@ Chaque carte peut être soit Pique, soit Coeur.
108
108
  Voici toutes les cartes possibles :
109
109
 
110
110
  $$
111
- (\\text{Valet},\\text{Pique}),(\\text{Valet},\\text{Coeur})
111
+ (\\text{Valet};\\text{Pique}),(\\text{Valet};\\text{Coeur})
112
112
  $$
113
113
 
114
114
  $$
115
- (\\text{Dame},\\text{Pique}),(\\text{Dame},\\text{Coeur})
115
+ (\\text{Dame};\\text{Pique}),(\\text{Dame};\\text{Coeur})
116
116
  $$
117
117
 
118
118
  $$
119
- (\\text{Roi},\\text{Pique}),(\\text{Roi},\\text{Coeur})
119
+ (\\text{Roi};\\text{Pique}),(\\text{Roi};\\text{Coeur})
120
120
  $$
121
121
 
122
122
  Il y en a $3\\times2=6$.`;
@@ -54,21 +54,21 @@ avec comme premier élément un élement de $D$, et comme deuxième élément un
54
54
  Voici un exemple :
55
55
 
56
56
  $$
57
- C = \\lbrace 32, 42, 52 \\rbrace
57
+ C = \\lbrace 32 ; 42 ; 52 \\rbrace
58
58
  $$
59
59
 
60
60
  $$
61
- D = \\lbrace u, v \\rbrace
61
+ D = \\lbrace u ; v \\rbrace
62
62
  $$
63
63
 
64
64
  Voici les couples appartenant à $D \\times C$ :
65
65
 
66
66
  $$
67
- (u,32),(u,42),(u,52),
67
+ (u;32),(u;42),(u;52),
68
68
  $$
69
69
 
70
70
  $$
71
- (v,32),(v,42),(v,52)
71
+ (v;32),(v;42),(v;52)
72
72
  $$
73
73
 
74
74
  `;
@@ -271,7 +271,7 @@ const getHint = (identifiers) => {
271
271
  return `Le point $M$ est l'image du point $F$ par la translation de vecteur $${nodeEquationForVecs.rightChild.toTex()}$.
272
272
  Tu as deux possibilités :
273
273
  - soit tu arrives à visualiser mentalement l'emplacement du point $M$ sur la figure et tu détermines ses coordonnées
274
- - soit tu détermines les coordonnées de $F$ et celles du vecteur $${nodeEquationForVecs.rightChild.toTex()}$ puis tu les additionne.`;
274
+ - soit tu détermines les coordonnées de $F$ et celles du vecteur $${nodeEquationForVecs.rightChild.toTex()}$ puis tu les additionnes.`;
275
275
  };
276
276
  const getCorrection = (identifiers) => {
277
277
  const { nodeIdsEquationForVecs } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"findOrthogonalProjectionOfPointOnPlane.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAS5C,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0G7C,KAAK,QAAQ,GAAG;IACd,sBAAsB,EAAE,qBAAqB,CAAC;IAC9C,oBAAoB,EAAE,sBAAsB,CAAC;IAC7C,oBAAoB,EAAE,eAAe,CAAC;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc,EAAE,qBAAqB,CAAC;IACtC,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;CAChD,CAAC;AA0ZF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAqBF,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAC3D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"findOrthogonalProjectionOfPointOnPlane.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAS5C,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA2G7C,KAAK,QAAQ,GAAG;IACd,sBAAsB,EAAE,qBAAqB,CAAC;IAC9C,oBAAoB,EAAE,sBAAsB,CAAC;IAC7C,oBAAoB,EAAE,eAAe,CAAC;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc,EAAE,qBAAqB,CAAC;IACtC,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;CAChD,CAAC;AAgZF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAqBF,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAC3D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -16,6 +16,7 @@ import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
16
16
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
17
17
  import { random, randomMany } from "../../../../utils/alea/random.js";
18
18
  import { shuffle } from "../../../../utils/alea/shuffle.js";
19
+ import { zip } from "../../../../utils/arrays/arrayZip.js";
19
20
  import { alignTex } from "../../../../utils/latex/alignTex.js";
20
21
  const [nodeVarX, nodeVarY, nodeVarZ] = ["x", "y", "z"].map((name) => new VariableNode(name));
21
22
  const createNodeCheckForIsPointBelongingToPlane = (spacePoint, nodePlaneEquation) => {
@@ -232,35 +233,21 @@ const getPropositions = (n, { answer, ...identifiers }) => {
232
233
  };
233
234
  const createRandomIdentifiers = (opts) => {
234
235
  const { typeDataForPlane } = opts;
235
- const funcRand1 = () => randint(-3, 4, coinFlip() ? [0] : []).toTree();
236
- const funcRand2 = () => randint(-6, 7, coinFlip() ? [0] : []).toTree();
237
- const funcRand3 = () => randint(-9, 10, coinFlip() ? [0] : []).toTree();
238
- function createRandomOrthogonalVector(vecSrc) {
239
- const [nodeX, nodeY, nodeZ] = [vecSrc.x, vecSrc.y, vecSrc.z];
240
- const nodeZero = (0).toTree();
241
- const vec1 = new SpaceVector("v1", opposite(nodeY), nodeX, nodeZero);
242
- const vec2 = new SpaceVector("v2", nodeZero, opposite(nodeZ), nodeY);
243
- const vec3 = new SpaceVector("v3", opposite(nodeZ), nodeZero, nodeX);
244
- const [factor1, factor2, factor3] = shuffle(random([
245
- [coinFlip(), false, false],
246
- [coinFlip(), coinFlip(), false],
247
- ])).map((isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree());
248
- return vec1
249
- .times(factor1)
250
- .add(vec2.times(factor2))
251
- .add(vec3.times(factor3));
252
- }
236
+ const funcRand1 = (isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree();
237
+ const funcRand2 = (isCanBeZero) => randint(-6, 7, isCanBeZero ? [] : [0]).toTree();
238
+ const funcRand3 = (isCanBeZero) => randint(-9, 10, isCanBeZero ? [] : [0]).toTree();
253
239
  //create vecR, vecS, vecT (base)
254
240
  const vecR = (() => {
255
- const [funcRandX, funcRandY, funcRandZ] = shuffle([
256
- funcRand1,
257
- funcRand2,
258
- funcRand3,
259
- ]);
260
- return new SpaceVector("r", funcRandX(), funcRandY(), funcRandZ());
241
+ const arrIsCanBeZero = shuffle(random([
242
+ [coinFlip(), false, false],
243
+ [coinFlip(), coinFlip(), false],
244
+ ]));
245
+ const arrFuncRand = shuffle([funcRand1, funcRand2, funcRand3]);
246
+ const [nodeX, nodeY, nodeZ] = zip(arrIsCanBeZero, arrFuncRand).map(([isCanBeZero, funcRand]) => funcRand(isCanBeZero));
247
+ return new SpaceVector("r", nodeX, nodeY, nodeZ);
261
248
  })();
262
249
  const vecS = (() => {
263
- const vecRaw = createRandomOrthogonalVector(vecR);
250
+ const vecRaw = vecR.getRandomOrthogonalVectorNonZero();
264
251
  return new SpaceVector("s", vecRaw.x, vecRaw.y, vecRaw.z);
265
252
  })();
266
253
  const [vecU, vecV] = (() => {
@@ -1,2 +1,2 @@
1
- export {};
1
+ export * from "./findOrthogonalProjectionOfPointOnPlane.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/orthogonalProjection/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/orthogonalProjection/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC"}
@@ -1,2 +1 @@
1
- export {};
2
- // export * from "./findOrthogonalProjectionOfPointOnPlane.js";
1
+ export * from "./findOrthogonalProjectionOfPointOnPlane.js";
@@ -1 +1 @@
1
- {"version":3,"file":"findNormalVectorFromPlanePointsCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAsE5C,KAAK,WAAW,GAAG;IACjB,wBAAwB,EAAE,qBAAqB,EAAE,CAAC;IAClD,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CAClD,CAAC;AAkRF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAmBvE,CAAC"}
1
+ {"version":3,"file":"findNormalVectorFromPlanePointsCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAqE5C,KAAK,WAAW,GAAG;IACjB,wBAAwB,EAAE,qBAAqB,EAAE,CAAC;IAClD,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CAClD,CAAC;AAwQF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAmBvE,CAAC"}
@@ -3,7 +3,6 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { SpacePoint, SpacePointConstructor, } from "../../../../math/geometry/spacePoint.js";
4
4
  import { SpaceVector, SpaceVectorConstructor, } from "../../../../math/geometry/spaceVector.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
- import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
7
6
  import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
8
7
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
8
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
@@ -133,35 +132,21 @@ const getPropositions = (n, { answer, ...identifiers }) => {
133
132
  return shuffleProps(propositions, n);
134
133
  };
135
134
  const createRandomIdentifiers = () => {
136
- const funcRand1 = () => randint(-3, 4, coinFlip() ? [0] : []).toTree();
137
- const funcRand2 = () => randint(-6, 7, coinFlip() ? [0] : []).toTree();
138
- const funcRand3 = () => randint(-9, 10, coinFlip() ? [0] : []).toTree();
139
- function createRandomOrthogonalVector(vecSrc) {
140
- const [nodeX, nodeY, nodeZ] = [vecSrc.x, vecSrc.y, vecSrc.z];
141
- const nodeZero = (0).toTree();
142
- const vec1 = new SpaceVector("v1", opposite(nodeY), nodeX, nodeZero);
143
- const vec2 = new SpaceVector("v2", nodeZero, opposite(nodeZ), nodeY);
144
- const vec3 = new SpaceVector("v3", opposite(nodeZ), nodeZero, nodeX);
145
- const [factor1, factor2, factor3] = shuffle(random([
146
- [coinFlip(), false, false],
147
- [coinFlip(), coinFlip(), false],
148
- ])).map((isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree());
149
- return vec1
150
- .times(factor1)
151
- .add(vec2.times(factor2))
152
- .add(vec3.times(factor3));
153
- }
135
+ const funcRand1 = (isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree();
136
+ const funcRand2 = (isCanBeZero) => randint(-6, 7, isCanBeZero ? [] : [0]).toTree();
137
+ const funcRand3 = (isCanBeZero) => randint(-9, 10, isCanBeZero ? [] : [0]).toTree();
154
138
  //create vecR, vecS, vecT (base)
155
139
  const vecR = (() => {
156
- const [funcRandX, funcRandY, funcRandZ] = shuffle([
157
- funcRand1,
158
- funcRand2,
159
- funcRand3,
160
- ]);
161
- return new SpaceVector("r", funcRandX(), funcRandY(), funcRandZ());
140
+ const arrIsCanBeZero = shuffle(random([
141
+ [coinFlip(), false, false],
142
+ [coinFlip(), coinFlip(), false],
143
+ ]));
144
+ const arrFuncRand = shuffle([funcRand1, funcRand2, funcRand3]);
145
+ const [nodeX, nodeY, nodeZ] = zip(arrIsCanBeZero, arrFuncRand).map(([isCanBeZero, funcRand]) => funcRand(isCanBeZero));
146
+ return new SpaceVector("r", nodeX, nodeY, nodeZ);
162
147
  })();
163
148
  const vecS = (() => {
164
- const vecRaw = createRandomOrthogonalVector(vecR);
149
+ const vecRaw = vecR.getRandomOrthogonalVectorNonZero();
165
150
  return new SpaceVector("s", vecRaw.x, vecRaw.y, vecRaw.z);
166
151
  })();
167
152
  const [vecU, vecV] = (() => {