math-exercises 2.2.55 → 2.2.57
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/calcul/proportionality/index.d.ts +1 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +91 -0
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +0 -1
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
- package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts +10 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +0 -1
- package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/index.js +1 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
- package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
- package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
- package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
- package/lib/exercises/math/percent/index.d.ts +0 -1
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +0 -1
- package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
- package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/binomialInequation.js +159 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
- package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/index.js +20 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
- package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
- package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
- package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
- package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
- package/lib/exercises/math/probaStat/index.d.ts +1 -3
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -3
- package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
- package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +4 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -5
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +0 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
- package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
- package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
- package/lib/exercises/pc/mole/molarMass.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
- package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
- package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +11 -4
- package/lib/index.d.ts +94 -26
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.d.ts +5 -1
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +5 -0
- package/lib/math/geometry/line.d.ts +23 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +53 -2
- package/lib/math/geometry/point.d.ts +15 -13
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +28 -12
- package/lib/math/geometry/segment.d.ts +11 -1
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +12 -0
- package/lib/math/geometry/triangle.d.ts +67 -0
- package/lib/math/geometry/triangle.d.ts.map +1 -0
- package/lib/math/geometry/triangle.js +227 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +0 -2
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +5 -0
- package/lib/math/polynomials/generalTrinom.d.ts +2 -2
- package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
- package/lib/math/probability/binomial.d.ts +10 -0
- package/lib/math/probability/binomial.d.ts.map +1 -0
- package/lib/math/probability/binomial.js +30 -0
- package/lib/math/sets/intervals/intervals.d.ts +1 -1
- package/lib/math/systems/generalSystem.d.ts +11 -0
- package/lib/math/systems/generalSystem.d.ts.map +1 -0
- package/lib/math/systems/generalSystem.js +79 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -4
- package/lib/server.js +0 -2
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- 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/nodeConstructor.d.ts +4 -3
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +20 -8
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -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 +2 -4
- package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +1 -0
- package/lib/utils/alea/random.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pointImageFromTranslation = void 0;
|
|
4
|
+
const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
+
const approxEqual_1 = require("../../../../geogebra/parsers/approxEqual");
|
|
8
|
+
const ggbPointToCoords_1 = require("../../../../geogebra/parsers/ggbPointToCoords");
|
|
9
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
10
|
+
const vector_1 = require("../../../../math/geometry/vector");
|
|
11
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
12
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
13
|
+
const getInstruction = (identifiers) => {
|
|
14
|
+
return `Placer l'image du point $${identifiers.startPoint}$ par la translation qui transforme $${identifiers.translationPoints[0]}$ en $${identifiers.translationPoints[1]}$.`;
|
|
15
|
+
};
|
|
16
|
+
const getEndPoint = (identifiers) => {
|
|
17
|
+
const translationPoints = [
|
|
18
|
+
point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.translationPoints[0])),
|
|
19
|
+
point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.translationPoints[1])),
|
|
20
|
+
];
|
|
21
|
+
const vector = vector_1.VectorConstructor.fromPoints(translationPoints[0], translationPoints[1]);
|
|
22
|
+
const startPoint = point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.startPoint));
|
|
23
|
+
const end = vector.getEndPoint(startPoint, "M");
|
|
24
|
+
return end;
|
|
25
|
+
};
|
|
26
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
27
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
28
|
+
const getGGBAnswer = (identifiers) => {
|
|
29
|
+
return getEndPoint(identifiers).toGGBCommand();
|
|
30
|
+
};
|
|
31
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
32
|
+
const points = identifiers.points.map((p) => point_1.PointConstructor.fromIdentifiers(p));
|
|
33
|
+
const end = getEndPoint(identifiers);
|
|
34
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
35
|
+
hideAxes: true,
|
|
36
|
+
isGridSimple: true,
|
|
37
|
+
customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({ point: true }),
|
|
38
|
+
commands: points.flatMap((p) => p.toGGBCommand({
|
|
39
|
+
size: 3,
|
|
40
|
+
style: 1,
|
|
41
|
+
})),
|
|
42
|
+
});
|
|
43
|
+
const [endX, endY] = [end.x.evaluate(), end.y.evaluate()];
|
|
44
|
+
return ggb.getOptions({
|
|
45
|
+
coords: [
|
|
46
|
+
Math.min(endX - 2, -7),
|
|
47
|
+
Math.max(endX + 2, 7),
|
|
48
|
+
Math.min(endY - 2, -7),
|
|
49
|
+
Math.max(endY + 2, 7),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
54
|
+
const studentAns = ans.filter((c) => !["A", "B", "C", "D"].includes(c[0]));
|
|
55
|
+
if (studentAns.length !== 1)
|
|
56
|
+
return false;
|
|
57
|
+
const coords = (0, ggbPointToCoords_1.ggbPointToCoords)(studentAns[0].split("=")[1]);
|
|
58
|
+
const coordsAns = (0, ggbPointToCoords_1.ggbPointToCoords)(ggbAnswer[0].split("=")[1]);
|
|
59
|
+
return ((0, approxEqual_1.approxEqual)(coords.x, coordsAns.x, 0.2) &&
|
|
60
|
+
(0, approxEqual_1.approxEqual)(coords.y, coordsAns.y, 0.2));
|
|
61
|
+
};
|
|
62
|
+
const getPointImageFromTranslationQuestion = () => {
|
|
63
|
+
const points = [];
|
|
64
|
+
for (let i = 0; i < 4; i++) {
|
|
65
|
+
const name = String.fromCharCode(65 + i);
|
|
66
|
+
const newPoint = (0, doWhile_1.doWhile)(() => point_1.PointConstructor.random(name, -4, 5), (p) => points.some((p2) => p.equals(p2)));
|
|
67
|
+
points.push(newPoint);
|
|
68
|
+
}
|
|
69
|
+
const startPoint = (0, random_1.random)(points).name;
|
|
70
|
+
const translationPoints = [
|
|
71
|
+
(0, random_1.random)(points.filter((p) => p.name !== startPoint)).name,
|
|
72
|
+
];
|
|
73
|
+
translationPoints.push((0, random_1.random)(points.filter((p) => p.name !== translationPoints[0])).name);
|
|
74
|
+
const identifiers = {
|
|
75
|
+
points: points.map((p) => p.toIdentifiers()),
|
|
76
|
+
startPoint,
|
|
77
|
+
translationPoints,
|
|
78
|
+
};
|
|
79
|
+
const question = {
|
|
80
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
81
|
+
instruction: getInstruction(identifiers),
|
|
82
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
83
|
+
identifiers,
|
|
84
|
+
// hint: getHint(identifiers),
|
|
85
|
+
// correction: getCorrection(identifiers),
|
|
86
|
+
};
|
|
87
|
+
return question;
|
|
88
|
+
};
|
|
89
|
+
exports.pointImageFromTranslation = {
|
|
90
|
+
id: "pointImageFromTranslation",
|
|
91
|
+
label: "undefined",
|
|
92
|
+
isSingleStep: true,
|
|
93
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPointImageFromTranslationQuestion, nb),
|
|
94
|
+
ggbTimer: 60,
|
|
95
|
+
isGGBAnswerValid,
|
|
96
|
+
subject: "Mathématiques",
|
|
97
|
+
// getHint,
|
|
98
|
+
// getCorrection,
|
|
99
|
+
getGGBAnswer,
|
|
100
|
+
getStudentGGBOptions,
|
|
101
|
+
answerType: "GGB",
|
|
102
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
4
|
sideA: string;
|
|
4
5
|
sideB: string;
|
|
5
6
|
sideC: string;
|
|
7
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
6
8
|
};
|
|
7
9
|
export declare const pythagore: Exercise<Identifiers>;
|
|
8
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAStC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAiEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pythagore = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const
|
|
6
|
+
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const lengthNode_1 = require("../../../../tree/nodes/geometry/lengthNode");
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
@@ -15,7 +15,7 @@ const getPythagore = () => {
|
|
|
15
15
|
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
16
16
|
for (let i = 0; i < 3; i++)
|
|
17
17
|
vertices.push(String.fromCharCode(code + i));
|
|
18
|
-
const triangle =
|
|
18
|
+
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
19
19
|
minRapport: 0.7,
|
|
20
20
|
maxRapport: 1.3,
|
|
21
21
|
names: vertices,
|
|
@@ -23,6 +23,7 @@ const getPythagore = () => {
|
|
|
23
23
|
const sideA = triangle.getSideAName();
|
|
24
24
|
const sideB = triangle.getSideBName();
|
|
25
25
|
const sideC = triangle.getSideCName();
|
|
26
|
+
const triangleIdentifiers = triangle.toIdentifiers();
|
|
26
27
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
27
28
|
commands: triangle.generateCommands({}),
|
|
28
29
|
hideAxes: true,
|
|
@@ -37,7 +38,7 @@ const getPythagore = () => {
|
|
|
37
38
|
coords: triangle.generateCoords(),
|
|
38
39
|
}),
|
|
39
40
|
answerFormat: "tex",
|
|
40
|
-
identifiers: { sideA, sideB, sideC },
|
|
41
|
+
identifiers: { sideA, sideB, sideC, triangleIdentifiers },
|
|
41
42
|
};
|
|
42
43
|
return question;
|
|
43
44
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
4
|
square: number;
|
|
4
5
|
sideLengths: number[];
|
|
6
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
5
7
|
};
|
|
6
8
|
export declare const pythagoreCalcul: Exercise<Identifiers>;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.pythagoreCalcul = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
7
|
+
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
8
8
|
const real_1 = require("../../../../math/numbers/reals/real");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
10
|
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
@@ -17,7 +17,7 @@ const getPythagoreCalcul = () => {
|
|
|
17
17
|
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
18
18
|
for (let i = 0; i < 3; i++)
|
|
19
19
|
vertices.push(String.fromCharCode(code + i));
|
|
20
|
-
const triangle =
|
|
20
|
+
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
21
21
|
minRapport: 0.7,
|
|
22
22
|
maxRapport: 1.3,
|
|
23
23
|
names: vertices,
|
|
@@ -59,6 +59,7 @@ const getPythagoreCalcul = () => {
|
|
|
59
59
|
hideAxes: true,
|
|
60
60
|
hideGrid: true,
|
|
61
61
|
});
|
|
62
|
+
const triangleIdentifiers = triangle.toIdentifiers();
|
|
62
63
|
answer = answer + "";
|
|
63
64
|
const question = {
|
|
64
65
|
instruction: `Dans le triangle $${triangle.getTriangleName()}$ rectangle en $${triangle.getRightAngle()}$, on sait que $${sides[randoms[0]]} = ${sideLengths[randoms[0]]}$ et que $${sides[randoms[1]]} = ${sideLengths[randoms[1]]}$. Calculer la longueur exacte $${sides[randoms[2]]}$.`,
|
|
@@ -68,7 +69,7 @@ const getPythagoreCalcul = () => {
|
|
|
68
69
|
coords: triangle.generateCoords(),
|
|
69
70
|
}),
|
|
70
71
|
answerFormat: "tex",
|
|
71
|
-
identifiers: { square, sideLengths },
|
|
72
|
+
identifiers: { square, sideLengths, triangleIdentifiers },
|
|
72
73
|
};
|
|
73
74
|
return question;
|
|
74
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA8FxD,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./thales"), exports);
|
|
18
|
+
// export * from "./thalesCalculOld";
|
|
18
19
|
__exportStar(require("./thalesCalcul"), exports);
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
2
|
type Identifiers = {
|
|
3
3
|
vertices: string[];
|
|
4
|
+
xA: number;
|
|
5
|
+
yA: number;
|
|
6
|
+
xB: number;
|
|
7
|
+
yB: number;
|
|
8
|
+
xC: number;
|
|
9
|
+
yC: number;
|
|
10
|
+
factor: number;
|
|
4
11
|
};
|
|
5
12
|
export declare const thales: Exercise<Identifiers>;
|
|
6
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2IF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,CAcxC,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point";
|
|
3
|
+
import { SegmentIdentifiers } from "../../../../math/geometry/segment";
|
|
4
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
2
5
|
type Identifiers = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
7
|
+
insidePointsIdentifiers: PointIdentifiers[];
|
|
8
|
+
segmentAsked: SegmentIdentifiers;
|
|
9
|
+
isPapillon: boolean;
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
type Options = {
|
|
12
|
+
configurationType: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const thalesCalcul: Exercise<Identifiers, Options>;
|
|
9
15
|
export {};
|
|
10
16
|
//# sourceMappingURL=thalesCalcul.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uBAAuB,EAAE,gBAAgB,EAAE,CAAC;IAC5C,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAsKF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAiEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvD,CAAC"}
|
|
@@ -3,149 +3,197 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.thalesCalcul = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const numberVEA_1 = require("../../../../exercises/vea/numberVEA");
|
|
6
7
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
8
|
+
const line_1 = require("../../../../math/geometry/line");
|
|
9
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
10
|
+
const segment_1 = require("../../../../math/geometry/segment");
|
|
11
|
+
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
12
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
8
13
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
14
|
+
const round_1 = require("../../../../math/utils/round");
|
|
15
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
16
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
17
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const xMin = Math.min(xA, xB, xC, xD, xE);
|
|
41
|
-
const xMax = Math.max(xA, xB, xC, xD, xE);
|
|
42
|
-
const yMin = Math.min(yA, yB, yC, yD, yE);
|
|
43
|
-
const yMax = Math.max(yA, yB, yC, yD, yE);
|
|
44
|
-
// AB AC BC AD AE
|
|
45
|
-
const sides = [
|
|
46
|
-
`${vertices[0]}${vertices[1]}`,
|
|
47
|
-
`${vertices[0]}${vertices[3]}`,
|
|
48
|
-
`${vertices[0]}${vertices[2]}`,
|
|
49
|
-
`${vertices[0]}${vertices[4]}`,
|
|
50
|
-
`${vertices[1]}${vertices[2]}`,
|
|
51
|
-
`${vertices[3]}${vertices[4]}`,
|
|
18
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
19
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
20
|
+
const getPropositions = (n, { answer }) => {
|
|
21
|
+
const propositions = [];
|
|
22
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
23
|
+
while (propositions.length < n) {
|
|
24
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(3, 20, 1).frenchify());
|
|
25
|
+
}
|
|
26
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
30
|
+
const pointD = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[0]);
|
|
31
|
+
const pointE = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[1]);
|
|
32
|
+
//order is important
|
|
33
|
+
const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
|
|
34
|
+
const segmentAskedName = segment_1.SegmentConstructor.fromIdentifiers(identifiers.segmentAsked).toInsideName();
|
|
35
|
+
const lengths = [
|
|
36
|
+
...triangle.getSegments().map((s) => {
|
|
37
|
+
return {
|
|
38
|
+
name: s.toInsideName(),
|
|
39
|
+
length: (0, round_1.round)(s.getLength(), 1),
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
42
|
+
...subTriangle.getSegments().map((s) => {
|
|
43
|
+
return {
|
|
44
|
+
name: s.toInsideName(),
|
|
45
|
+
length: (0, round_1.round)(s.getLength(), 1),
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
52
48
|
];
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
rand2 = (0, randint_1.randint)(0, 3, [rand, rand2]); // condition pour pas prendre 2 longueurs identiques
|
|
59
|
-
let instruction = `Dans la figure ci-dessous, on a $(${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]})$, `;
|
|
60
|
-
let statement;
|
|
61
|
-
let startStatement;
|
|
62
|
-
const isAskingC = (0, coinFlip_1.coinFlip)();
|
|
63
|
-
if (isAskingC) {
|
|
64
|
-
// a/b = c/d on cherche c
|
|
65
|
-
instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${sides[2 * rand + 1]} = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2]} = ${sideLengths[2 * rand2]}$. Déterminer $${sides[2 * rand2 + 1]}$.`;
|
|
66
|
-
startStatement = `${sides[2 * rand2 + 1]}`;
|
|
67
|
-
statement = new rational_1.Rational(sideLengths[2 * rand2] * sideLengths[2 * rand + 1], sideLengths[2 * rand])
|
|
68
|
-
.simplify()
|
|
69
|
-
.toTree();
|
|
49
|
+
const askedIndex = lengths.findIndex((l) => l.name === segmentAskedName);
|
|
50
|
+
const otherIndex = (0, randint_1.randint)(0, 3, [askedIndex]);
|
|
51
|
+
const ratio = (0, fractionNode_1.frac)(lengths[otherIndex].length, lengths[otherIndex + 3].length);
|
|
52
|
+
if (askedIndex > 2) {
|
|
53
|
+
return (0, round_1.round)((0, fractionNode_1.frac)(lengths[askedIndex - 3].length, ratio).evaluate(), 1).frenchify();
|
|
70
54
|
}
|
|
71
55
|
else {
|
|
72
|
-
|
|
73
|
-
instruction += `$${sides[2 * rand]} = ${sideLengths[2 * rand]}$, $${sides[2 * rand + 1]} = ${sideLengths[2 * rand + 1]}$, $${sides[2 * rand2 + 1]} = ${sideLengths[2 * rand2 + 1]}$. Déterminer $${sides[2 * rand2]}$.`;
|
|
74
|
-
startStatement = `${sides[2 * rand2]}`;
|
|
75
|
-
statement = new rational_1.Rational(sideLengths[2 * rand2 + 1] * sideLengths[2 * rand], sideLengths[2 * rand + 1])
|
|
76
|
-
.simplify()
|
|
77
|
-
.toTree();
|
|
56
|
+
return (0, round_1.round)((0, multiplyNode_1.multiply)(ratio, lengths[askedIndex + 3].length).evaluate(), 1).frenchify();
|
|
78
57
|
}
|
|
58
|
+
};
|
|
59
|
+
const getInstruction = (identifiers) => {
|
|
60
|
+
const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
61
|
+
const pointD = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[0]);
|
|
62
|
+
const pointE = point_1.PointConstructor.fromIdentifiers(identifiers.insidePointsIdentifiers[1]);
|
|
63
|
+
const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
|
|
64
|
+
const oppositeSegment = triangle.getSideBName();
|
|
65
|
+
const insideSegmentName = identifiers.insidePointsIdentifiers[0].name +
|
|
66
|
+
identifiers.insidePointsIdentifiers[1].name;
|
|
67
|
+
const segmentAskedName = segment_1.SegmentConstructor.fromIdentifiers(identifiers.segmentAsked).toInsideName();
|
|
68
|
+
const lengths = [
|
|
69
|
+
...triangle.getSegments().map((s) => {
|
|
70
|
+
return {
|
|
71
|
+
name: s.toInsideName(),
|
|
72
|
+
length: (0, round_1.round)(s.getLength(), 1).frenchify(),
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
75
|
+
...subTriangle.getSegments().map((s) => {
|
|
76
|
+
return {
|
|
77
|
+
name: s.toInsideName(),
|
|
78
|
+
length: (0, round_1.round)(s.getLength(), 1).frenchify(),
|
|
79
|
+
};
|
|
80
|
+
}),
|
|
81
|
+
];
|
|
82
|
+
return `Dans le triangle $${triangle.getTriangleName()}$ ci-dessous, les droites $\\left(${insideSegmentName}\\right)$ et $\\left(${oppositeSegment}\\right)$ sont parallèles.
|
|
83
|
+
|
|
84
|
+
On sait de plus que : ${lengths
|
|
85
|
+
.filter((e) => e.name !== segmentAskedName)
|
|
86
|
+
.map((e) => `$${e.name}=${e.length}$`)
|
|
87
|
+
.join(" , ")}.
|
|
88
|
+
|
|
89
|
+
Calculer $${segmentAskedName}$ (arrondir aux dixième).`;
|
|
90
|
+
};
|
|
91
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
92
|
+
// }
|
|
93
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
94
|
+
// }
|
|
95
|
+
const getGGBOptions = (identifiers) => {
|
|
96
|
+
const triangle = triangle_1.TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
97
|
+
const points = identifiers.insidePointsIdentifiers.map((d) => point_1.PointConstructor.fromIdentifiers(d));
|
|
98
|
+
const subTriangle = new triangle_1.Triangle(points[0], triangle.vertexB, points[1]);
|
|
99
|
+
const seg = new segment_1.Segment(points[0], points[1]);
|
|
79
100
|
const commands = [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
`${vertices[3]} = Point(${vertices[0]}, Vector(${factor}Vector(${vertices[0]},${vertices[1]})))`,
|
|
84
|
-
`${vertices[4]} = Intersect(Line(${vertices[3]}, Line(${vertices[1]}, ${vertices[2]})) , Line(${vertices[0]}, ${vertices[2]}))`,
|
|
85
|
-
`l = Segment(${vertices[0]}, ${vertices[1]})`,
|
|
86
|
-
`i = Segment(${vertices[0]}, ${vertices[2]})`,
|
|
87
|
-
`j = Segment(${vertices[1]}, ${vertices[2]})`,
|
|
88
|
-
`k = Segment(${vertices[3]}, ${vertices[4]})`,
|
|
89
|
-
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[3]}))`,
|
|
90
|
-
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[4]}))`,
|
|
91
|
-
`ShowLabel(${vertices[0]}, true)`,
|
|
92
|
-
`ShowLabel(${vertices[1]}, true)`,
|
|
93
|
-
`ShowLabel(${vertices[2]}, true)`,
|
|
94
|
-
`ShowLabel(${vertices[3]}, true)`,
|
|
95
|
-
`ShowLabel(${vertices[4]}, true)`,
|
|
101
|
+
...triangle.generateCommands({}),
|
|
102
|
+
...points.flatMap((p) => p.toGGBCommand({ style: 0, color: "#444444", size: 4 })),
|
|
103
|
+
...seg.toGGBCommands(false),
|
|
96
104
|
];
|
|
105
|
+
if (identifiers.isPapillon) {
|
|
106
|
+
commands.push(...new segment_1.Segment(points[0], triangle.vertexB).toGGBCommands(false));
|
|
107
|
+
commands.push(...new segment_1.Segment(points[1], triangle.vertexB).toGGBCommands(false));
|
|
108
|
+
}
|
|
97
109
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
98
110
|
commands,
|
|
99
111
|
hideAxes: true,
|
|
100
112
|
hideGrid: true,
|
|
101
113
|
});
|
|
102
|
-
|
|
114
|
+
let coords = triangle.generateCoords();
|
|
115
|
+
if (identifiers.isPapillon) {
|
|
116
|
+
const subCoords = subTriangle.generateCoords();
|
|
117
|
+
coords = [
|
|
118
|
+
Math.min(subCoords[0], coords[0]),
|
|
119
|
+
Math.max(subCoords[1], coords[1]),
|
|
120
|
+
Math.min(subCoords[2], coords[2]),
|
|
121
|
+
Math.max(subCoords[3], coords[3]),
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
return ggb.getOptions({
|
|
125
|
+
coords: coords,
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const getKeys = (identifiers) => {
|
|
129
|
+
return [];
|
|
130
|
+
};
|
|
131
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
132
|
+
return (0, numberVEA_1.numberVEA)(ans, answer);
|
|
133
|
+
};
|
|
134
|
+
const options = [
|
|
135
|
+
{
|
|
136
|
+
id: "configurationType",
|
|
137
|
+
label: "Types de figure",
|
|
138
|
+
defaultValue: "Toutes",
|
|
139
|
+
values: ["Toutes", "Uniquement papillon", "Uniquement non papillon"],
|
|
140
|
+
target: exercise_1.GeneratorOptionTarget.generation,
|
|
141
|
+
type: exercise_1.GeneratorOptionType.select,
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
const getThalesFindSideQuestion = (opts) => {
|
|
145
|
+
const summitNames = triangle_1.TriangleConstructor.randomName();
|
|
146
|
+
const triangle = triangle_1.TriangleConstructor.createRandomTriangle({
|
|
147
|
+
names: summitNames,
|
|
148
|
+
});
|
|
149
|
+
const isPapillon = !opts || opts?.configurationType === "Toutes"
|
|
150
|
+
? (0, coinFlip_1.coinFlip)()
|
|
151
|
+
: opts.configurationType === "Uniquement papillon"
|
|
152
|
+
? true
|
|
153
|
+
: false;
|
|
154
|
+
const pointD = point_1.PointConstructor.onSegment(triangle.vertexA, triangle.vertexB, (0, randomLetter_1.randomLetter)(true, summitNames), isPapillon ? { coefficient: (0, randfloat_1.randfloat)(1.2, 1.8) } : { spacing: 0.2 });
|
|
155
|
+
const line = new line_1.Line(triangle.vertexA, triangle.vertexC);
|
|
156
|
+
const parallel = line.getParallele(pointD);
|
|
157
|
+
const intersectLine = new line_1.Line(triangle.vertexB, triangle.vertexC);
|
|
158
|
+
const pointE = parallel.intersect(intersectLine, (0, randomLetter_1.randomLetter)(true, [...summitNames, pointD.name]));
|
|
159
|
+
const subTriangle = new triangle_1.Triangle(pointD, triangle.vertexB, pointE);
|
|
160
|
+
const segmentAsked = (0, random_1.random)([
|
|
161
|
+
...triangle.getSegments(),
|
|
162
|
+
...subTriangle.getSegments(),
|
|
163
|
+
]);
|
|
164
|
+
const identifiers = {
|
|
165
|
+
triangleIdentifiers: triangle.toIdentifiers(),
|
|
166
|
+
insidePointsIdentifiers: [pointD.toIdentifiers(), pointE.toIdentifiers()],
|
|
167
|
+
segmentAsked: segmentAsked.toIdentifiers(),
|
|
168
|
+
isPapillon,
|
|
169
|
+
};
|
|
103
170
|
const question = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
keys: [],
|
|
108
|
-
ggbOptions: ggb.getOptions({
|
|
109
|
-
coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
|
|
110
|
-
}),
|
|
171
|
+
answer: getAnswer(identifiers),
|
|
172
|
+
instruction: getInstruction(identifiers),
|
|
173
|
+
keys: getKeys(identifiers),
|
|
111
174
|
answerFormat: "tex",
|
|
112
|
-
identifiers
|
|
175
|
+
identifiers,
|
|
176
|
+
// hint: getHint(identifiers),
|
|
177
|
+
// correction: getCorrection(identifiers),
|
|
178
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
113
179
|
};
|
|
114
180
|
return question;
|
|
115
181
|
};
|
|
116
|
-
const getPropositions = (n, { answer }) => {
|
|
117
|
-
const propositions = [];
|
|
118
|
-
(0, exercise_1.addValidProp)(propositions, answer);
|
|
119
|
-
while (propositions.length < n) {
|
|
120
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, new rational_1.Rational((0, randint_1.randint)(2, 30), (0, randint_1.randint)(2, 30)).simplify().toTree().toTex());
|
|
121
|
-
}
|
|
122
|
-
return (0, shuffle_1.shuffle)(propositions);
|
|
123
|
-
};
|
|
124
|
-
const isAnswerValid = (ans, { isAskingC, rand, rand2, sideLengths }) => {
|
|
125
|
-
let answer;
|
|
126
|
-
if (isAskingC)
|
|
127
|
-
answer = new rational_1.Rational(sideLengths[2 * rand2] * sideLengths[2 * rand + 1], sideLengths[2 * rand])
|
|
128
|
-
.simplify()
|
|
129
|
-
.toTree();
|
|
130
|
-
else
|
|
131
|
-
answer = new rational_1.Rational(sideLengths[2 * rand2 + 1] * sideLengths[2 * rand], sideLengths[2 * rand + 1])
|
|
132
|
-
.simplify()
|
|
133
|
-
.toTree();
|
|
134
|
-
const texs = answer.toAllValidTexs({ allowFractionToDecimal: true });
|
|
135
|
-
return texs.includes(ans);
|
|
136
|
-
};
|
|
137
182
|
exports.thalesCalcul = {
|
|
138
183
|
id: "thalesCalcul",
|
|
139
184
|
connector: "=",
|
|
140
|
-
label: "Utiliser le théoreme de Thalès
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
sections: ["Théorème de Thalès", "Géométrie euclidienne"],
|
|
144
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getThales, nb),
|
|
185
|
+
label: "Utiliser le théoreme de Thalès calculer un côté",
|
|
186
|
+
isSingleStep: true,
|
|
187
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getThalesFindSideQuestion(opts), nb),
|
|
145
188
|
qcmTimer: 60,
|
|
146
189
|
freeTimer: 60,
|
|
147
190
|
getPropositions,
|
|
148
191
|
isAnswerValid,
|
|
149
|
-
hasGeogebra: true,
|
|
150
192
|
subject: "Mathématiques",
|
|
193
|
+
// getHint,
|
|
194
|
+
// getCorrection,
|
|
195
|
+
getAnswer,
|
|
196
|
+
getGGBOptions,
|
|
197
|
+
options,
|
|
198
|
+
hasGeogebra: true,
|
|
151
199
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=thalesCalculOld.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thalesCalculOld.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalculOld.ts"],"names":[],"mappings":""}
|