math-exercises 3.0.171 → 3.0.172
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/derivation/variations/signVarTable3dDegree.js +38 -10
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +7 -4
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +2 -3
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.js +2 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +0 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +64 -60
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +173 -47
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +112 -46
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +60 -82
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +92 -6
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +18 -14
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +38 -4
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +77 -26
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +6 -7
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -16
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts +14 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +167 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +29 -56
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +7 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +8 -0
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +6 -6
- package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.js +116 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +11 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.js +112 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.js +176 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.js +94 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +162 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.js +133 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.js +211 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.js +113 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts +31 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.js +192 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +40 -11
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +172 -30
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +16 -2
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +0 -2
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/rationalVEA.js +7 -3
- package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varLineVEA.js +2 -1
- package/lib/exercises/vea/varSignTableVEA.d.ts +8 -0
- package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varSignTableVEA.js +8 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts +1 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/xTableLineVEA.js +1 -0
- package/lib/index.d.ts +79 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +3 -1
- package/lib/math/geometry/angle.d.ts +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +17 -0
- package/lib/math/geometry/segment.js +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +4 -0
- package/lib/math/probability/randomVariable.d.ts +2 -1
- package/lib/math/probability/randomVariable.d.ts.map +1 -1
- package/lib/math/probability/randomVariable.js +7 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts +1 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts.map +1 -1
- package/lib/math/utils/arithmetic/primeFactors.js +23 -9
- package/lib/tests/exosTest.d.ts.map +1 -1
- package/lib/tests/exosTest.js +2 -0
- package/lib/tests/pdfs/mdTableToLatexTabular.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +3 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +3 -0
- 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/equations/multiEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/notEqualNode.js +3 -0
- package/lib/tree/nodes/functions/absNode.d.ts +1 -0
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +7 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +7 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +7 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +7 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +7 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +7 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts +30 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/factorialNode.js +79 -0
- package/lib/tree/nodes/functions/functionNode.d.ts +2 -1
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +7 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +7 -0
- package/lib/tree/nodes/functions/logNode.d.ts +1 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +9 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +7 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +7 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +7 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +7 -0
- package/lib/tree/nodes/geometry/degree.d.ts +1 -0
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +7 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +7 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +7 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +7 -0
- 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 +7 -0
- 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 +2 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +7 -0
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +2 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +18 -2
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +7 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +7 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +7 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +7 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +7 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/trinomNode.js +7 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +7 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +7 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +7 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -0
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +7 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.js +3 -0
- package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
- package/lib/tree/utilities/nodeSimplifier.js +3 -0
- package/package.json +1 -1
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
// GetQuestionFromIdentifiers,
|
|
9
9
|
// GetAnswerTable,
|
|
10
10
|
// TableVEA,
|
|
11
|
+
// GeneratorOption,
|
|
12
|
+
// GeneratorOptionTarget,
|
|
13
|
+
// GeneratorOptionType,
|
|
11
14
|
// } from "../../../../exercises/exercise.js";
|
|
12
15
|
// import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
13
16
|
// import { varSignTableVEA } from "../../../../exercises/vea/varSignTableVEA.js";
|
|
@@ -128,7 +131,7 @@ export {};
|
|
|
128
131
|
// const signWords = a > 0 ? ["négative", "positive"] : ["positive", "négative"];
|
|
129
132
|
// return `On calcule $f'$ :
|
|
130
133
|
// $$
|
|
131
|
-
// f'(x) = ${poly.derivative().
|
|
134
|
+
// f'(x) = ${poly.derivative().simplify().toTex()}
|
|
132
135
|
// $$
|
|
133
136
|
// On détermine ensuite le signe de $f'(x)$ :
|
|
134
137
|
// ${alignTex([
|
|
@@ -153,36 +156,60 @@ export {};
|
|
|
153
156
|
// return handleVEAError(err);
|
|
154
157
|
// }
|
|
155
158
|
// };
|
|
156
|
-
// const getSignVarTableTrinomQuestion: QuestionGenerator<Identifiers> = (
|
|
159
|
+
// const getSignVarTableTrinomQuestion: QuestionGenerator<Identifiers, Options> = (
|
|
160
|
+
// opts,
|
|
161
|
+
// ) => {
|
|
157
162
|
// const trinom = TrinomConstructor.randomNiceRoots();
|
|
158
163
|
// const identifiers: Identifiers = {
|
|
159
164
|
// a: trinom.a,
|
|
160
165
|
// b: trinom.b,
|
|
161
166
|
// c: trinom.c,
|
|
162
167
|
// };
|
|
163
|
-
// return getQuestionFromIdentifiers(identifiers);
|
|
168
|
+
// return getQuestionFromIdentifiers(identifiers, opts);
|
|
164
169
|
// };
|
|
165
|
-
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<
|
|
166
|
-
//
|
|
167
|
-
//
|
|
170
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<
|
|
171
|
+
// Identifiers,
|
|
172
|
+
// Options
|
|
173
|
+
// > = (identifiers, opts) => {
|
|
168
174
|
// return {
|
|
169
175
|
// answerTable: getAnswerTable(identifiers),
|
|
170
|
-
// instruction: getInstruction(identifiers),
|
|
176
|
+
// instruction: getInstruction(identifiers, opts),
|
|
171
177
|
// keys: getKeys(identifiers),
|
|
172
178
|
// answerFormat: "tex",
|
|
173
179
|
// identifiers,
|
|
174
180
|
// hint: getHint(identifiers),
|
|
175
|
-
// correction: getCorrection(identifiers),
|
|
181
|
+
// correction: getCorrection(identifiers, opts),
|
|
176
182
|
// initTable: [
|
|
177
183
|
// ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", ""],
|
|
178
184
|
// ["$f'(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
179
185
|
// ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
180
|
-
// [
|
|
186
|
+
// [
|
|
187
|
+
// "$f(x)$",
|
|
188
|
+
// "\\ ",
|
|
189
|
+
// "",
|
|
190
|
+
// opts?.askImages ? "" : "\\ ",
|
|
191
|
+
// "",
|
|
192
|
+
// opts?.askImages ? "" : "\\ ",
|
|
193
|
+
// "",
|
|
194
|
+
// "\\ ",
|
|
195
|
+
// ],
|
|
181
196
|
// ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
182
197
|
// ],
|
|
183
198
|
// };
|
|
184
199
|
// };
|
|
185
|
-
//
|
|
200
|
+
// type Options = {
|
|
201
|
+
// askImages: boolean;
|
|
202
|
+
// };
|
|
203
|
+
// const options: GeneratorOption[] = [
|
|
204
|
+
// {
|
|
205
|
+
// id: "askImages",
|
|
206
|
+
// label: "Demander les ordonnées des extrema locaux",
|
|
207
|
+
// target: GeneratorOptionTarget.answer,
|
|
208
|
+
// type: GeneratorOptionType.checkbox,
|
|
209
|
+
// defaultValue: false,
|
|
210
|
+
// },
|
|
211
|
+
// ];
|
|
212
|
+
// export const signVarTable3dDegree: Exercise<Identifiers, Options> = {
|
|
186
213
|
// id: "signVarTable3dDegree",
|
|
187
214
|
// label:
|
|
188
215
|
// "Dresser le tableau de signes de $f'$ et de variations de $f$ pour une fonction polynôme de degré trois",
|
|
@@ -200,4 +227,5 @@ export {};
|
|
|
200
227
|
// getQuestionFromIdentifiers,
|
|
201
228
|
// hasHintAndCorrection: true,
|
|
202
229
|
// answerType: "signVarTable",
|
|
230
|
+
// options,
|
|
203
231
|
// };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signVarTableFromDerivativeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"signVarTableFromDerivativeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AA4JF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAmBjE,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { signLineVEA } from "../../../../exercises/vea/signLineVEA.js";
|
|
3
|
+
import { varLineVEA } from "../../../../exercises/vea/varLineVEA.js";
|
|
4
|
+
import { xTableLineVEA } from "../../../../exercises/vea/xTableLineVEA.js";
|
|
2
5
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
3
6
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
4
7
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -87,9 +90,9 @@ const getKeys = () => {
|
|
|
87
90
|
};
|
|
88
91
|
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
89
92
|
try {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
return (xTableLineVEA(ans[0], answerTable[0]) &&
|
|
94
|
+
signLineVEA(ans[1], answerTable[1]) &&
|
|
95
|
+
varLineVEA(ans.slice(2), answerTable.slice(2)));
|
|
93
96
|
}
|
|
94
97
|
catch (err) {
|
|
95
98
|
return handleVEAError(err);
|
|
@@ -120,7 +123,7 @@ const getVarSignTableFromGraphQuestion = () => {
|
|
|
120
123
|
["$x$", "-\\infty", "\\ ", "", "\\ ", "", "\\ ", "+\\infty"],
|
|
121
124
|
["$f'(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
122
125
|
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
123
|
-
["$f(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
126
|
+
["$f(x)$", "\\ ", "", "\\ ", "", "\\ ", "", "\\ "],
|
|
124
127
|
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
125
128
|
];
|
|
126
129
|
const identifiers = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signVarTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"signVarTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAkLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { varSignTableVEA } from "../../../../exercises/vea/varSignTableVEA.js";
|
|
2
3
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
3
4
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -113,9 +114,7 @@ const getKeys = () => {
|
|
|
113
114
|
};
|
|
114
115
|
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
115
116
|
try {
|
|
116
|
-
return ans
|
|
117
|
-
return cell === answerTable[i][j];
|
|
118
|
-
}));
|
|
117
|
+
return varSignTableVEA(ans, answerTable);
|
|
119
118
|
}
|
|
120
119
|
catch (err) {
|
|
121
120
|
return handleVEAError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partialVarTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/partialVarTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"partialVarTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/partialVarTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAmB1D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { varTableVEA } from "../../../../exercises/vea/varTableVEA.js";
|
|
2
3
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
3
4
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -111,7 +112,7 @@ const getKeys = () => {
|
|
|
111
112
|
};
|
|
112
113
|
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
113
114
|
try {
|
|
114
|
-
return ans
|
|
115
|
+
return varTableVEA(ans, answerTable);
|
|
115
116
|
}
|
|
116
117
|
catch (err) {
|
|
117
118
|
return handleVEAError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"varTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAwKF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAmBnD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { varTableVEA } from "../../../../exercises/vea/varTableVEA.js";
|
|
2
3
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
3
4
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -106,7 +107,7 @@ const getKeys = () => {
|
|
|
106
107
|
};
|
|
107
108
|
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
108
109
|
try {
|
|
109
|
-
return ans
|
|
110
|
+
return varTableVEA(ans, answerTable);
|
|
110
111
|
}
|
|
111
112
|
catch (err) {
|
|
112
113
|
return handleVEAError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varTableFromSentences.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromSentences.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"varTableFromSentences.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromSentences.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAsLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { varTableVEA } from "../../../../exercises/vea/varTableVEA.js";
|
|
2
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
3
4
|
import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
4
5
|
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
@@ -98,7 +99,7 @@ const getKeys = () => {
|
|
|
98
99
|
};
|
|
99
100
|
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
100
101
|
try {
|
|
101
|
-
return ans
|
|
102
|
+
return varTableVEA(ans, answerTable);
|
|
102
103
|
}
|
|
103
104
|
catch (err) {
|
|
104
105
|
return handleVEAError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleCenterAndRadiusFromEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,oBAAoB,EACrB,MAAM,yCAAyC,CAAC;AAWjD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;
|
|
1
|
+
{"version":3,"file":"circleCenterAndRadiusFromEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,oBAAoB,EACrB,MAAM,yCAAyC,CAAC;AAWjD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAWF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB1E,CAAC"}
|
|
@@ -29,7 +29,6 @@ const getPropositions = (n, { answer, isAskingRadius }) => {
|
|
|
29
29
|
const getAnswer = (identifiers) => {
|
|
30
30
|
const { equationIds, isAskingRadius } = identifiers;
|
|
31
31
|
const equation = reifyAlgebraic(equationIds);
|
|
32
|
-
console.log(equation.toTex());
|
|
33
32
|
if (isAskingRadius)
|
|
34
33
|
return sqrt(equation.rightChild).simplify().toTex();
|
|
35
34
|
const left = equation.leftChild;
|
|
@@ -112,7 +111,6 @@ const getCircleCenterAndRadiusFromEquationQuestion = (opts) => {
|
|
|
112
111
|
? randint(1, 10).toTree()
|
|
113
112
|
: SquareRootConstructor.randomIrreductible(20).toTree();
|
|
114
113
|
const eq = CircleConstructor.cartesianEquation(center, radius);
|
|
115
|
-
console.log("rad ", radius.toTex(), "eq ", eq.toTex());
|
|
116
114
|
const identifiers = {
|
|
117
115
|
isAskingRadius,
|
|
118
116
|
equationIds: eq.toIdentifiers(),
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductAlKashiAngle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"scalarProductAlKashiAngle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAyBnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA8SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAmB3D,CAAC"}
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
-
import { GeogebraConstructor } from "../../../../../../geogebra/geogebraConstructor.js";
|
|
4
3
|
import { TriangleConstructor, } from "../../../../../../math/geometry/triangles/triangle.js";
|
|
5
4
|
import { randfloat } from "../../../../../../math/utils/random/randfloat.js";
|
|
6
5
|
import { randint } from "../../../../../../math/utils/random/randint.js";
|
|
@@ -16,7 +15,12 @@ import { parseAlgebraic } from "../../../../../../tree/parsers/latexParser.js";
|
|
|
16
15
|
import { probaFlip } from "../../../../../../utils/alea/probaFlip.js";
|
|
17
16
|
import { arrayRotation } from "../../../../../../utils/arrays/rotation.js";
|
|
18
17
|
import { handleVEAError } from "../../../../../../utils/errors/handleVEAError.js";
|
|
18
|
+
import { alignTex } from "../../../../../../utils/latex/alignTex.js";
|
|
19
19
|
const precision = 2;
|
|
20
|
+
const strForKeyIdDegree = "^\\circ";
|
|
21
|
+
const texWithDegreesUnit = (strUnitless) => {
|
|
22
|
+
return `${strUnitless}${strForKeyIdDegree}`;
|
|
23
|
+
};
|
|
20
24
|
const getHydrated = (identifiers) => {
|
|
21
25
|
const { triangleIds, indexAngle } = identifiers;
|
|
22
26
|
const triangle = TriangleConstructor.fromIdentifiers(triangleIds);
|
|
@@ -35,33 +39,30 @@ const getInstruction = (identifiers) => {
|
|
|
35
39
|
|
|
36
40
|
${triangle.sides.map((segment) => `- $${segment.toInsideName()} = ${segment.getLength().frenchify()}$`).join(`
|
|
37
41
|
|
|
38
|
-
`)}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Donner une valeur approchée en degrés avec $${precision}$ décimales.`;
|
|
42
|
+
`)}
|
|
43
|
+
|
|
44
|
+
Donner une mesure en degrés (arrondie à deux décimales) de l’angle $${triangle.angles[indexAngle].toTexMini()}$.`;
|
|
42
45
|
};
|
|
43
46
|
const getAnswerStuff = (identifiers) => {
|
|
44
47
|
const { sides } = getHydrated(identifiers);
|
|
45
48
|
const nodeCosAngle = frac(substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), power(sides[0].getLengthNode(), 2)), multiply(2, multiply(sides[1].getLengthNode(), sides[2].getLengthNode())));
|
|
46
49
|
const nodeAngleInRadians = arccos(nodeCosAngle);
|
|
47
50
|
const nodeAngleInDegrees = multiply(nodeAngleInRadians, frac(180, PiNode));
|
|
51
|
+
const angleInDegreesRounded = round(nodeAngleInDegrees.evaluate(), precision);
|
|
48
52
|
return {
|
|
49
53
|
nodeCosAngle,
|
|
50
54
|
nodeAngleInRadians,
|
|
51
55
|
nodeAngleInDegrees,
|
|
56
|
+
angleInDegreesRounded,
|
|
52
57
|
};
|
|
53
58
|
};
|
|
54
59
|
const getAnswerNode = (identifiers) => {
|
|
55
|
-
return getAnswerStuff(identifiers).
|
|
60
|
+
return getAnswerStuff(identifiers).angleInDegreesRounded.toTree();
|
|
56
61
|
};
|
|
57
62
|
const getAnswer = (identifiers) => {
|
|
58
|
-
return
|
|
63
|
+
return texWithDegreesUnit(getAnswerNode(identifiers).toTex());
|
|
59
64
|
};
|
|
60
65
|
const getHint = (identifiers) => {
|
|
61
|
-
const { angleNames } = getHydrated(identifiers);
|
|
62
|
-
return `Applique le théorème d'Al Kashi dans le triangle $ABC$ pour l'angle $${angleNames[0]}$.`;
|
|
63
|
-
};
|
|
64
|
-
const getCorrection = (identifiers) => {
|
|
65
66
|
const { indexAngle } = identifiers;
|
|
66
67
|
const { sides, angleNames } = getHydrated(identifiers);
|
|
67
68
|
const sideNames = arrayRotation(sides, indexAngle)
|
|
@@ -73,66 +74,65 @@ const getCorrection = (identifiers) => {
|
|
|
73
74
|
BC: "a",
|
|
74
75
|
}[name];
|
|
75
76
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
return `Applique le théorème d'Al-Kashi dans le triangle $ABC$ pour l'angle $${angleNames[0]}$.
|
|
78
|
+
|
|
79
|
+
Rappel:
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
Si on utilise les notations suivantes :
|
|
81
82
|
|
|
82
83
|
$$
|
|
83
84
|
a \\ = \\ BC \\ ; \\ b \\ = \\ AC \\ ; \\ c \\ = \\ AB \\
|
|
84
85
|
$$
|
|
85
86
|
|
|
87
|
+
le théorème d'Al-Kashi s'écrit :
|
|
88
|
+
|
|
86
89
|
$$
|
|
87
90
|
${sideNames[0]}^2 = ${sideNames[1]}^2 + ${sideNames[2]}^2 - 2 ${sideNames[1]} ${sideNames[2]} \\cos(${angleNames[0]})
|
|
88
|
-
|
|
91
|
+
$$`;
|
|
92
|
+
};
|
|
93
|
+
const getCorrection = (identifiers) => {
|
|
94
|
+
const { indexAngle } = identifiers;
|
|
95
|
+
const { sides, angleNames } = getHydrated(identifiers);
|
|
96
|
+
const sideNames = arrayRotation(sides, indexAngle)
|
|
97
|
+
.map((segment) => segment.toInsideName())
|
|
98
|
+
.map((name) => {
|
|
99
|
+
return {
|
|
100
|
+
AB: "c",
|
|
101
|
+
AC: "b",
|
|
102
|
+
BC: "a",
|
|
103
|
+
}[name];
|
|
104
|
+
});
|
|
105
|
+
const nodeCosAngleWithVars = frac(substract(add(power(sideNames[1], 2), power(sideNames[2], 2)), power(sideNames[0], 2)), multiply(2, multiply(sideNames[1], sideNames[2])));
|
|
106
|
+
const nodeCosAngleWithValues = getAnswerStuff(identifiers).nodeCosAngle;
|
|
107
|
+
return `On applique le théorème d'Al-Kashi dans le triangle $ABC$.
|
|
108
|
+
|
|
109
|
+
On utilise les notations suivantes :
|
|
89
110
|
|
|
90
111
|
$$
|
|
91
|
-
\\
|
|
112
|
+
a \\ = \\ BC \\ ; \\ b \\ = \\ AC \\ ; \\ c \\ = \\ AB \\
|
|
92
113
|
$$
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
Avec ces notations, d'après le théorème d'Al-Kashi :
|
|
95
116
|
|
|
96
117
|
$$
|
|
97
|
-
${
|
|
118
|
+
${sideNames[0]}^2 = ${sideNames[1]}^2 + ${sideNames[2]}^2 - 2 ${sideNames[1]} ${sideNames[2]} \\cos(${angleNames[0]})
|
|
98
119
|
$$
|
|
99
120
|
|
|
100
|
-
|
|
121
|
+
On a donc
|
|
101
122
|
|
|
102
|
-
|
|
103
|
-
${angleNames[0]}
|
|
104
|
-
|
|
123
|
+
${alignTex([
|
|
124
|
+
[`\\cos(${angleNames[0]})`, "=", `${nodeCosAngleWithVars.toTex()}`],
|
|
125
|
+
["", "=", `${nodeCosAngleWithValues.toTex()}`],
|
|
126
|
+
])}
|
|
105
127
|
|
|
106
|
-
|
|
128
|
+
À l’aide de la calculatrice réglée en degrés, on calcule alors $\\cos^{-1}$ et, comme d'habitude, on arrondit à la toute fin :
|
|
107
129
|
|
|
108
130
|
$$
|
|
109
|
-
${angleNames[0]} \\approx ${getAnswer(identifiers)}
|
|
131
|
+
${angleNames[0]} \\approx ${getAnswer(identifiers)}
|
|
110
132
|
$$
|
|
111
133
|
|
|
112
134
|
`;
|
|
113
135
|
};
|
|
114
|
-
//too helpful for student ?
|
|
115
|
-
const getGGBOptions = (identifiers) => {
|
|
116
|
-
const { triangle } = getHydrated(identifiers);
|
|
117
|
-
// const { indexAngle } = identifiers;
|
|
118
|
-
// const angle = arrayRotation(triangle.angles, indexAngle)[0];
|
|
119
|
-
const ggb = new GeogebraConstructor({
|
|
120
|
-
commands: [
|
|
121
|
-
//triangle
|
|
122
|
-
...triangle.commands,
|
|
123
|
-
// //angle
|
|
124
|
-
// `Ang = Angle(${angle.points
|
|
125
|
-
// .reverse()
|
|
126
|
-
// .map((point) => point.name)
|
|
127
|
-
// .join(",")})`,
|
|
128
|
-
// `ShowLabel(Ang, false)`,
|
|
129
|
-
],
|
|
130
|
-
hideAxes: true,
|
|
131
|
-
});
|
|
132
|
-
return ggb.getOptions({
|
|
133
|
-
coords: ggb.getCoordsForPoints(triangle.points),
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
136
|
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
137
137
|
const propositions = [];
|
|
138
138
|
addValidProp(propositions, answer);
|
|
@@ -143,19 +143,19 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
143
143
|
{
|
|
144
144
|
const valueCos = answerStuff.nodeCosAngle.evaluate();
|
|
145
145
|
if (valueCos > 0) {
|
|
146
|
-
tryToAddWrongProp(propositions, round(valueCos, precision).frenchify());
|
|
146
|
+
tryToAddWrongProp(propositions, texWithDegreesUnit(round(valueCos, precision).frenchify()));
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
//student: radians instead of degrees
|
|
150
150
|
{
|
|
151
|
-
tryToAddWrongProp(propositions, round(answerStuff.nodeAngleInRadians.evaluate(), precision).frenchify());
|
|
151
|
+
tryToAddWrongProp(propositions, texWithDegreesUnit(round(answerStuff.nodeAngleInRadians.evaluate(), precision).frenchify()));
|
|
152
152
|
}
|
|
153
153
|
//student: sign error when getting cos
|
|
154
154
|
{
|
|
155
155
|
const nodeCosAngle = frac(substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), power(sides[0].getLengthNode(), 2)), multiply(-2, multiply(sides[1].getLengthNode(), sides[2].getLengthNode())));
|
|
156
156
|
const nodeAngleInRadians = arccos(nodeCosAngle);
|
|
157
157
|
const nodeAngleInDegrees = multiply(nodeAngleInRadians, frac(180, PiNode));
|
|
158
|
-
tryToAddWrongProp(propositions, round(nodeAngleInDegrees.evaluate(), precision).frenchify());
|
|
158
|
+
tryToAddWrongProp(propositions, texWithDegreesUnit(round(nodeAngleInDegrees.evaluate(), precision).frenchify()));
|
|
159
159
|
}
|
|
160
160
|
//student: wrong angle
|
|
161
161
|
{
|
|
@@ -180,26 +180,32 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
180
180
|
const identifiersWrong = Object.assign({}, identifiers, {
|
|
181
181
|
indexAngle: indexAngleWrong,
|
|
182
182
|
});
|
|
183
|
-
return
|
|
183
|
+
return getAnswerStuff(identifiersWrong).nodeAngleInDegrees.evaluate();
|
|
184
184
|
}
|
|
185
185
|
})();
|
|
186
186
|
[...Array(4).keys()].forEach(() => {
|
|
187
187
|
const valueAnswerOffsetted = value + randfloat(-7, 7, 2, [0]);
|
|
188
|
-
tryToAddWrongProp(propositions, round(valueAnswerOffsetted, precision).frenchify());
|
|
188
|
+
tryToAddWrongProp(propositions, texWithDegreesUnit(round(valueAnswerOffsetted, precision).frenchify()));
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
propWhile(propositions, n, () => {
|
|
192
|
-
tryToAddWrongProp(propositions, randfloat(0, 180, 2, [0, 180]).frenchify());
|
|
192
|
+
tryToAddWrongProp(propositions, texWithDegreesUnit(randfloat(0, 180, 2, [0, 180]).frenchify()));
|
|
193
193
|
});
|
|
194
194
|
return shuffleProps(propositions, n);
|
|
195
195
|
};
|
|
196
196
|
const getKeys = () => {
|
|
197
|
-
return [];
|
|
197
|
+
return ["degree"];
|
|
198
198
|
};
|
|
199
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
199
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
200
|
+
const strForKeyIdDegreeReceivedFromTests = "^\\circ";
|
|
201
|
+
const strForKeyIdDegreeReceivedFromFront = "^{\\circ}"; //different from strForKeyIdDegreeSent: "^\\circ"
|
|
202
|
+
const ansRefined = ans
|
|
203
|
+
.replace(strForKeyIdDegreeReceivedFromTests, "")
|
|
204
|
+
.replace(strForKeyIdDegreeReceivedFromFront, "");
|
|
200
205
|
try {
|
|
201
|
-
const
|
|
202
|
-
|
|
206
|
+
const nodeAns = parseAlgebraic(ansRefined);
|
|
207
|
+
const nodeAnswer = getAnswerNode(identifiers);
|
|
208
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
203
209
|
}
|
|
204
210
|
catch (err) {
|
|
205
211
|
return handleVEAError(err);
|
|
@@ -223,13 +229,12 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
223
229
|
identifiers,
|
|
224
230
|
hint: getHint(identifiers),
|
|
225
231
|
correction: getCorrection(identifiers),
|
|
226
|
-
ggbOptions: getGGBOptions(identifiers),
|
|
227
232
|
};
|
|
228
233
|
};
|
|
229
234
|
export const scalarProductAlKashiAngle = {
|
|
230
235
|
id: "scalarProductAlKashiAngle",
|
|
231
236
|
connector: "=",
|
|
232
|
-
label: "Connaissant les longueurs des trois côtés d'un triangle, calculer un angle",
|
|
237
|
+
label: "Connaissant les longueurs des trois côtés d'un triangle, calculer un angle grâce au théorème d’Al-Kashi",
|
|
233
238
|
isSingleStep: true,
|
|
234
239
|
generator: (nb, opts) => getDistinctQuestions(() => getScalarProductAlKashiAngleQuestion(opts), nb),
|
|
235
240
|
qcmTimer: 60,
|
|
@@ -243,5 +248,4 @@ export const scalarProductAlKashiAngle = {
|
|
|
243
248
|
hasHintAndCorrection: true,
|
|
244
249
|
getAnswer,
|
|
245
250
|
getQuestionFromIdentifiers,
|
|
246
|
-
hasGeogebra: true,
|
|
247
251
|
};
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
|
2
2
|
import { PointIdentifiers } from "../../../../../../math/geometry/point.js";
|
|
3
3
|
import { TriangleIdentifiers } from "../../../../../../math/geometry/triangles/triangle.js";
|
|
4
4
|
type Identifiers = {
|
|
5
|
+
sectorOfPointH: string;
|
|
5
6
|
triangleIds: TriangleIdentifiers;
|
|
6
7
|
pointIdsH: PointIdentifiers;
|
|
7
8
|
};
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductAlKashiBH.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"scalarProductAlKashiBH.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAwBnD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAopBF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAuBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BjE,CAAC"}
|