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
@@ -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] = (() => {
@@ -2,5 +2,6 @@ export * from "./checkIsPointBelongingToPlane.js";
2
2
  export * from "./planeEquationFromNormalVectorAndContainedPoint.js";
3
3
  export * from "./findNormalVectorFromPlaneEquation.js";
4
4
  export * from "./planeEquationFromOrthogonalLineAndContainedPoint.js";
5
+ export * from "./findNormalVectorFromPlanePointsCoords.js";
5
6
  export * from "./planePlaneRelativePositions.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,uDAAuD,CAAC;AAEtE,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,uDAAuD,CAAC;AACtE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC"}
@@ -2,5 +2,5 @@ export * from "./checkIsPointBelongingToPlane.js";
2
2
  export * from "./planeEquationFromNormalVectorAndContainedPoint.js";
3
3
  export * from "./findNormalVectorFromPlaneEquation.js";
4
4
  export * from "./planeEquationFromOrthogonalLineAndContainedPoint.js";
5
- // export * from "./findNormalVectorFromPlanePointsCoords.js";
5
+ export * from "./findNormalVectorFromPlanePointsCoords.js";
6
6
  export * from "./planePlaneRelativePositions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"planePlaneRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,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;AAkH7C,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,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAsiBF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8BF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoBtE,CAAC"}
1
+ {"version":3,"file":"planePlaneRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,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;AAkH7C,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,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AA4hBF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8BF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoBtE,CAAC"}
@@ -327,35 +327,21 @@ const getPropositions = (_n, { answer }) => {
327
327
  };
328
328
  const createRandomIdentifiers = (opts) => {
329
329
  const { typeDataForPlane1, typeDataForPlane2 } = opts;
330
- const funcRand1 = () => randint(-3, 4, coinFlip() ? [0] : []).toTree();
331
- const funcRand2 = () => randint(-6, 7, coinFlip() ? [0] : []).toTree();
332
- const funcRand3 = () => randint(-9, 10, coinFlip() ? [0] : []).toTree();
333
- function createRandomOrthogonalVector(vecSrc) {
334
- const [nodeX, nodeY, nodeZ] = [vecSrc.x, vecSrc.y, vecSrc.z];
335
- const nodeZero = (0).toTree();
336
- const vec1 = new SpaceVector("v1", opposite(nodeY), nodeX, nodeZero);
337
- const vec2 = new SpaceVector("v2", nodeZero, opposite(nodeZ), nodeY);
338
- const vec3 = new SpaceVector("v3", opposite(nodeZ), nodeZero, nodeX);
339
- const [factor1, factor2, factor3] = shuffle(random([
340
- [coinFlip(), false, false],
341
- [coinFlip(), coinFlip(), false],
342
- ])).map((isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree());
343
- return vec1
344
- .times(factor1)
345
- .add(vec2.times(factor2))
346
- .add(vec3.times(factor3));
347
- }
330
+ const funcRand1 = (isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree();
331
+ const funcRand2 = (isCanBeZero) => randint(-6, 7, isCanBeZero ? [] : [0]).toTree();
332
+ const funcRand3 = (isCanBeZero) => randint(-9, 10, isCanBeZero ? [] : [0]).toTree();
348
333
  //create vecR, vecS, vecT (base)
349
334
  const vecR = (() => {
350
- const [funcRandX, funcRandY, funcRandZ] = shuffle([
351
- funcRand1,
352
- funcRand2,
353
- funcRand3,
354
- ]);
355
- return new SpaceVector("r", funcRandX(), funcRandY(), funcRandZ());
335
+ const arrIsCanBeZero = shuffle(random([
336
+ [coinFlip(), false, false],
337
+ [coinFlip(), coinFlip(), false],
338
+ ]));
339
+ const arrFuncRand = shuffle([funcRand1, funcRand2, funcRand3]);
340
+ const [nodeX, nodeY, nodeZ] = zip(arrIsCanBeZero, arrFuncRand).map(([isCanBeZero, funcRand]) => funcRand(isCanBeZero));
341
+ return new SpaceVector("r", nodeX, nodeY, nodeZ);
356
342
  })();
357
343
  const vecS = (() => {
358
- const vecRaw = createRandomOrthogonalVector(vecR);
344
+ const vecRaw = vecR.getRandomOrthogonalVectorNonZero();
359
345
  return new SpaceVector("s", vecRaw.x, vecRaw.y, vecRaw.z);
360
346
  })();
361
347
  const [vecU, vecV] = (() => {
@@ -1 +1 @@
1
- {"version":3,"file":"angleFromScalarProductFromSpacePointCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAiD3C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC,CAAC;AA+QF,eAAO,MAAM,0CAA0C,EAAE,QAAQ,CAAC,WAAW,CAoB1E,CAAC"}
1
+ {"version":3,"file":"angleFromScalarProductFromSpacePointCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAmD3C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC,CAAC;AAuSF,eAAO,MAAM,0CAA0C,EAAE,QAAQ,CAAC,WAAW,CAoB1E,CAAC"}
@@ -15,6 +15,8 @@ import { square } from "../../../../tree/nodes/operators/powerNode.js";
15
15
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
16
16
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
17
17
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
18
+ import { random } from "../../../../utils/alea/random.js";
19
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
18
20
  import { zip } from "../../../../utils/arrays/arrayZip.js";
19
21
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
20
22
  import { alignTex } from "../../../../utils/latex/alignTex.js";
@@ -176,13 +178,31 @@ const isAnswerValid = (ans, { answer }) => {
176
178
  }
177
179
  };
178
180
  const createRandomIdentifiers = () => {
179
- const funcRand1 = () => randint(-3, 4, coinFlip() ? [0] : []).toTree();
180
- const funcRand2 = () => randint(-6, 7, coinFlip() ? [0] : []).toTree();
181
- const funcRand3 = () => randint(-9, 10, coinFlip() ? [0] : []).toTree();
182
- const [vecU, vecV] = zip(["u", "v"], [
181
+ const funcRand1 = (isCanBeZero) => randint(-3, 4, isCanBeZero ? [] : [0]).toTree();
182
+ const funcRand2 = (isCanBeZero) => randint(-6, 7, isCanBeZero ? [] : [0]).toTree();
183
+ const funcRand3 = (isCanBeZero) => randint(-9, 10, isCanBeZero ? [] : [0]).toTree();
184
+ const [vec1, vec2] = zip(["u", "v"], [
183
185
  [funcRand1, funcRand2, funcRand3],
184
186
  [funcRand3, funcRand2, funcRand1],
185
- ]).map(([name, [funcRandX, funcRandY, funcRandZ]]) => new SpaceVector(name, funcRandX(), funcRandY(), funcRandZ()));
187
+ ]).map(([name, arrFuncRand]) => {
188
+ const arrIsCanBeZero = shuffle(random([
189
+ [coinFlip(), false, false],
190
+ [coinFlip(), coinFlip(), false],
191
+ ]));
192
+ const [nodeX, nodeY, nodeZ] = zip(arrIsCanBeZero, arrFuncRand).map(([isCanBeZero, funcRand]) => funcRand(isCanBeZero));
193
+ return new SpaceVector(name, nodeX, nodeY, nodeZ);
194
+ });
195
+ const vecU = vec1;
196
+ const vecV = (() => {
197
+ const isVec2EqualsVec1 = vec2.equals(vec1);
198
+ if (isVec2EqualsVec1) {
199
+ const vec1Orth = vec1.getRandomOrthogonalVectorNonZero();
200
+ return vec2.add(vec1Orth);
201
+ }
202
+ else {
203
+ return vec2;
204
+ }
205
+ })();
186
206
  const A = new SpacePoint("A", randint(-5, 6).toTree(), randint(-5, 6).toTree(), randint(-5, 6).toTree());
187
207
  const [B, C] = [
188
208
  ["B", vecU],
@@ -1,5 +1,6 @@
1
1
  export * from "./scalarProductFromCubeOuterPoints.js";
2
2
  export * from "./scalarProductFromSpacePointCoords.js";
3
+ export * from "./angleFromScalarProductFromSpacePointCoords.js";
3
4
  export * from "./checkIsOrthogonalSpaceVecsFromCoords.js";
4
5
  export * from "./checkIsSpaceVecOrthogonalToPlaneFromCoords.js";
5
6
  export * from "./checkIsOrthogonalLinesFromParametricReps.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/scalarProduct/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export * from "./scalarProductFromCubeOuterPoints.js";
2
2
  export * from "./scalarProductFromSpacePointCoords.js";
3
- // export * from "./angleFromScalarProductFromSpacePointCoords.js";
3
+ export * from "./angleFromScalarProductFromSpacePointCoords.js";
4
4
  export * from "./checkIsOrthogonalSpaceVecsFromCoords.js";
5
5
  export * from "./checkIsSpaceVecOrthogonalToPlaneFromCoords.js";
6
6
  export * from "./checkIsOrthogonalLinesFromParametricReps.js";
@@ -69,8 +69,8 @@ $$
69
69
  \\overrightarrow{w} = a \\overrightarrow{u} + b \\overrightarrow{v}
70
70
  $$
71
71
 
72
- Cela donne un système de $2$ équations: une pour chaque composante du vecteur \\overrightarrow{w}.
73
- Résout ce système, autrement dit détermine $a$ et $b$.
72
+ Cela donne un système de $2$ équations: une pour chaque composante du vecteur $\\overrightarrow{w}$.
73
+ Résous ce système, autrement dit détermine $a$ et $b$.
74
74
 
75
75
  Les coordonnées de $\\overrightarrow{w}$ dans la base $(\\overrightarrow{u};\\overrightarrow{v})$.`;
76
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAkIF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
1
+ {"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AA+OF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAe7D,CAAC"}
@@ -6,7 +6,7 @@ import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationS
6
6
  import { CosNode } from "../../../../tree/nodes/functions/cosNode.js";
7
7
  import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
8
8
  import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
9
- import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
11
11
  import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
12
12
  import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
@@ -16,7 +16,10 @@ const getPropositions = (n, { answer, degree, leftBoundPiMultiple }) => {
16
16
  addValidProp(propositions, answer);
17
17
  //distracteur avec une solution manquante
18
18
  if (degree !== 0 && degree !== 180) {
19
- const answerNode = getAnswerNode({ degree, leftBoundPiMultiple });
19
+ const answerNode = getAnswerStuff({
20
+ degree,
21
+ leftBoundPiMultiple,
22
+ }).nodeEquationSolution;
20
23
  const newSet = answerNode.solutionsSet.toDeleteRandomElement();
21
24
  tryToAddWrongProp(propositions, new EquationSolutionNode(newSet).toTex());
22
25
  }
@@ -27,7 +30,7 @@ const getPropositions = (n, { answer, degree, leftBoundPiMultiple }) => {
27
30
  });
28
31
  return shuffleProps(propositions, n);
29
32
  };
30
- const getAnswerNode = (identifiers) => {
33
+ const getAnswerStuff = (identifiers) => {
31
34
  const coeff = identifiers.leftBoundPiMultiple;
32
35
  /**
33
36
  * Si l'intervalle est centré autour d'un multiple de 2pi (coeff impair) (genre ]3pi, 5pi]) on ajoute (coeff+1)/2 tours
@@ -38,20 +41,82 @@ const getAnswerNode = (identifiers) => {
38
41
  .find((v) => v.degree === identifiers.degree)
39
42
  .cos.evaluate({});
40
43
  const values = (Math.abs(coeff % 2) === 1 ? mainTrigoValues : trigoValuesOnZeroTwoPIOF).filter((v) => v.cos.evaluate({}) === cos);
41
- if (values.length === 1) {
42
- const value = values[0];
43
- const newValue = new AddNode(value.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
44
- return new EquationSolutionNode(new DiscreteSetNode([newValue]));
45
- }
46
- else {
47
- const newValues = values.map((v) => {
48
- return new AddNode(v.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
49
- });
50
- return new EquationSolutionNode(new DiscreteSetNode(newValues.sort((a, b) => a.evaluate({}) - b.evaluate({}))));
51
- }
44
+ const [nodeEquationSolutionOn02Pi, nodeEquationSolution] = (() => {
45
+ if (values.length === 1) {
46
+ const value = values[0];
47
+ const newValue = new AddNode(value.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
48
+ return [
49
+ new EquationSolutionNode(new DiscreteSetNode([value.angle])),
50
+ new EquationSolutionNode(new DiscreteSetNode([newValue])),
51
+ ];
52
+ }
53
+ else {
54
+ const newValues = values.map((v) => {
55
+ return new AddNode(v.angle, new MultiplyNode((turnsToAdd * 2).toTree(), PiNode)).simplify();
56
+ });
57
+ return [
58
+ new EquationSolutionNode(new DiscreteSetNode(values.map((value) => value.angle))),
59
+ new EquationSolutionNode(new DiscreteSetNode(newValues.sort((a, b) => a.evaluate({}) - b.evaluate({})))),
60
+ ];
61
+ }
62
+ })();
63
+ return {
64
+ nodeEquationSolutionOn02Pi,
65
+ nodeEquationSolution,
66
+ turnsToAdd,
67
+ };
52
68
  };
53
69
  const getAnswer = (identifiers) => {
54
- return getAnswerNode(identifiers).toTex();
70
+ return getAnswerStuff(identifiers).nodeEquationSolution.toTex();
71
+ };
72
+ const getHint = (identifiers) => {
73
+ const { leftBoundPiMultiple } = identifiers;
74
+ const interval02Pi = new IntervalNode(multiply(0, PiNode).simplify(), multiply(2, PiNode).simplify(), ClosureType.OF);
75
+ const intervalMinusPiPi = new IntervalNode(multiply(-1, PiNode).simplify(), multiply(+1, PiNode).simplify(), ClosureType.OF);
76
+ const intervalEasier = leftBoundPiMultiple % 2 === 0 ? interval02Pi : intervalMinusPiPi;
77
+ return `Commence par résoudre l'équation sur $${intervalEasier.toTex()}$.
78
+
79
+ Ensuite, puisque la fonction $\\cos$ est $${multiply(2, PiNode).toTex()}$-périodique, ajoute ou ôte $${multiply(2, PiNode).toTex()}$ à tes solutions autant de fois que nécessaire jusqu'à être dans l'intervalle de l'énoncé.`;
80
+ };
81
+ const getCorrection = (identifiers) => {
82
+ const { degree, leftBoundPiMultiple } = identifiers;
83
+ const value = mainPositiveTrigovalues.find((v) => v.degree === degree);
84
+ const offsetFactor2Pi = Math.ceil(leftBoundPiMultiple / 2);
85
+ const interval02Pi = new IntervalNode(multiply(0, PiNode).simplify(), multiply(2, PiNode).simplify(), ClosureType.OF);
86
+ const intervalMinusPiPi = new IntervalNode(multiply(-1, PiNode).simplify(), multiply(+1, PiNode).simplify(), ClosureType.OF);
87
+ const intervalEasier = leftBoundPiMultiple % 2 === 0 ? interval02Pi : intervalMinusPiPi;
88
+ const leftBound = new MultiplyNode(leftBoundPiMultiple.toTree(), PiNode).simplify();
89
+ const rightBound = new MultiplyNode((leftBoundPiMultiple + 2).toTree(), PiNode).simplify();
90
+ const interval = new IntervalNode(leftBound, rightBound, ClosureType.OF);
91
+ const { nodeEquationSolutionOn02Pi, nodeEquationSolution } = getAnswerStuff(identifiers);
92
+ return `Sur l'intervalle $${intervalEasier.toTex()}$, la solution de
93
+
94
+ $$
95
+ ${new CosNode("x".toTree()).toTex()}=${value.cos.toTex()}
96
+ $$
97
+
98
+ est :
99
+
100
+ $$
101
+ ${nodeEquationSolutionOn02Pi.toTex()}
102
+ $$
103
+
104
+ ${(() => {
105
+ if (intervalEasier.toTex() !== interval.toTex()) {
106
+ return `Pour avoir la solution sur l'intervalle $${interval.toTex()}$, on ajoute $${offsetFactor2Pi.frenchify()}$ fois $${multiply(2, PiNode).toTex()}$.
107
+
108
+ La solution est donc :
109
+
110
+ $$
111
+ ${nodeEquationSolution.toTex()}
112
+ $$
113
+
114
+ `;
115
+ }
116
+ else {
117
+ return ``;
118
+ }
119
+ })()}`;
55
120
  };
56
121
  const getInstruction = ({ degree, leftBoundPiMultiple, }) => {
57
122
  const value = mainPositiveTrigovalues.find((v) => v.degree === degree);
@@ -64,17 +129,14 @@ $$
64
129
  ${new CosNode("x".toTree()).toTex()}=${value.cos.toTex()}
65
130
  $$`;
66
131
  };
67
- // const getHint: GetHint<Identifiers> = (identifiers) => {
68
- // return "";
69
- // };
70
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
71
- // return "";
72
- // };
73
132
  const getKeys = () => {
74
133
  return ["x", "S", "equal", "lbrace", "semicolon", "rbrace", "pi"];
75
134
  };
76
135
  const isAnswerValid = (ans, { degree, leftBoundPiMultiple }) => {
77
- const answerNode = getAnswerNode({ degree, leftBoundPiMultiple });
136
+ const answerNode = getAnswerStuff({
137
+ degree,
138
+ leftBoundPiMultiple,
139
+ }).nodeEquationSolution;
78
140
  return answerNode.toAllValidTexs().includes(ans);
79
141
  };
80
142
  const getEquationCosOnRandomIntervalQuestion = () => {
@@ -91,8 +153,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
91
153
  keys: getKeys(identifiers),
92
154
  answerFormat: "tex",
93
155
  identifiers,
94
- // hint: getHint(identifiers),
95
- // correction: getCorrection(identifiers),
156
+ hint: getHint(identifiers),
157
+ correction: getCorrection(identifiers),
96
158
  };
97
159
  return question;
98
160
  };
@@ -108,4 +170,5 @@ export const equationCosOnRandomInterval = {
108
170
  isAnswerValid,
109
171
  subject: "Mathématiques",
110
172
  getQuestionFromIdentifiers,
173
+ hasHintAndCorrection: true,
111
174
  };
@@ -18,7 +18,7 @@ export * from "../math/functions/affines/affineExpressionReading.js";
18
18
  export * from "../math/geometry/thales/thales.js";
19
19
  export * from "../math/geometry/thales/thalesCalcul.js";
20
20
  export * from "../math/equaDiff/equaDiffCheckSolutionFirstOrder.js";
21
- export * from "../math/equaDiff/equaDiffGeneralForme.js";
21
+ export * from "../math/equaDiff/exponentialDifferentialEquation.js";
22
22
  export * from "../math/equaDiff/exponentialDifferentialEquationWithIC.js";
23
23
  export * from "../math/derivation/tangent/derivativeNumberReading.js";
24
24
  export * from "../math/derivation/derivative/polynomial/usualderivative.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mathExosInPC.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/mathExosInPC.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AACrE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC;AACzD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAC;AAC5G,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC"}
1
+ {"version":3,"file":"mathExosInPC.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/mathExosInPC.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AACrE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAC;AAC5G,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC"}
@@ -18,7 +18,7 @@ export * from "../math/functions/affines/affineExpressionReading.js";
18
18
  export * from "../math/geometry/thales/thales.js";
19
19
  export * from "../math/geometry/thales/thalesCalcul.js";
20
20
  export * from "../math/equaDiff/equaDiffCheckSolutionFirstOrder.js";
21
- export * from "../math/equaDiff/equaDiffGeneralForme.js";
21
+ export * from "../math/equaDiff/exponentialDifferentialEquation.js";
22
22
  export * from "../math/equaDiff/exponentialDifferentialEquationWithIC.js";
23
23
  export * from "../math/derivation/tangent/derivativeNumberReading.js";
24
24
  export * from "../math/derivation/derivative/polynomial/usualderivative.js";
@@ -1 +1 @@
1
- {"version":3,"file":"polynomialVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/polynomialVEA.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,YAmBxD,CAAC"}
1
+ {"version":3,"file":"polynomialVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/polynomialVEA.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,YAuBxD,CAAC"}
@@ -1,11 +1,15 @@
1
1
  import { getArrNodeCoeffOfPolynomialNode } from "../../math/utils/polynomial/polynomialUtils.js";
2
2
  import { substract } from "../../tree/nodes/operators/substractNode.js";
3
+ import { isIDontKnowNode } from "../../tree/nodes/student/iDontKnowNode.js";
3
4
  import { parseAlgebraic } from "../../tree/parsers/latexParser.js";
4
5
  import { zip } from "../../utils/arrays/arrayZip.js";
5
6
  import { handleVEAError } from "../../utils/errors/handleVEAError.js";
6
7
  export const polynomialVEA = (ans, answer) => {
7
8
  try {
8
9
  const nodeAns = parseAlgebraic(ans);
10
+ if (isIDontKnowNode(nodeAns)) {
11
+ return false;
12
+ }
9
13
  const nodeAnswer = parseAlgebraic(answer);
10
14
  const [arrNodeCoeffAns, arrNodeCoeffAnswer] = [nodeAns, nodeAnswer].map((node) => getArrNodeCoeffOfPolynomialNode(node));
11
15
  return (arrNodeCoeffAns.length === arrNodeCoeffAnswer.length &&