math-exercises 3.0.53 → 3.0.54
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/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +3 -5
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +8 -3
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +53 -28
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +3 -0
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +2 -2
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +52 -25
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts +2 -2
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +50 -33
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +37 -17
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +33 -12
- package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/circleArea.js +45 -2
- package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/squareArea.js +40 -7
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +52 -7
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +55 -11
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +20 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts +9 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +115 -0
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts +3 -2
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +36 -27
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +123 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts +12 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +130 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +109 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +5 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +5 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +58 -9
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +39 -6
- package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +40 -5
- package/lib/exercises/math/geometry/perimeters/trianglePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +34 -7
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +51 -15
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +109 -19
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +36 -5
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleNature.js +45 -14
- package/lib/exercises/math/geometry/vectors/colinearity.d.ts +5 -4
- package/lib/exercises/math/geometry/vectors/colinearity.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity.js +82 -21
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +2 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +92 -0
- package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculatePower.js +63 -6
- package/lib/exercises/math/powers/powerDefinition.d.ts.map +1 -1
- package/lib/exercises/math/powers/powerDefinition.js +39 -8
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -1
- package/lib/exercises/math/powers/powersPower.d.ts +5 -2
- package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersPower.js +59 -28
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +21 -0
- package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.js +3 -0
- package/lib/index.d.ts +34 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +12 -7
- package/lib/math/geometry/line.d.ts +2 -8
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +51 -29
- package/lib/math/geometry/point.d.ts +2 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -0
- package/lib/math/geometry/segment.js +1 -1
- package/lib/math/geometry/triangles/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangles/triangle.js +11 -11
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -3
- package/lib/math/systems/generalSystem.d.ts +12 -1
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +92 -55
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -15
- package/lib/server.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +0 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +11 -5
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +11 -5
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +11 -5
- package/lib/tree/nodes/node.d.ts +8 -8
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +2 -2
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/powerNode.d.ts +4 -4
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +5 -5
- package/package.json +1 -1
|
@@ -2,13 +2,15 @@ import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
|
|
|
2
2
|
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
3
3
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
4
4
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
-
import { Line } from "../../../../math/geometry/line.js";
|
|
5
|
+
import { Line, LineConstructor } from "../../../../math/geometry/line.js";
|
|
6
6
|
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { Vector, VectorConstructor, } from "../../../../math/geometry/vector.js";
|
|
7
8
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
-
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
9
|
-
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
10
9
|
const getCartesianEquation = (identifiers) => {
|
|
11
|
-
const
|
|
10
|
+
const { pointIds, vectorIds } = identifiers;
|
|
11
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
12
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
13
|
+
const line = LineConstructor.fromPointAndVector(point, vector);
|
|
12
14
|
return line.getCartesianEquation();
|
|
13
15
|
};
|
|
14
16
|
const getInstruction = (identifiers) => {
|
|
@@ -32,8 +34,12 @@ const getStudentGGBOptions = (identifiers) => {
|
|
|
32
34
|
point: true,
|
|
33
35
|
}),
|
|
34
36
|
});
|
|
37
|
+
const { pointIds, vectorIds } = identifiers;
|
|
38
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
39
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
40
|
+
const B = vector.getEndPoint(point);
|
|
35
41
|
return ggb.getOptions({
|
|
36
|
-
coords: [
|
|
42
|
+
coords: ggb.getCoordsForPoints([point, B]),
|
|
37
43
|
});
|
|
38
44
|
};
|
|
39
45
|
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
@@ -42,7 +48,6 @@ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
|
42
48
|
//transformer en vrai droite
|
|
43
49
|
// checker si A et B sont sur la droite
|
|
44
50
|
const lines = ans.filter((s) => isGGBLine(s));
|
|
45
|
-
console.log(lines);
|
|
46
51
|
if (lines.length !== 1)
|
|
47
52
|
return false;
|
|
48
53
|
const pointNames = lines[0]
|
|
@@ -51,9 +56,7 @@ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
|
51
56
|
.replace("]", "")
|
|
52
57
|
.replace(" ", "")
|
|
53
58
|
.split(",");
|
|
54
|
-
console.log(pointNames);
|
|
55
59
|
const pointCmds = ans.filter((s) => s.startsWith(pointNames[0] + "=") || s.startsWith(pointNames[1] + "="));
|
|
56
|
-
console.log(pointCmds);
|
|
57
60
|
const pointsCoords = pointCmds.map((cmd) => cmd
|
|
58
61
|
.split("=")[1]
|
|
59
62
|
.replace("(", "")
|
|
@@ -62,28 +65,34 @@ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
|
62
65
|
.map((n) => Number(n)));
|
|
63
66
|
const points = pointsCoords.map((coord) => new Point("A", coord[0], coord[1]));
|
|
64
67
|
const line = new Line(points[0], points[1]);
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
68
|
+
const { pointIds, vectorIds } = identifiers;
|
|
69
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
70
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
71
|
+
const B = vector.getEndPoint(point);
|
|
72
|
+
return line.includes(point, 0.5) && line.includes(B, 0.5);
|
|
69
73
|
};
|
|
70
74
|
const getDrawLineFromCartesianEquationQuestion = () => {
|
|
71
|
-
const A =
|
|
72
|
-
let B;
|
|
73
|
-
const isVertical = probaFlip(0.1);
|
|
74
|
-
const isHorizontal = probaFlip(0.1);
|
|
75
|
-
if (isVertical) {
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
const A = new Point("A", (0).toTree(), randint(-6, 7).toTree());
|
|
76
|
+
// let B: Point;
|
|
77
|
+
// const isVertical = probaFlip(0.1);
|
|
78
|
+
// const isHorizontal = probaFlip(0.1);
|
|
79
|
+
// if (isVertical) {
|
|
80
|
+
// B = new Point("B", A.x, add(A.y, 2));
|
|
81
|
+
// } else if (isHorizontal) {
|
|
82
|
+
// B = new Point("B", add(A.x, 2), A.y);
|
|
83
|
+
// } else {
|
|
84
|
+
// B = new Point(
|
|
85
|
+
// "B",
|
|
86
|
+
// add(A.x, randint(-3, 4, [0])),
|
|
87
|
+
// add(A.y, randint(-3, 4, [0])),
|
|
88
|
+
// );
|
|
89
|
+
// }
|
|
90
|
+
const x = randint(-3, 4);
|
|
91
|
+
const y = randint(-3, 4, x === 0 ? [0] : undefined);
|
|
92
|
+
const vec = new Vector("u", x.toTree(), y.toTree());
|
|
84
93
|
const identifiers = {
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
pointIds: A.toIdentifiers(),
|
|
95
|
+
vectorIds: vec.toIdentifiers(),
|
|
87
96
|
};
|
|
88
97
|
return getQuestionFromIdentifiers(identifiers);
|
|
89
98
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
pointIds: PointIdentifiers;
|
|
6
|
+
vectorIds: VectorIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const drawLineFromPointAndVector: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=drawLineFromPointAndVector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawLineFromPointAndVector.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/drawLineFromPointAndVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAIvC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AA0HF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
|
|
2
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Line, LineConstructor } from "../../../../math/geometry/line.js";
|
|
6
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { Vector, VectorConstructor, } from "../../../../math/geometry/vector.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getInstruction = (identifiers) => {
|
|
11
|
+
const { pointIds, vectorIds } = identifiers;
|
|
12
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
13
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
14
|
+
return `Soit $d$ la droite passant par le point $${point.toTexWithCoords()}$ et ayant pour vecteur directeur $${vector.toTexWithCoords()}$.
|
|
15
|
+
|
|
16
|
+
Tracer la droite $d$.`;
|
|
17
|
+
};
|
|
18
|
+
const getHint = (identifiers) => {
|
|
19
|
+
return `Placer le point $A$. Puis, déterminer l'image du point $A$ par la translation de vecteur $\\overrightarrow{u}$. La droite recherchée passe par ces deux points.`;
|
|
20
|
+
};
|
|
21
|
+
const getCorrection = (identifiers) => {
|
|
22
|
+
const { pointIds, vectorIds } = identifiers;
|
|
23
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
24
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
25
|
+
const B = vector.getEndPoint(point);
|
|
26
|
+
return `On place d'abord le point $A$. Puis, on détermine l'image du point $A$ par la translation de vecteur $\\overrightarrow{u}$. Cela nous donne le point $${B.toTexWithCoords()}$.
|
|
27
|
+
|
|
28
|
+
On relie alors les points $A$ et $B$ par une droite.`;
|
|
29
|
+
};
|
|
30
|
+
const getGGBAnswer = (identifiers) => {
|
|
31
|
+
const { pointIds, vectorIds } = identifiers;
|
|
32
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
33
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
34
|
+
const line = LineConstructor.fromPointAndVector(point, vector);
|
|
35
|
+
return line.toGGBCommands(true);
|
|
36
|
+
};
|
|
37
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
38
|
+
const { pointIds, vectorIds } = identifiers;
|
|
39
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
40
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
41
|
+
const B = vector.getEndPoint(point);
|
|
42
|
+
const ggb = new GeogebraConstructor({
|
|
43
|
+
customToolBar: toolBarConstructor({
|
|
44
|
+
point: true,
|
|
45
|
+
join: true,
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
return ggb.getOptions({
|
|
49
|
+
coords: ggb.getCoordsForPoints([point, B]),
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
53
|
+
try {
|
|
54
|
+
//parse la line (si +1, faux)
|
|
55
|
+
// parse le spoints de la line
|
|
56
|
+
//transformer en vrai droite
|
|
57
|
+
// checker si A et B sont sur la droite
|
|
58
|
+
const lines = ans.filter((s) => isGGBLine(s));
|
|
59
|
+
if (lines.length !== 1)
|
|
60
|
+
return false;
|
|
61
|
+
const pointNames = lines[0]
|
|
62
|
+
.split("Line")[1]
|
|
63
|
+
.replace("[", "")
|
|
64
|
+
.replace("]", "")
|
|
65
|
+
.replace(" ", "")
|
|
66
|
+
.split(",");
|
|
67
|
+
const pointCmds = ans.filter((s) => s.startsWith(pointNames[0] + "=") || s.startsWith(pointNames[1] + "="));
|
|
68
|
+
const pointsCoords = pointCmds.map((cmd) => cmd
|
|
69
|
+
.split("=")[1]
|
|
70
|
+
.replace("(", "")
|
|
71
|
+
.replace(")", "")
|
|
72
|
+
.split(",")
|
|
73
|
+
.map((n) => Number(n)));
|
|
74
|
+
const points = pointsCoords.map((coord) => new Point("A", coord[0], coord[1]));
|
|
75
|
+
const line = new Line(points[0], points[1]);
|
|
76
|
+
const { pointIds, vectorIds } = identifiers;
|
|
77
|
+
const A = PointConstructor.fromIdentifiers(pointIds);
|
|
78
|
+
const vector = VectorConstructor.fromIdentifiers(vectorIds);
|
|
79
|
+
const B = vector.getEndPoint(A);
|
|
80
|
+
return line.includes(A, 0.5) && line.includes(B, 0.5);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return handleVEAError(err);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const getDrawLineFromPointAndVectorQuestion = () => {
|
|
87
|
+
const point = PointConstructor.random("A");
|
|
88
|
+
const vecX = randint(-3, 4, [0]);
|
|
89
|
+
const vecY = randint(-3, 4);
|
|
90
|
+
const vector = new Vector("u", vecX.toTree(), vecY.toTree());
|
|
91
|
+
const identifiers = {
|
|
92
|
+
pointIds: point.toIdentifiers(),
|
|
93
|
+
vectorIds: vector.toIdentifiers(),
|
|
94
|
+
};
|
|
95
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
96
|
+
};
|
|
97
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
98
|
+
return {
|
|
99
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
100
|
+
instruction: getInstruction(identifiers),
|
|
101
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
102
|
+
identifiers,
|
|
103
|
+
hint: getHint(identifiers),
|
|
104
|
+
correction: getCorrection(identifiers),
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
export const drawLineFromPointAndVector = {
|
|
108
|
+
id: "drawLineFromPointAndVector",
|
|
109
|
+
label: "Tracer une droite à partir d'un point et d'un vecteur directeur",
|
|
110
|
+
isSingleStep: true,
|
|
111
|
+
generator: (nb, opts) => getDistinctQuestions(() => getDrawLineFromPointAndVectorQuestion(opts), nb),
|
|
112
|
+
ggbTimer: 60,
|
|
113
|
+
isGGBAnswerValid,
|
|
114
|
+
subject: "Mathématiques",
|
|
115
|
+
getHint,
|
|
116
|
+
getInstruction,
|
|
117
|
+
getCorrection,
|
|
118
|
+
getGGBAnswer,
|
|
119
|
+
getStudentGGBOptions,
|
|
120
|
+
answerType: "GGB",
|
|
121
|
+
getQuestionFromIdentifiers,
|
|
122
|
+
hasHintAndCorrection: true,
|
|
123
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
aIds: NodeIdentifiers;
|
|
5
|
+
bIds: NodeIdentifiers;
|
|
6
|
+
cIds: NodeIdentifiers;
|
|
7
|
+
colinearityCoeffIds: NodeIdentifiers;
|
|
8
|
+
fakeCIds: NodeIdentifiers;
|
|
9
|
+
};
|
|
10
|
+
export declare const findParallelLineFromCartesianEquation: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=findParallelLineFromCartesianEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findParallelLineFromCartesianEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,mBAAmB,EAAE,eAAe,CAAC;IACrC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAgIF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAmBvE,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { LineConstructor } from "../../../../math/geometry/line.js";
|
|
4
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { equal } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
8
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
11
|
+
import { doWhile } from "../../../../utils/doWhile.js";
|
|
12
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
13
|
+
const getFakeEquation = (identifiers) => {
|
|
14
|
+
const { aIds, bIds, cIds, colinearityCoeffIds, fakeCIds } = identifiers;
|
|
15
|
+
const a = reifyAlgebraic(aIds);
|
|
16
|
+
const b = reifyAlgebraic(bIds);
|
|
17
|
+
const fakeC = reifyAlgebraic(fakeCIds);
|
|
18
|
+
const coeff = reifyAlgebraic(colinearityCoeffIds);
|
|
19
|
+
const vec = new Vector("u", opposite(b), a);
|
|
20
|
+
const kVec = vec.times(coeff);
|
|
21
|
+
const fakeA = kVec.y;
|
|
22
|
+
const fakeB = opposite(kVec.x);
|
|
23
|
+
const equation = equal(add(add(multiply(fakeA, "x"), multiply(fakeB, "y")), fakeC), 0).simplify({
|
|
24
|
+
forbidFactorize: true,
|
|
25
|
+
});
|
|
26
|
+
return equation;
|
|
27
|
+
};
|
|
28
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
29
|
+
const propositions = [];
|
|
30
|
+
const equa = getFakeEquation(identifiers);
|
|
31
|
+
addValidProp(propositions, equa.toTex());
|
|
32
|
+
const goodLine = LineConstructor.fromCartesian(equa);
|
|
33
|
+
while (propositions.length < n) {
|
|
34
|
+
const line = doWhile(() => LineConstructor.random(), (l) => l.isParallele(goodLine));
|
|
35
|
+
tryToAddWrongProp(propositions, line.getCartesianEquation().toTex());
|
|
36
|
+
}
|
|
37
|
+
return shuffleProps(propositions, n);
|
|
38
|
+
};
|
|
39
|
+
const getInstruction = (identifiers) => {
|
|
40
|
+
const { aIds, bIds, cIds } = identifiers;
|
|
41
|
+
const a = reifyAlgebraic(aIds);
|
|
42
|
+
const b = reifyAlgebraic(bIds);
|
|
43
|
+
const c = reifyAlgebraic(cIds);
|
|
44
|
+
const equation = equal(add(add(multiply(a, "x"), multiply(b, "y")), c), 0).simplify({
|
|
45
|
+
forbidFactorize: true,
|
|
46
|
+
});
|
|
47
|
+
return `Soit $d$ une droite dont une équation cartésienne est :
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
${equation.toTex()}
|
|
51
|
+
$$
|
|
52
|
+
|
|
53
|
+
Parmi les équations cartésiennes de droite suivantes, laquelle est celle d'une droite parallèle à $d$ ?`;
|
|
54
|
+
};
|
|
55
|
+
const getHint = (identifiers) => {
|
|
56
|
+
return `Deux droites sont parallèles si un vecteur directeur de l'un est colinéaire à un vecteur directeur de l'autre. On peut donc déterminer un vecteur directeur $\\overrightarrow{u}$ de $d$, puis déterminer un vecteur directeur de chacune des droites proposées, afin de trouver celui qui est colinéaire à $\\overrightarrow{u}$.`;
|
|
57
|
+
};
|
|
58
|
+
const getCorrection = (identifiers) => {
|
|
59
|
+
const { aIds, bIds, cIds, colinearityCoeffIds, fakeCIds } = identifiers;
|
|
60
|
+
const a = reifyAlgebraic(aIds);
|
|
61
|
+
const b = reifyAlgebraic(bIds);
|
|
62
|
+
const fakeC = reifyAlgebraic(fakeCIds);
|
|
63
|
+
const coeff = reifyAlgebraic(colinearityCoeffIds);
|
|
64
|
+
const fakeEqua = getFakeEquation(identifiers);
|
|
65
|
+
const vec = new Vector("u", opposite(b), a).simplify();
|
|
66
|
+
const kVec = vec.times(coeff, "v");
|
|
67
|
+
return `La droite $d$ admet pour vecteur directeur $${vec.toTexWithCoords()}$. Parmi les droites proposées, on cherche donc une droite qui a un vecteur directeur colinéaire à $${vec.toTex()}$.
|
|
68
|
+
|
|
69
|
+
On remarque que la droite d'équation cartésienne :
|
|
70
|
+
|
|
71
|
+
$$
|
|
72
|
+
${fakeEqua.toTex()}
|
|
73
|
+
$$
|
|
74
|
+
|
|
75
|
+
admet pour vecteur directeur $${kVec.toTexWithCoords()}$.
|
|
76
|
+
|
|
77
|
+
Or les vecteurs $${vec.toTex()}$ et $${kVec.toTex()}$ sont colinéaires, puisque leur déterminant est nul :
|
|
78
|
+
|
|
79
|
+
${alignTex([
|
|
80
|
+
["", `\\det(${vec.toTex()},${kVec.toTex()})`],
|
|
81
|
+
["=", vec.determinant(kVec).toTex()],
|
|
82
|
+
["=", vec.determinant(kVec).simplify().toTex()],
|
|
83
|
+
])}
|
|
84
|
+
|
|
85
|
+
La droite parallèle à $d$ est donc la droite d'équation cartésienne :
|
|
86
|
+
|
|
87
|
+
$$
|
|
88
|
+
${fakeEqua.toTex()}
|
|
89
|
+
$$
|
|
90
|
+
`;
|
|
91
|
+
};
|
|
92
|
+
const getFindParallelLineFromCartesianEquationQuestion = (ops) => {
|
|
93
|
+
const line = LineConstructor.random();
|
|
94
|
+
const [a, b, c] = line.toCartesianCoeffs();
|
|
95
|
+
const coeff = randint(-3, 4, [0, 1]);
|
|
96
|
+
const fakeC = randint(-9, 10);
|
|
97
|
+
const identifiers = {
|
|
98
|
+
aIds: a.toIdentifiers(),
|
|
99
|
+
bIds: b.toIdentifiers(),
|
|
100
|
+
cIds: c.toIdentifiers(),
|
|
101
|
+
colinearityCoeffIds: coeff.toTree().toIdentifiers(),
|
|
102
|
+
fakeCIds: fakeC.toTree().toIdentifiers(),
|
|
103
|
+
};
|
|
104
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
105
|
+
};
|
|
106
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
107
|
+
return {
|
|
108
|
+
instruction: getInstruction(identifiers),
|
|
109
|
+
answerFormat: "tex",
|
|
110
|
+
identifiers,
|
|
111
|
+
hint: getHint(identifiers),
|
|
112
|
+
correction: getCorrection(identifiers),
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export const findParallelLineFromCartesianEquation = {
|
|
116
|
+
id: "findParallelLineFromCartesianEquation",
|
|
117
|
+
label: "Droites parallèles via leurs équations cartésiennes",
|
|
118
|
+
isSingleStep: true,
|
|
119
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFindParallelLineFromCartesianEquationQuestion(opts), nb),
|
|
120
|
+
qcmTimer: 60,
|
|
121
|
+
freeTimer: 60,
|
|
122
|
+
getPropositions,
|
|
123
|
+
subject: "Mathématiques",
|
|
124
|
+
getInstruction,
|
|
125
|
+
getHint,
|
|
126
|
+
getCorrection,
|
|
127
|
+
getQuestionFromIdentifiers,
|
|
128
|
+
answerType: "QCU",
|
|
129
|
+
hasHintAndCorrection: true,
|
|
130
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
aIds: NodeIdentifiers;
|
|
5
|
+
bIds: NodeIdentifiers;
|
|
6
|
+
fakeBIds: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const findParallelLineFromReductEquation: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=findParallelLineFromReductEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findParallelLineFromReductEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromReductEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAqGF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAmBpE,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { equal } from "../../../../tree/nodes/equations/equalNode.js";
|
|
5
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
6
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
const getEquation = (identifiers) => {
|
|
9
|
+
const { aIds, bIds } = identifiers;
|
|
10
|
+
const a = reifyAlgebraic(aIds);
|
|
11
|
+
const b = reifyAlgebraic(bIds);
|
|
12
|
+
return equal("y", add(multiply(a, "x"), b)).simplify({
|
|
13
|
+
forbidFactorize: true,
|
|
14
|
+
forceDistributeFractions: true,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
18
|
+
const propositions = [];
|
|
19
|
+
const { aIds, bIds, fakeBIds } = identifiers;
|
|
20
|
+
const a = reifyAlgebraic(aIds);
|
|
21
|
+
const aEv = a.evaluate();
|
|
22
|
+
const b = reifyAlgebraic(bIds);
|
|
23
|
+
const fakeB = reifyAlgebraic(fakeBIds);
|
|
24
|
+
const ans = equal("y", add(multiply(a, "x"), fakeB)).simplify({
|
|
25
|
+
forbidFactorize: true,
|
|
26
|
+
forceDistributeFractions: true,
|
|
27
|
+
});
|
|
28
|
+
addValidProp(propositions, ans.toTex());
|
|
29
|
+
while (propositions.length < n) {
|
|
30
|
+
const randA = randint(-9, 10, [aEv]);
|
|
31
|
+
const randB = randint(-9, 10);
|
|
32
|
+
const fakeEq = equal("y", add(multiply(randA, "x"), randB)).simplify({
|
|
33
|
+
forbidFactorize: true,
|
|
34
|
+
forceDistributeFractions: true,
|
|
35
|
+
});
|
|
36
|
+
tryToAddWrongProp(propositions, fakeEq.toTex());
|
|
37
|
+
}
|
|
38
|
+
return shuffleProps(propositions, n);
|
|
39
|
+
};
|
|
40
|
+
const getInstruction = (identifiers) => {
|
|
41
|
+
return `Soit $d$ la droite d'équation réduite :
|
|
42
|
+
|
|
43
|
+
$$
|
|
44
|
+
${getEquation(identifiers).toTex()}
|
|
45
|
+
$$
|
|
46
|
+
|
|
47
|
+
Parmi les équations réduites de droite suivantes, laquelle est celle d'une droite parallèle à $d$ ?`;
|
|
48
|
+
};
|
|
49
|
+
const getHint = (identifiers) => {
|
|
50
|
+
return `Deux droites sont parallèles si et seulement si leurs coefficients directeurs sont égaux.`;
|
|
51
|
+
};
|
|
52
|
+
const getCorrection = (identifiers) => {
|
|
53
|
+
const { aIds, bIds, fakeBIds } = identifiers;
|
|
54
|
+
const a = reifyAlgebraic(aIds);
|
|
55
|
+
const fakeB = reifyAlgebraic(fakeBIds);
|
|
56
|
+
return `Deux droites sont parallèles si et seulement si leurs coefficients directeurs sont égaux.
|
|
57
|
+
|
|
58
|
+
Le coefficient directeur de $d$ est $${a.toTex()}$.
|
|
59
|
+
|
|
60
|
+
Parmi les équations proposées, la seule qui représente une droite de coefficient directeur $${a.toTex()}$ est :
|
|
61
|
+
|
|
62
|
+
$$
|
|
63
|
+
${equal("y", add(multiply(a, "x"), fakeB))
|
|
64
|
+
.simplify({
|
|
65
|
+
forbidFactorize: true,
|
|
66
|
+
forceDistributeFractions: true,
|
|
67
|
+
})
|
|
68
|
+
.toTex()}
|
|
69
|
+
$$
|
|
70
|
+
|
|
71
|
+
C'est donc cette équation qui représente une droite parallèle à $d$.
|
|
72
|
+
`;
|
|
73
|
+
};
|
|
74
|
+
const getFindParallelLineFromReductEquationQuestion = (ops) => {
|
|
75
|
+
const a = randint(-9, 10);
|
|
76
|
+
const b = randint(-9, 10);
|
|
77
|
+
const fakeB = randint(-9, 10, [b]);
|
|
78
|
+
const identifiers = {
|
|
79
|
+
aIds: a.toTree().toIdentifiers(),
|
|
80
|
+
bIds: b.toTree().toIdentifiers(),
|
|
81
|
+
fakeBIds: fakeB.toTree().toIdentifiers(),
|
|
82
|
+
};
|
|
83
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
84
|
+
};
|
|
85
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
86
|
+
return {
|
|
87
|
+
instruction: getInstruction(identifiers),
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const findParallelLineFromReductEquation = {
|
|
95
|
+
id: "findParallelLineFromReductEquation",
|
|
96
|
+
label: "Droites parallèles via leur équation réduite",
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFindParallelLineFromReductEquationQuestion(opts), nb),
|
|
99
|
+
qcmTimer: 60,
|
|
100
|
+
freeTimer: 60,
|
|
101
|
+
getPropositions,
|
|
102
|
+
subject: "Mathématiques",
|
|
103
|
+
getInstruction,
|
|
104
|
+
getHint,
|
|
105
|
+
getCorrection,
|
|
106
|
+
getQuestionFromIdentifiers,
|
|
107
|
+
answerType: "QCU",
|
|
108
|
+
hasHintAndCorrection: true,
|
|
109
|
+
};
|
|
@@ -4,9 +4,14 @@ export * from "./cartesianEquationToReduced.js";
|
|
|
4
4
|
export * from "./findPointOnLineWithCartesianEquation.js";
|
|
5
5
|
export * from "./isPointOnLine.js";
|
|
6
6
|
export * from "./isPointOnCartesianLine.js";
|
|
7
|
+
export * from "./drawLineFromCartesianEquation.js";
|
|
7
8
|
export * from "./reductEquationFindY.js";
|
|
8
9
|
export * from "./reductEquationReading.js";
|
|
9
10
|
export * from "./aAndBFromReductEquation.js";
|
|
10
11
|
export * from "./reductEquationFromTwoPoints.js";
|
|
11
12
|
export * from "./directorVectorFromReductEquation.js";
|
|
13
|
+
export * from "./findParallelLineFromReductEquation.js";
|
|
14
|
+
export * from "./findParallelLineFromCartesianEquation.js";
|
|
15
|
+
export * from "./drawLineFromPointAndVector.js";
|
|
16
|
+
export * from "./cartesianEquationsIntersection.js";
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC"}
|
|
@@ -4,9 +4,13 @@ export * from "./cartesianEquationToReduced.js";
|
|
|
4
4
|
export * from "./findPointOnLineWithCartesianEquation.js";
|
|
5
5
|
export * from "./isPointOnLine.js";
|
|
6
6
|
export * from "./isPointOnCartesianLine.js";
|
|
7
|
-
|
|
7
|
+
export * from "./drawLineFromCartesianEquation.js";
|
|
8
8
|
export * from "./reductEquationFindY.js";
|
|
9
9
|
export * from "./reductEquationReading.js";
|
|
10
10
|
export * from "./aAndBFromReductEquation.js";
|
|
11
11
|
export * from "./reductEquationFromTwoPoints.js";
|
|
12
12
|
export * from "./directorVectorFromReductEquation.js";
|
|
13
|
+
export * from "./findParallelLineFromReductEquation.js";
|
|
14
|
+
export * from "./findParallelLineFromCartesianEquation.js";
|
|
15
|
+
export * from "./drawLineFromPointAndVector.js";
|
|
16
|
+
export * from "./cartesianEquationsIntersection.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
|
|
@@ -4,24 +4,73 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
4
4
|
import { round } from "../../../../math/utils/round.js";
|
|
5
5
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
6
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
7
|
-
const
|
|
8
|
-
const radius =
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const getInstruction = (identifiers) => {
|
|
8
|
+
const { coin, radius, diametre } = identifiers;
|
|
9
|
+
return `Calculer la circonférence d'un cercle de ${coin ? "rayon " + `$${radius}$` : "diamètre " + `$${diametre}$`} cm.
|
|
10
|
+
|
|
11
|
+
Donner une réponse arrondie au centième.`;
|
|
12
|
+
};
|
|
13
|
+
const getAnswer = (identifiers) => {
|
|
14
|
+
const { coin, radius, diametre } = identifiers;
|
|
11
15
|
const answerNb = coin
|
|
12
16
|
? round(2 * Math.PI * radius, 2)
|
|
13
17
|
: round(Math.PI * diametre, 2);
|
|
14
18
|
const answer = (answerNb + "").replace(".", ",");
|
|
15
19
|
const answerTex = answer + "\\text{cm}";
|
|
20
|
+
return answerTex;
|
|
21
|
+
};
|
|
22
|
+
const getHint = (identifiers) => {
|
|
23
|
+
return `La circonférence d'un cercle de rayon $r$ est donnée par :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
C = 2\\pi r
|
|
27
|
+
$$`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { coin, radius, diametre } = identifiers;
|
|
31
|
+
const isRadius = coin;
|
|
32
|
+
return `La circonférence d'un cercle de ${isRadius ? "rayon $r$" : "diamètre $d$"} est donnée par :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
C = ${isRadius ? "2\\pi r" : "\\pi\\times d"}
|
|
36
|
+
$$
|
|
37
|
+
|
|
38
|
+
${isRadius
|
|
39
|
+
? `Ici, on a $r = ${radius}$ cm.
|
|
40
|
+
|
|
41
|
+
La circonférence est donc égale à :
|
|
42
|
+
|
|
43
|
+
$$
|
|
44
|
+
C = 2\\pi \\times ${radius} \\approx ${getAnswer(identifiers)}
|
|
45
|
+
$$`
|
|
46
|
+
: `Ici, on a $d = ${diametre}$ cm.
|
|
47
|
+
|
|
48
|
+
La circonférence est donc égale à :
|
|
49
|
+
|
|
50
|
+
$$
|
|
51
|
+
C = \\pi \\times ${diametre} \\approx ${getAnswer(identifiers)}
|
|
52
|
+
$$
|
|
53
|
+
`}`;
|
|
54
|
+
};
|
|
55
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
16
56
|
const question = {
|
|
17
|
-
instruction:
|
|
18
|
-
answer:
|
|
57
|
+
instruction: getInstruction(identifiers),
|
|
58
|
+
answer: getAnswer(identifiers),
|
|
19
59
|
answerFormat: "tex",
|
|
20
60
|
keys: ["cm", "cm2"],
|
|
21
|
-
identifiers
|
|
61
|
+
identifiers,
|
|
62
|
+
hint: getHint(identifiers),
|
|
63
|
+
correction: getCorrection(identifiers),
|
|
22
64
|
};
|
|
23
65
|
return question;
|
|
24
66
|
};
|
|
67
|
+
const getCircleCircumference = () => {
|
|
68
|
+
const radius = randint(1, 13);
|
|
69
|
+
const diametre = randint(1, 21);
|
|
70
|
+
const coin = coinFlip();
|
|
71
|
+
const identifiers = { coin, diametre, radius };
|
|
72
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
73
|
+
};
|
|
25
74
|
const getPropositions = (n, { answer }) => {
|
|
26
75
|
const propositions = [];
|
|
27
76
|
addValidProp(propositions, answer);
|
|
@@ -38,13 +87,13 @@ export const circleCircumference = {
|
|
|
38
87
|
id: "circleCircumference",
|
|
39
88
|
connector: "=",
|
|
40
89
|
label: "Calculer la circonférence d'un cercle",
|
|
41
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
42
90
|
isSingleStep: false,
|
|
43
|
-
sections: ["Périmètres", "Géométrie euclidienne"],
|
|
44
91
|
generator: (nb) => getDistinctQuestions(getCircleCircumference, nb),
|
|
45
92
|
qcmTimer: 60,
|
|
46
93
|
freeTimer: 60,
|
|
47
94
|
getPropositions,
|
|
48
95
|
isAnswerValid,
|
|
49
96
|
subject: "Mathématiques",
|
|
97
|
+
getQuestionFromIdentifiers,
|
|
98
|
+
hasHintAndCorrection: true,
|
|
50
99
|
};
|