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.
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +2 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +2 -2
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +2 -2
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +9 -2
- package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/index.js +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.js +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.js +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +1 -1
- package/lib/exercises/math/derivation/problems/index.d.ts +1 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/index.js +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +31 -21
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +8 -128
- package/lib/exercises/math/derivation/tangent/index.d.ts +1 -0
- package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/index.js +1 -1
- package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +47 -20
- package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +29 -6
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +33 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts +7 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts.map +1 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.js +86 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +35 -7
- package/lib/exercises/math/equaDiff/index.d.ts +1 -1
- package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/index.js +1 -1
- package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpU.js +48 -0
- package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralFractions.js +52 -0
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralTrinomials.js +40 -0
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +2 -2
- package/lib/exercises/math/functions/logarithm/powerEquation.js +1 -1
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +172 -51
- package/lib/exercises/math/geometry/angles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/index.js +1 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +30 -25
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +52 -5
- package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.d.ts.map +1 -1
- package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.js +26 -35
- package/lib/exercises/math/integration/fromExpr/index.d.ts +1 -0
- package/lib/exercises/math/integration/fromExpr/index.d.ts.map +1 -1
- package/lib/exercises/math/integration/fromExpr/index.js +1 -1
- package/lib/exercises/math/limits/index.d.ts +1 -5
- package/lib/exercises/math/limits/index.d.ts.map +1 -1
- package/lib/exercises/math/limits/index.js +1 -5
- package/lib/exercises/math/limits/limitReading.d.ts.map +1 -1
- package/lib/exercises/math/limits/limitReading.js +70 -0
- package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimit.js +55 -4
- package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimitNoFI.js +35 -2
- package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequenceGeometricLimit.js +45 -9
- package/lib/exercises/math/limits/sequencePolynomLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequencePolynomLimit.js +56 -3
- package/lib/exercises/math/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +32 -0
- package/lib/exercises/math/limits/sequencePolynomProductLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequencePolynomProductLimit.js +33 -3
- package/lib/exercises/math/limits/sequenceRationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequenceRationalFracLimit.js +2 -2
- package/lib/exercises/math/limits/sequences/index.d.ts +6 -0
- package/lib/exercises/math/limits/sequences/index.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/index.js +5 -0
- package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts +9 -0
- package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.js +110 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts +7 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomLimit.js +116 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts +7 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.js +95 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts +8 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.js +111 -0
- package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts +8 -0
- package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts.map +1 -0
- package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.js +114 -0
- package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/constantPrimitive.js +25 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.js +17 -0
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +17 -1
- package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/sinCosPrimitive.js +20 -1
- package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
- package/lib/exercises/math/primitive/usualPrimitives.js +1 -0
- package/lib/exercises/math/sequences/index.d.ts +1 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +1 -0
- package/lib/exercises/math/sequences/proofByInduction/index.d.ts +5 -0
- package/lib/exercises/math/sequences/proofByInduction/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/index.js +4 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts +10 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.js +236 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts +13 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.js +244 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts +98 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.js +175 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts +13 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.js +317 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts +13 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts.map +1 -0
- package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.js +265 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.js +4 -4
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.js +3 -3
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.js +4 -4
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js +1 -1
- package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.js +12 -25
- package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts +1 -1
- package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.js +1 -2
- package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.js +11 -26
- package/lib/exercises/math/spaceGeometry/planes/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/planes/index.js +1 -1
- package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.js +11 -25
- package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.js +25 -5
- package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/scalarProduct/index.js +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/findLinearDecompositionWrtCoplanarUVFromCoords.js +2 -2
- package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +87 -24
- package/lib/exercises/pc/mathExosInPC.d.ts +1 -1
- package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
- package/lib/exercises/pc/mathExosInPC.js +1 -1
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -1
- package/lib/exercises/vea/polynomialVEA.js +4 -0
- package/lib/index.d.ts +104 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +1 -1
- package/lib/math/geometry/spaceVector.d.ts +2 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +40 -0
- package/lib/math/utils/functions/functionDecomposition.d.ts +2 -2
- package/lib/math/utils/functions/functionDecomposition.d.ts.map +1 -1
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +2 -2
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -1
- package/lib/math/utils/polynomial/polynomialUtils.js +5 -2
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +8 -12
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +14 -6
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/student/iDontKnowNode.d.ts +26 -0
- package/lib/tree/nodes/student/iDontKnowNode.d.ts.map +1 -0
- package/lib/tree/nodes/student/iDontKnowNode.js +63 -0
- package/lib/tree/parsers/latexParser.d.ts +3 -2
- package/lib/tree/parsers/latexParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +7 -0
- package/lib/tree/parsers/monomParser.d.ts +1 -1
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/polynomialParser.d.ts +1 -1
- package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
- package/lib/tree/parsers/trinomParser.d.ts +1 -1
- package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
- package/lib/tree/utilities/nodeComparator.d.ts +3 -1
- package/lib/tree/utilities/nodeComparator.d.ts.map +1 -1
- package/lib/tree/utilities/nodeComparator.js +68 -8
- package/lib/tree/utilities/nodeSimplifier.d.ts +1 -0
- package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
- package/lib/tree/utilities/nodeSimplifier.js +40 -0
- 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
|
|
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;
|
|
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,
|
|
236
|
-
const funcRand2 = () => randint(-6, 7,
|
|
237
|
-
const funcRand3 = () => randint(-9, 10,
|
|
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
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
]);
|
|
260
|
-
|
|
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 =
|
|
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";
|
package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.d.ts.map
CHANGED
|
@@ -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;
|
|
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,
|
|
137
|
-
const funcRand2 = () => randint(-6, 7,
|
|
138
|
-
const funcRand3 = () => randint(-9, 10,
|
|
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
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
]);
|
|
161
|
-
|
|
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 =
|
|
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;
|
|
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
|
-
|
|
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;
|
|
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,
|
|
331
|
-
const funcRand2 = () => randint(-6, 7,
|
|
332
|
-
const funcRand3 = () => randint(-9, 10,
|
|
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
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
]);
|
|
355
|
-
|
|
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 =
|
|
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;
|
|
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"}
|
package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.js
CHANGED
|
@@ -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,
|
|
180
|
-
const funcRand2 = () => randint(-6, 7,
|
|
181
|
-
const funcRand3 = () => randint(-9, 10,
|
|
182
|
-
const [
|
|
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,
|
|
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;
|
|
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
|
-
|
|
3
|
+
export * from "./angleFromScalarProductFromSpacePointCoords.js";
|
|
4
4
|
export * from "./checkIsOrthogonalSpaceVecsFromCoords.js";
|
|
5
5
|
export * from "./checkIsSpaceVecOrthogonalToPlaneFromCoords.js";
|
|
6
6
|
export * from "./checkIsOrthogonalLinesFromParametricReps.js";
|
package/lib/exercises/math/spaceGeometry/vectors/findLinearDecompositionWrtCoplanarUVFromCoords.js
CHANGED
|
@@ -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
|
|
73
|
-
|
|
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,
|
|
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 =
|
|
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
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
95
|
-
|
|
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/
|
|
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,
|
|
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/
|
|
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":"
|
|
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 &&
|