math-exercises 3.0.158 → 3.0.159
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/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +7 -6
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +88 -9
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +8 -2
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +27 -2
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.js +0 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +0 -1
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +11 -4
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +11 -5
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +91 -21
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +63 -43
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +72 -49
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -19
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +26 -14
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts +1 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/index.js +1 -0
- 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 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts +7 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +174 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +30 -3
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +12 -7
- package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +2 -2
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +33 -44
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +80 -8
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +80 -25
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +6 -15
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +54 -42
- package/lib/exercises/math/functions/exponential/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +3 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +18 -23
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +24 -26
- package/lib/exercises/math/functions/variations/index.d.ts +1 -0
- package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/index.js +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +3 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/index.js +1 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
- package/lib/exercises/math/sequences/generation/index.d.ts +2 -0
- package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/index.js +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
- package/lib/exercises/math/sequences/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/index.js +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
- package/lib/exercises/math/sequences/index.d.ts +2 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
- package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
- package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/index.js +2 -0
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
- package/lib/exercises/vea/cartesianLineVEA.d.ts +2 -0
- package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/cartesianLineVEA.js +1 -0
- package/lib/index.d.ts +123 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +2 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +7 -0
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +5 -0
- package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
- package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
- package/lib/math/geometry/polygons/relationPP.js +41 -0
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +15 -6
- package/lib/math/utils/arithmetic/primeFactors.js +1 -1
- package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
- package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
- package/lib/math/utils/geometry/randomVecs2.js +34 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -2
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +6 -4
- package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randomVecs2 } from "../../../../../../math/utils/geometry/randomVecs2.js";
|
|
4
|
+
import { NodeConstructor, } from "../../../../../../tree/nodes/nodeConstructor.js";
|
|
5
|
+
import { add } from "../../../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { multiply } from "../../../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { coinFlip } from "../../../../../../utils/alea/coinFlip.js";
|
|
8
|
+
import { zip } from "../../../../../../utils/arrays/arrayZip.js";
|
|
9
|
+
import { alignTex } from "../../../../../../utils/latex/alignTex.js";
|
|
10
|
+
const getHydratedNodes = (identifiers) => {
|
|
11
|
+
const { nodeIdsU, nodeIdsV } = identifiers;
|
|
12
|
+
return {
|
|
13
|
+
nodesU: nodeIdsU.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds)),
|
|
14
|
+
nodesV: nodeIdsV.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds)),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
const { nodesU, nodesV } = getHydratedNodes(identifiers);
|
|
19
|
+
const [i, j, u, v] = ["i", "j", "u", "v"].map((letter) => `\\overrightarrow{${letter}}`);
|
|
20
|
+
const [texUI, texVI] = [nodesU[0], nodesV[0]].map((node) => {
|
|
21
|
+
const v = node.evaluate();
|
|
22
|
+
if (v === -1) {
|
|
23
|
+
return "-";
|
|
24
|
+
}
|
|
25
|
+
else if (v === 1) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return node.toTex();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const [texUJ, texVJ] = [nodesU[1], nodesV[1]].map((node) => {
|
|
33
|
+
const v = node.evaluate();
|
|
34
|
+
if (v >= 0) {
|
|
35
|
+
return v === 1 ? "+" : `+ ${node.toTex()}`;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return v === -1 ? "-" : node.toTex();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return `Soient $${i}$ et $${j}$ deux vecteurs formant une base orthonormale du plan.
|
|
42
|
+
|
|
43
|
+
Soient $${u}$ et $${v}$ deux vecteurs tels que :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
${u} = ${texUI}${i} ${texUJ}${j}
|
|
47
|
+
$$
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
${v} = ${texVI}${i} ${texVJ}${j}
|
|
51
|
+
$$
|
|
52
|
+
|
|
53
|
+
Les vecteurs $u$ et $v$ sont-ils orthogonaux ?`;
|
|
54
|
+
};
|
|
55
|
+
const getAnswerNode = (identifiers) => {
|
|
56
|
+
const { nodesU, nodesV } = getHydratedNodes(identifiers);
|
|
57
|
+
return zip(nodesU, nodesV)
|
|
58
|
+
.map(([nodeUX, nodeVX]) => multiply(nodeUX, nodeVX))
|
|
59
|
+
.reduce((acc, nodeX) => add(acc, nodeX));
|
|
60
|
+
};
|
|
61
|
+
const getAnswer = (identifiers) => {
|
|
62
|
+
const answerNode = getAnswerNode(identifiers);
|
|
63
|
+
const isOrthogonal = answerNode.simplify().evaluate() === 0;
|
|
64
|
+
return ["Oui", "Non"][isOrthogonal ? 0 : 1];
|
|
65
|
+
};
|
|
66
|
+
const getHint = () => {
|
|
67
|
+
const [i, j] = ["i", "j"].map((letter) => `\\overrightarrow{${letter}}`);
|
|
68
|
+
return `Les vecteurs $${i}$ et $${j}$ forment une base orthonormale.
|
|
69
|
+
|
|
70
|
+
Autrement dit :
|
|
71
|
+
|
|
72
|
+
$$
|
|
73
|
+
${i} \\cdot ${i} = ${j} \\cdot ${j} = 1
|
|
74
|
+
$$
|
|
75
|
+
|
|
76
|
+
et
|
|
77
|
+
|
|
78
|
+
$$
|
|
79
|
+
${i} \\cdot ${j} = 0
|
|
80
|
+
$$
|
|
81
|
+
|
|
82
|
+
`;
|
|
83
|
+
};
|
|
84
|
+
const getCorrection = (identifiers) => {
|
|
85
|
+
const { nodesU, nodesV } = getHydratedNodes(identifiers);
|
|
86
|
+
const [i, j, u, v] = ["i", "j", "u", "v"].map((letter) => `\\overrightarrow{${letter}}`);
|
|
87
|
+
const [texUI, texVI] = [nodesU[0], nodesV[0]].map((node) => {
|
|
88
|
+
const v = node.evaluate();
|
|
89
|
+
if (v === -1) {
|
|
90
|
+
return "-";
|
|
91
|
+
}
|
|
92
|
+
else if (v === 1) {
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return node.toTex();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const [texUJ, texVJ] = [nodesU[1], nodesV[1]].map((node) => {
|
|
100
|
+
const v = node.evaluate();
|
|
101
|
+
if (v >= 0) {
|
|
102
|
+
return v === 1 ? "+" : `+ ${node.toTex()}`;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return v === -1 ? "-" : node.toTex();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
|
|
109
|
+
return `On développe :
|
|
110
|
+
|
|
111
|
+
${alignTex([
|
|
112
|
+
["", `${u} \\cdot ${v}`],
|
|
113
|
+
["=", `(${texUI}${i} ${texUJ}${j}) \\cdot (${texVI}${i} ${texVJ}${j})`],
|
|
114
|
+
[
|
|
115
|
+
"=",
|
|
116
|
+
`(${multiply(nodesU[0], nodesV[0]).toTex()})(${i} \\cdot ${i}) + (${multiply(nodesU[1], nodesV[1]).toTex()})(${j} \\cdot ${j}) + 0`,
|
|
117
|
+
],
|
|
118
|
+
])}
|
|
119
|
+
|
|
120
|
+
On s'est épargné le calcul des autres produits car
|
|
121
|
+
|
|
122
|
+
$$
|
|
123
|
+
${i} \\cdot ${j} = ${j} \\cdot ${i} = 0
|
|
124
|
+
$$
|
|
125
|
+
|
|
126
|
+
On peut donc calculer le produit scalaire en utilisant les coordonnées dans la base $(${i},${j})$ de la même manière que lorsque l'on travaille dans la base canonique du plan.
|
|
127
|
+
|
|
128
|
+
${alignTex([
|
|
129
|
+
["", `${u} \\cdot ${v}`],
|
|
130
|
+
[
|
|
131
|
+
"=",
|
|
132
|
+
`${getAnswerNode(identifiers).toTex({
|
|
133
|
+
forceTimesSign: true,
|
|
134
|
+
forceNoSimplification: true,
|
|
135
|
+
})}`,
|
|
136
|
+
],
|
|
137
|
+
["=", `${getAnswerNode(identifiers).simplify().toTex()}`],
|
|
138
|
+
])}
|
|
139
|
+
|
|
140
|
+
${(() => {
|
|
141
|
+
if (isOrthogonal) {
|
|
142
|
+
return `Le produit scalaire $${u} \\cdot ${v}$ est nul, les vecteurs $${u}$ et $${v}$ sont donc orthogonaux.`;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return `Le produit scalaire $${u} \\cdot ${v}$ n'est pas nul, les vecteurs $${u}$ et $${v}$ ne sont donc pas orthogonaux.`;
|
|
146
|
+
}
|
|
147
|
+
})()}`;
|
|
148
|
+
};
|
|
149
|
+
const getPropositions = (_, { answer, ...identifiers }) => {
|
|
150
|
+
const propositions = [];
|
|
151
|
+
const answerFromIdentifiers = getAnswer(identifiers);
|
|
152
|
+
["Oui", "Non"].forEach((strProp) => {
|
|
153
|
+
if (strProp === answerFromIdentifiers) {
|
|
154
|
+
addValidProp(propositions, strProp, "raw");
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
tryToAddWrongProp(propositions, strProp, "raw");
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return propositions;
|
|
161
|
+
};
|
|
162
|
+
const getScalarProductIsOrthogonalVecsBasisIJQuestion = () => {
|
|
163
|
+
const isOrthogonal = coinFlip();
|
|
164
|
+
const { vecU, vecV } = randomVecs2(isOrthogonal);
|
|
165
|
+
const nodesU = [vecU.x, vecU.y];
|
|
166
|
+
const nodesV = [vecV.x, vecV.y];
|
|
167
|
+
const identifiers = {
|
|
168
|
+
nodeIdsU: nodesU.map((node) => node.toIdentifiers()),
|
|
169
|
+
nodeIdsV: nodesV.map((node) => node.toIdentifiers()),
|
|
170
|
+
};
|
|
171
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
172
|
+
};
|
|
173
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
174
|
+
return {
|
|
175
|
+
answer: getAnswer(identifiers, opts),
|
|
176
|
+
instruction: getInstruction(identifiers, opts),
|
|
177
|
+
keys: [],
|
|
178
|
+
answerFormat: "tex",
|
|
179
|
+
identifiers,
|
|
180
|
+
hint: getHint(identifiers, opts),
|
|
181
|
+
correction: getCorrection(identifiers, opts),
|
|
182
|
+
options: opts,
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
export const scalarProductIsOrthogonalVecsBasisIJ = {
|
|
186
|
+
id: "scalarProductIsOrthogonalVecsBasisIJ",
|
|
187
|
+
connector: "=",
|
|
188
|
+
label: "Déterminer si deux vecteurs $\\overrightarrow{u}$ et $\\overrightarrow{v}$ exprimés dans une base orthonormée $(\\overrightarrow{i},\\overrightarrow{j})$ sont orthogonaux",
|
|
189
|
+
isSingleStep: true,
|
|
190
|
+
generator: (nb) => getDistinctQuestions(() => getScalarProductIsOrthogonalVecsBasisIJQuestion(), nb),
|
|
191
|
+
qcmTimer: 60,
|
|
192
|
+
freeTimer: 60,
|
|
193
|
+
getPropositions,
|
|
194
|
+
subject: "Mathématiques",
|
|
195
|
+
getInstruction,
|
|
196
|
+
getHint,
|
|
197
|
+
getCorrection,
|
|
198
|
+
getAnswer,
|
|
199
|
+
getQuestionFromIdentifiers,
|
|
200
|
+
hasHintAndCorrection: true,
|
|
201
|
+
answerType: "QCU",
|
|
202
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { VectorIdentifiers } from "../../../../../../math/geometry/vector.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
vecIdsU: VectorIdentifiers;
|
|
5
|
+
vecIdsV: VectorIdentifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const scalarProductIsOrthogonalVecsUsingCoords: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=scalarProductIsOrthogonalVecsUsingCoords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductIsOrthogonalVecsUsingCoords.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AASvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAgIF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAqB1E,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { VectorConstructor, } from "../../../../../../math/geometry/vector.js";
|
|
4
|
+
import { randomVecs2 } from "../../../../../../math/utils/geometry/randomVecs2.js";
|
|
5
|
+
import { add } from "../../../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { multiply } from "../../../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { coinFlip } from "../../../../../../utils/alea/coinFlip.js";
|
|
8
|
+
import { zip } from "../../../../../../utils/arrays/arrayZip.js";
|
|
9
|
+
import { alignTex } from "../../../../../../utils/latex/alignTex.js";
|
|
10
|
+
const getHydrated = (identifiers) => {
|
|
11
|
+
const { vecIdsU, vecIdsV } = identifiers;
|
|
12
|
+
return {
|
|
13
|
+
vecU: VectorConstructor.fromIdentifiers(vecIdsU),
|
|
14
|
+
vecV: VectorConstructor.fromIdentifiers(vecIdsV),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
const { vecU, vecV } = getHydrated(identifiers);
|
|
19
|
+
const [u, v] = [vecU, vecV].map((vec) => vec.toTex());
|
|
20
|
+
return `Soient $${vecU.toTex()}$ et $${vecV.toTex()}$ deux vecteurs tels que :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
${u} = ${vecU.toCoords()}
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
$$
|
|
27
|
+
${v} = ${vecV.toCoords()}
|
|
28
|
+
$$
|
|
29
|
+
|
|
30
|
+
Les vecteurs $u$ et $v$ sont-ils orthogonaux ?`;
|
|
31
|
+
};
|
|
32
|
+
const getAnswerNode = (identifiers) => {
|
|
33
|
+
const { vecU, vecV } = getHydrated(identifiers);
|
|
34
|
+
const nodesU = [vecU.x, vecU.y];
|
|
35
|
+
const nodesV = [vecV.x, vecV.y];
|
|
36
|
+
return zip(nodesU, nodesV)
|
|
37
|
+
.map(([nodeUX, nodeVX]) => multiply(nodeUX, nodeVX))
|
|
38
|
+
.reduce((acc, nodeX) => add(acc, nodeX));
|
|
39
|
+
};
|
|
40
|
+
const getAnswer = (identifiers) => {
|
|
41
|
+
const answerNode = getAnswerNode(identifiers);
|
|
42
|
+
const isOrthogonal = answerNode.simplify().evaluate() === 0;
|
|
43
|
+
return ["Oui", "Non"][isOrthogonal ? 0 : 1];
|
|
44
|
+
};
|
|
45
|
+
const getHint = () => {
|
|
46
|
+
const [a, b] = ["a", "b"].map((letter) => `\\overrightarrow{${letter}}`);
|
|
47
|
+
return `Deux vecteurs $${a}$ et $${b}$ sont orthogonaux si et seulement si $${a} \\cdot ${b} = 0$.`;
|
|
48
|
+
};
|
|
49
|
+
const getCorrection = (identifiers) => {
|
|
50
|
+
const { vecU, vecV } = getHydrated(identifiers);
|
|
51
|
+
const [u, v] = [vecU, vecV].map((vec) => vec.toTex());
|
|
52
|
+
const nodesU = [vecU.x, vecU.y];
|
|
53
|
+
const nodesV = [vecV.x, vecV.y];
|
|
54
|
+
const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
|
|
55
|
+
return `On calcule le produit scalaire :
|
|
56
|
+
|
|
57
|
+
${alignTex([
|
|
58
|
+
["", `${u} \\cdot ${v}`],
|
|
59
|
+
["=", `${vecU.toCoords()} \\cdot ${vecV.toCoords()}`],
|
|
60
|
+
[
|
|
61
|
+
"=",
|
|
62
|
+
`(${multiply(nodesU[0], nodesV[0]).toTex()}) + (${multiply(nodesU[1], nodesV[1]).toTex()})`,
|
|
63
|
+
],
|
|
64
|
+
["=", `${getAnswerNode(identifiers).simplify().toTex()}`],
|
|
65
|
+
])}
|
|
66
|
+
|
|
67
|
+
${(() => {
|
|
68
|
+
if (isOrthogonal) {
|
|
69
|
+
return `Le produit scalaire $${u} \\cdot ${v}$ est nul, les vecteurs $${u}$ et $${v}$ sont donc orthogonaux.`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return `Le produit scalaire $${u} \\cdot ${v}$ n'est pas nul, les vecteurs $${u}$ et $${v}$ ne sont donc pas orthogonaux.`;
|
|
73
|
+
}
|
|
74
|
+
})()}`;
|
|
75
|
+
};
|
|
76
|
+
const getPropositions = (_, { answer, ...identifiers }) => {
|
|
77
|
+
const propositions = [];
|
|
78
|
+
const answerFromIdentifiers = getAnswer(identifiers);
|
|
79
|
+
["Oui", "Non"].forEach((strProp) => {
|
|
80
|
+
if (strProp === answerFromIdentifiers) {
|
|
81
|
+
addValidProp(propositions, strProp, "raw");
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
tryToAddWrongProp(propositions, strProp, "raw");
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return propositions;
|
|
88
|
+
};
|
|
89
|
+
const getScalarProductIsOrthogonalVecsUsingCoordsQuestion = () => {
|
|
90
|
+
const isOrthogonal = coinFlip();
|
|
91
|
+
const { vecU, vecV } = randomVecs2(isOrthogonal);
|
|
92
|
+
const identifiers = {
|
|
93
|
+
vecIdsU: vecU.toIdentifiers(),
|
|
94
|
+
vecIdsV: vecV.toIdentifiers(),
|
|
95
|
+
};
|
|
96
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
97
|
+
};
|
|
98
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
99
|
+
return {
|
|
100
|
+
answer: getAnswer(identifiers, opts),
|
|
101
|
+
instruction: getInstruction(identifiers, opts),
|
|
102
|
+
keys: [],
|
|
103
|
+
answerFormat: "tex",
|
|
104
|
+
identifiers,
|
|
105
|
+
hint: getHint(identifiers, opts),
|
|
106
|
+
correction: getCorrection(identifiers, opts),
|
|
107
|
+
options: opts,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export const scalarProductIsOrthogonalVecsUsingCoords = {
|
|
111
|
+
id: "scalarProductIsOrthogonalVecsUsingCoords",
|
|
112
|
+
connector: "=",
|
|
113
|
+
label: "Déterminer si deux vecteurs de coordonnées données sont orthogonaux",
|
|
114
|
+
isSingleStep: true,
|
|
115
|
+
generator: (nb) => getDistinctQuestions(() => getScalarProductIsOrthogonalVecsUsingCoordsQuestion(), nb),
|
|
116
|
+
qcmTimer: 60,
|
|
117
|
+
freeTimer: 60,
|
|
118
|
+
getPropositions,
|
|
119
|
+
subject: "Mathématiques",
|
|
120
|
+
getInstruction,
|
|
121
|
+
getHint,
|
|
122
|
+
getCorrection,
|
|
123
|
+
getAnswer,
|
|
124
|
+
getQuestionFromIdentifiers,
|
|
125
|
+
hasHintAndCorrection: true,
|
|
126
|
+
answerType: "QCU",
|
|
127
|
+
};
|
package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../../../math/geometry/point.js";
|
|
3
|
+
import { VectorIdentifiers } from "../../../../../../math/geometry/vector.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
vecIdsU: VectorIdentifiers;
|
|
6
|
+
vecIdsV: VectorIdentifiers;
|
|
7
|
+
pointIds: PointIdentifiers;
|
|
8
|
+
pointNames: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const scalarProductIsPointOnCircle: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=scalarProductIsPointOnCircle.d.ts.map
|
package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductIsPointOnCircle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAYvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA8LF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAmB9D,CAAC"}
|
package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor, } from "../../../../../../math/geometry/point.js";
|
|
4
|
+
import { Vector, VectorConstructor, } from "../../../../../../math/geometry/vector.js";
|
|
5
|
+
import { randomVecs2 } from "../../../../../../math/utils/geometry/randomVecs2.js";
|
|
6
|
+
import { randint } from "../../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { add } from "../../../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { multiply } from "../../../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { substract } from "../../../../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { coinFlip } from "../../../../../../utils/alea/coinFlip.js";
|
|
11
|
+
import { shuffle } from "../../../../../../utils/alea/shuffle.js";
|
|
12
|
+
import { zip } from "../../../../../../utils/arrays/arrayZip.js";
|
|
13
|
+
import { alignTex } from "../../../../../../utils/latex/alignTex.js";
|
|
14
|
+
const getHydrated = (identifiers) => {
|
|
15
|
+
const { vecIdsU, vecIdsV, pointIds, pointNames } = identifiers;
|
|
16
|
+
const vecU = VectorConstructor.fromIdentifiers(vecIdsU);
|
|
17
|
+
const vecV = VectorConstructor.fromIdentifiers(vecIdsV);
|
|
18
|
+
const [nameP1, nameP2, nameP3] = pointNames;
|
|
19
|
+
const point1 = (() => {
|
|
20
|
+
const pointP = PointConstructor.fromIdentifiers(pointIds);
|
|
21
|
+
return new Point(nameP1, pointP.x, pointP.y);
|
|
22
|
+
})();
|
|
23
|
+
const point2 = vecU.getEndPoint(point1, nameP2);
|
|
24
|
+
const point3 = vecV.getEndPoint(point1, nameP3);
|
|
25
|
+
return {
|
|
26
|
+
vecU,
|
|
27
|
+
vecV,
|
|
28
|
+
[point1.name]: point1,
|
|
29
|
+
[point2.name]: point2,
|
|
30
|
+
[point3.name]: point3,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const getInstruction = (identifiers) => {
|
|
34
|
+
const { pointNames } = identifiers;
|
|
35
|
+
const { A, B, C } = getHydrated(identifiers);
|
|
36
|
+
return `Soient trois points :
|
|
37
|
+
|
|
38
|
+
${[A, B, C].map((point) => `- $${point.toTexWithCoords()}$`).join(`
|
|
39
|
+
|
|
40
|
+
`)}
|
|
41
|
+
|
|
42
|
+
Le point $${pointNames[0]}$ appartient-il au cercle $\\mathcal{C}$ de diamètre $[${pointNames[1]}${pointNames[2]}]$ ?`;
|
|
43
|
+
};
|
|
44
|
+
const getAnswerNode = (identifiers) => {
|
|
45
|
+
const { vecU, vecV } = getHydrated(identifiers);
|
|
46
|
+
const nodesU = [vecU.x, vecU.y];
|
|
47
|
+
const nodesV = [vecV.x, vecV.y];
|
|
48
|
+
return zip(nodesU, nodesV)
|
|
49
|
+
.map(([nodeUX, nodeVX]) => multiply(nodeUX, nodeVX))
|
|
50
|
+
.reduce((acc, nodeX) => add(acc, nodeX));
|
|
51
|
+
};
|
|
52
|
+
const getAnswer = (identifiers) => {
|
|
53
|
+
const answerNode = getAnswerNode(identifiers);
|
|
54
|
+
const isOrthogonal = answerNode.simplify().evaluate() === 0;
|
|
55
|
+
return ["Oui", "Non"][isOrthogonal ? 0 : 1];
|
|
56
|
+
};
|
|
57
|
+
const getHint = () => {
|
|
58
|
+
const [a, b] = ["a", "b"].map((letter) => `\\overrightarrow{${letter}}`);
|
|
59
|
+
return `Deux vecteurs $${a}$ et $${b}$ sont orthogonaux si et seulement si $${a} \\cdot ${b} = 0$.`;
|
|
60
|
+
};
|
|
61
|
+
const getCorrection = (identifiers) => {
|
|
62
|
+
const { pointNames } = identifiers;
|
|
63
|
+
const { vecU, vecV, A, B, C } = getHydrated(identifiers);
|
|
64
|
+
const pointsDict = { A, B, C };
|
|
65
|
+
const [point1, point2, point3] = pointNames.map((pointName) => pointsDict[pointName]);
|
|
66
|
+
function createVecComputation(pointStart, pointEnd) {
|
|
67
|
+
const nodeX = substract(pointEnd.x, pointStart.x);
|
|
68
|
+
const nodeY = substract(pointEnd.y, pointStart.y);
|
|
69
|
+
return new Vector(`${pointStart.name}${pointEnd.name}`, nodeX, nodeY);
|
|
70
|
+
}
|
|
71
|
+
const vecComputationU = createVecComputation(point1, point2);
|
|
72
|
+
const vecComputationV = createVecComputation(point1, point3);
|
|
73
|
+
const isOrthogonal = getAnswerNode(identifiers).simplify().evaluate() === 0;
|
|
74
|
+
const nodeScalarProduct = vecU.scalarProduct(vecV);
|
|
75
|
+
return `On calcule les coordonnées des vecteurs :
|
|
76
|
+
|
|
77
|
+
${zip([vecComputationU, vecComputationV], [vecU, vecV]).map(([vecComputation, vec]) => `
|
|
78
|
+
|
|
79
|
+
${alignTex([
|
|
80
|
+
[vecComputation.toTex(), "=", vecComputation.toCoords()],
|
|
81
|
+
["", "=", vec.toCoords()],
|
|
82
|
+
])}
|
|
83
|
+
|
|
84
|
+
`).join(`
|
|
85
|
+
|
|
86
|
+
`)}
|
|
87
|
+
|
|
88
|
+
${alignTex([
|
|
89
|
+
[
|
|
90
|
+
`${vecComputationU.toTex()} \\cdot ${vecComputationV.toTex()}`,
|
|
91
|
+
"=",
|
|
92
|
+
`${nodeScalarProduct.toTex()}`,
|
|
93
|
+
],
|
|
94
|
+
["", "=", `${nodeScalarProduct.simplify().toTex()}`],
|
|
95
|
+
])}
|
|
96
|
+
|
|
97
|
+
${(() => {
|
|
98
|
+
if (isOrthogonal) {
|
|
99
|
+
return `Les vecteurs $${vecComputationU.toTex()}$ et $${vecComputationV.toTex()}$ sont donc orthogonaux.
|
|
100
|
+
Le point $${point1.name}$ appartient donc au cercle de diamètre $[${point2.name}${point3.name}]$.`;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return `Les vecteurs $${vecComputationU.toTex()}$ et $${vecComputationV.toTex()}$ ne sont donc pas orthogonaux.
|
|
104
|
+
Le point $${point1.name}$ n'appartient donc pas au cercle de diamètre $[${point2.name}${point3.name}]$.`;
|
|
105
|
+
}
|
|
106
|
+
})()}`;
|
|
107
|
+
};
|
|
108
|
+
const getPropositions = (_, { answer, ...identifiers }) => {
|
|
109
|
+
const propositions = [];
|
|
110
|
+
const answerFromIdentifiers = getAnswer(identifiers);
|
|
111
|
+
["Oui", "Non"].forEach((strProp) => {
|
|
112
|
+
if (strProp === answerFromIdentifiers) {
|
|
113
|
+
addValidProp(propositions, strProp, "raw");
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
tryToAddWrongProp(propositions, strProp, "raw");
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return propositions;
|
|
120
|
+
};
|
|
121
|
+
const getScalarProductIsPointOnCircleQuestion = () => {
|
|
122
|
+
const isOrthogonal = coinFlip();
|
|
123
|
+
const { vecU, vecV } = randomVecs2(isOrthogonal);
|
|
124
|
+
const x = Math.ceil(-Math.max(vecU.x.evaluate(), vecV.x.evaluate()) / 2) +
|
|
125
|
+
randint(0, 3);
|
|
126
|
+
const y = Math.ceil(-Math.max(vecU.y.evaluate(), vecV.y.evaluate()) / 2) +
|
|
127
|
+
randint(0, 3);
|
|
128
|
+
const pointP = new Point("P", x, y);
|
|
129
|
+
const pointNames = shuffle(["A", "B", "C"]);
|
|
130
|
+
const identifiers = {
|
|
131
|
+
vecIdsU: vecU.toIdentifiers(),
|
|
132
|
+
vecIdsV: vecV.toIdentifiers(),
|
|
133
|
+
pointIds: pointP.toIdentifiers(),
|
|
134
|
+
pointNames,
|
|
135
|
+
};
|
|
136
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
137
|
+
};
|
|
138
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
139
|
+
return {
|
|
140
|
+
answer: getAnswer(identifiers, opts),
|
|
141
|
+
instruction: getInstruction(identifiers, opts),
|
|
142
|
+
keys: [],
|
|
143
|
+
answerFormat: "tex",
|
|
144
|
+
identifiers,
|
|
145
|
+
hint: getHint(identifiers, opts),
|
|
146
|
+
correction: getCorrection(identifiers, opts),
|
|
147
|
+
options: opts,
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export const scalarProductIsPointOnCircle = {
|
|
151
|
+
id: "scalarProductIsPointOnCircle",
|
|
152
|
+
connector: "=",
|
|
153
|
+
label: "Déterminer si un point appartient ou non à un cercle de diamètre donné",
|
|
154
|
+
isSingleStep: true,
|
|
155
|
+
generator: (nb) => getDistinctQuestions(() => getScalarProductIsPointOnCircleQuestion(), nb),
|
|
156
|
+
qcmTimer: 60,
|
|
157
|
+
freeTimer: 60,
|
|
158
|
+
getPropositions,
|
|
159
|
+
subject: "Mathématiques",
|
|
160
|
+
getInstruction,
|
|
161
|
+
getHint,
|
|
162
|
+
getCorrection,
|
|
163
|
+
getAnswer,
|
|
164
|
+
getQuestionFromIdentifiers,
|
|
165
|
+
hasHintAndCorrection: true,
|
|
166
|
+
answerType: "QCU",
|
|
167
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../../../math/geometry/point.js";
|
|
3
|
+
import { VectorIdentifiers } from "../../../../../../math/geometry/vector.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
vecIdsU: VectorIdentifiers;
|
|
6
|
+
vecIdsV: VectorIdentifiers;
|
|
7
|
+
pointIds: PointIdentifiers;
|
|
8
|
+
pointNames: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const scalarProductIsPointOnPerpendicularBisector: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=scalarProductIsPointOnPerpendicularBisector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductIsPointOnPerpendicularBisector.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAavC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAmNF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAAC,WAAW,CAsB3E,CAAC"}
|