math-exercises 3.0.99 → 3.0.100
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/geometry/areas/calculateAreaFromCodedShape.d.ts +9 -0
- package/lib/exercises/math/geometry/areas/calculateAreaFromCodedShape.d.ts.map +1 -0
- package/lib/exercises/math/geometry/areas/calculateAreaFromCodedShape.js +156 -0
- package/lib/exercises/math/geometry/areas/index.d.ts +1 -0
- package/lib/exercises/math/geometry/areas/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/index.js +1 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/index.js +1 -0
- package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.d.ts +8 -0
- package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.js +197 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +9 -4
- package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.d.ts +9 -0
- package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.d.ts.map +1 -0
- package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.js +155 -0
- package/lib/exercises/math/geometry/pythagore/index.d.ts +1 -0
- package/lib/exercises/math/geometry/pythagore/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/index.js +2 -0
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
- package/lib/exercises/math/geometry/pythagore/triangleHeight.d.ts +9 -0
- package/lib/exercises/math/geometry/pythagore/triangleHeight.d.ts.map +1 -0
- package/lib/exercises/math/geometry/pythagore/triangleHeight.js +105 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/index.js +2 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts +11 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.js +140 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts +11 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.js +144 -0
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +201 -0
- package/lib/exercises/math/geometry/vectors/colinearity/determinant.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/colinearity/determinant.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/colinearity/determinant.js +101 -0
- package/lib/exercises/math/geometry/vectors/colinearity/index.d.ts +2 -0
- package/lib/exercises/math/geometry/vectors/colinearity/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/index.js +2 -0
- package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.js +78 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.js +7 -0
- package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.js +179 -0
- package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.js +171 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.js +110 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.d.ts +11 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.js +123 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts +11 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.js +115 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.d.ts +11 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.js +123 -0
- package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/coordinatesReading.js +63 -14
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts +3 -0
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +63 -2
- package/lib/exercises/math/geometry/vectors/index.d.ts +4 -8
- package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/index.js +4 -8
- package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.d.ts +14 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.js +78 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.js +193 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.d.ts +14 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.js +116 -0
- package/lib/exercises/math/geometry/vectors/translationFromPicture.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/translationFromPicture.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/translationFromPicture.js +104 -0
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +161 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/variableVolume.d.ts +9 -0
- package/lib/exercises/math/geometry/volumes/variableVolume.d.ts.map +1 -0
- package/lib/exercises/math/geometry/volumes/variableVolume.js +203 -0
- package/lib/index.d.ts +89 -40
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -0
- 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 +3 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/tests/pdfs/quizPdfPreambule.js +1 -1
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +4 -4
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +8 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA6RF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAgB7D,CAAC"}
|
|
@@ -55,6 +55,56 @@ const getGGBOptions = (identifiers) => {
|
|
|
55
55
|
coords: [-8, 8, -4, 4],
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
|
+
const getHint = (identifiers) => {
|
|
59
|
+
return `- Deux vecteurs ont la même norme si les flèches qui les représentent sont de même longueur.
|
|
60
|
+
- Deux vecteurs ont la même direction si les droites qui les portent sont parallèles.
|
|
61
|
+
- Deux vecteurs ont le même sens s'ils ont la même direction et si les flèches qui les représentent sont orientées dans le même sens.
|
|
62
|
+
- Deux vecteurs sont égaux s'ils ont la même norme, la même direction et le même sens.
|
|
63
|
+
- Deux vecteurs sont opposés s'ils ont la même norme, la meme direction et un sens opposé. `;
|
|
64
|
+
};
|
|
65
|
+
const getCorrection = (identifiers) => {
|
|
66
|
+
const { caracAsked, uPoints, vPoints, isTrue, sameDirection, sameNorm, sameSens, } = identifiers;
|
|
67
|
+
const u = `$\\overrightarrow{u}$`;
|
|
68
|
+
const v = `$\\overrightarrow{v}$`;
|
|
69
|
+
switch (caracAsked) {
|
|
70
|
+
case "direction":
|
|
71
|
+
return isTrue
|
|
72
|
+
? `Les droites portant les vecteurs semblent être parallèles. Les vecteurs ${u} et ${v} semblent donc avoir la même direction.`
|
|
73
|
+
: `Les droites portant les vecteurs ne semblent pas être parallèles. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même direction.`;
|
|
74
|
+
break;
|
|
75
|
+
case "norme":
|
|
76
|
+
return isTrue
|
|
77
|
+
? `Les flèches représentant les vecteurs semblent être de même longueur. Les vecteurs ${u} et ${v} semblent donc avoir la même norme.`
|
|
78
|
+
: `Les flèches représentant les vecteurs ne semblent pas être de même longueur. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même norme.`;
|
|
79
|
+
break;
|
|
80
|
+
case "sens":
|
|
81
|
+
return isTrue
|
|
82
|
+
? `Les droites portant les vecteurs semblent être parallèles, et les flèches représentant les vecteurs sont orientées dans le même sens. Les vecteurs ${u} et ${v} semblent donc avoir le même sens.`
|
|
83
|
+
: !sameDirection
|
|
84
|
+
? `Les droites portant les vecteurs ne semblent pas être parallèles. Les vecteurs ${u} et ${v} ne peuvent donc pas avoir le même sens.`
|
|
85
|
+
: `Les droites portant les vecteurs semblent bien être parallèles, mais les flèches représentant les vecteurs ne sont pas orientées dans le même sens. Les vecteurs ${u} et ${v} ne semblent donc pas avoir le même sens.`;
|
|
86
|
+
break;
|
|
87
|
+
case "egaux":
|
|
88
|
+
return isTrue
|
|
89
|
+
? `Les vecteurs ${u} et ${v} semblent avoir la même norme, la même direction et le même sens. Ils semblent donc être égaux.`
|
|
90
|
+
: !sameDirection
|
|
91
|
+
? `Les droites portant les vecteurs ne semblent pas être parallèles. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même direction, et donc ne semblent pas être égaux.`
|
|
92
|
+
: !sameSens
|
|
93
|
+
? `Les flèches représentant les vecteurs ne sont pas orientées dans le même sens. Les vecteurs ${u} et ${v} ne semblent donc pas avoir le même sens, et donc ne semblent pas être égaux.`
|
|
94
|
+
: `Les flèches représentant les vecteurs ne semblent pas être de même longueur. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même norme, et donc ne semblent pas être égaux.`;
|
|
95
|
+
break;
|
|
96
|
+
case "opposes":
|
|
97
|
+
default:
|
|
98
|
+
return isTrue
|
|
99
|
+
? `Les vecteurs ${u} et ${v} semblent avoir la même norme, la même direction mais un sens opposé. Ils semblent donc être opposés.`
|
|
100
|
+
: !sameDirection
|
|
101
|
+
? `Les droites portant les vecteurs ne semblent pas être parallèles. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même direction, et donc ne semblent pas être opposés.`
|
|
102
|
+
: sameSens
|
|
103
|
+
? `Les flèches représentant les vecteurs sont orientées dans le même sens. Les vecteurs ${u} et ${v} semblent donc avoir le même sens, et donc ne semblent pas être opposés.`
|
|
104
|
+
: `Les flèches représentant les vecteurs ne semblent pas être de même longueur. Les vecteurs ${u} et ${v} ne semblent donc pas avoir la même norme, et donc ne semblent pas être opposés.`;
|
|
105
|
+
}
|
|
106
|
+
return ``;
|
|
107
|
+
};
|
|
58
108
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
59
109
|
const question = {
|
|
60
110
|
answer: getAnswer(identifiers),
|
|
@@ -63,6 +113,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
63
113
|
ggbOptions: getGGBOptions(identifiers),
|
|
64
114
|
answerFormat: "raw",
|
|
65
115
|
identifiers,
|
|
116
|
+
hint: getHint(identifiers),
|
|
117
|
+
correction: getCorrection(identifiers),
|
|
66
118
|
};
|
|
67
119
|
return question;
|
|
68
120
|
};
|
|
@@ -190,7 +242,15 @@ const getEqualCaracteristicFromGraphQuestion = () => {
|
|
|
190
242
|
[uPoints, vPoints] = [vPoints, uPoints];
|
|
191
243
|
break;
|
|
192
244
|
}
|
|
193
|
-
const identifiers = {
|
|
245
|
+
const identifiers = {
|
|
246
|
+
caracAsked,
|
|
247
|
+
uPoints,
|
|
248
|
+
vPoints,
|
|
249
|
+
isTrue,
|
|
250
|
+
sameDirection,
|
|
251
|
+
sameNorm,
|
|
252
|
+
sameSens,
|
|
253
|
+
};
|
|
194
254
|
return getQuestionFromIdentifiers(identifiers);
|
|
195
255
|
};
|
|
196
256
|
const getPropositions = (n, { answer }) => {
|
|
@@ -205,7 +265,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
205
265
|
};
|
|
206
266
|
export const equalCaracteristicFromGraph = {
|
|
207
267
|
id: "equalCaracteristicFromGraph",
|
|
208
|
-
label: "
|
|
268
|
+
label: "Caractéristiques des vecteurs : direction, sens, norme, égalité, opposés",
|
|
209
269
|
isSingleStep: true,
|
|
210
270
|
generator: (nb) => getDistinctQuestions(getEqualCaracteristicFromGraphQuestion, nb),
|
|
211
271
|
qcmTimer: 60,
|
|
@@ -216,4 +276,5 @@ export const equalCaracteristicFromGraph = {
|
|
|
216
276
|
hasGeogebra: true,
|
|
217
277
|
subject: "Mathématiques",
|
|
218
278
|
getQuestionFromIdentifiers,
|
|
279
|
+
hasHintAndCorrection: true,
|
|
219
280
|
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
export * from "./chasles.js";
|
|
2
2
|
export * from "./coordinatesReading.js";
|
|
3
|
-
export * from "./determinant.js";
|
|
4
3
|
export * from "./vectorCoordinatesFromTwoPoints.js";
|
|
5
4
|
export * from "./paralellismViaColinearity.js";
|
|
6
|
-
export * from "./parallelogramViaEqualVectors.js";
|
|
7
|
-
export * from "./fourthParallelogramPoint.js";
|
|
8
5
|
export * from "./equalCaracteristicFromGraph.js";
|
|
9
6
|
export * from "./vectorLinearCombination.js";
|
|
10
7
|
export * from "./vectorNormCalculation.js";
|
|
11
8
|
export * from "./lineFromDirectorVector.js";
|
|
12
|
-
export * from "./drawAVectorInGGB.js";
|
|
13
9
|
export * from "./scalarProduct/index.js";
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./traceVectorDifference.js";
|
|
16
|
-
export * from "./traceOppositeVector.js";
|
|
17
|
-
export * from "./traceVectorMultiple.js";
|
|
10
|
+
export * from "./parallelogram/index.js";
|
|
18
11
|
export * from "./findCoordForAligment.js";
|
|
19
12
|
export * from "./colinearity/index.js";
|
|
20
13
|
export * from "./distributeAndReduceVectors.js";
|
|
14
|
+
export * from "./constructions/index.js";
|
|
15
|
+
export * from "./translationFromPicture.js";
|
|
16
|
+
export * from "./vectorRepresentative.js";
|
|
21
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
export * from "./chasles.js";
|
|
2
2
|
export * from "./coordinatesReading.js";
|
|
3
|
-
export * from "./determinant.js";
|
|
4
3
|
export * from "./vectorCoordinatesFromTwoPoints.js";
|
|
5
4
|
export * from "./paralellismViaColinearity.js";
|
|
6
|
-
export * from "./parallelogramViaEqualVectors.js";
|
|
7
|
-
export * from "./fourthParallelogramPoint.js";
|
|
8
5
|
export * from "./equalCaracteristicFromGraph.js";
|
|
9
6
|
export * from "./vectorLinearCombination.js";
|
|
10
7
|
export * from "./vectorNormCalculation.js";
|
|
11
8
|
export * from "./lineFromDirectorVector.js";
|
|
12
|
-
export * from "./drawAVectorInGGB.js";
|
|
13
9
|
export * from "./scalarProduct/index.js";
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./traceVectorDifference.js";
|
|
16
|
-
export * from "./traceOppositeVector.js";
|
|
17
|
-
export * from "./traceVectorMultiple.js";
|
|
10
|
+
export * from "./parallelogram/index.js";
|
|
18
11
|
export * from "./findCoordForAligment.js";
|
|
19
12
|
export * from "./colinearity/index.js";
|
|
20
13
|
export * from "./distributeAndReduceVectors.js";
|
|
14
|
+
export * from "./constructions/index.js";
|
|
15
|
+
export * from "./translationFromPicture.js";
|
|
16
|
+
export * from "./vectorRepresentative.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xA: number;
|
|
4
|
+
xB: number;
|
|
5
|
+
xC: number;
|
|
6
|
+
xD: number;
|
|
7
|
+
yA: number;
|
|
8
|
+
yB: number;
|
|
9
|
+
yC: number;
|
|
10
|
+
yD: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const fourthParallelogramPoint: Exercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=fourthParallelogramPoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fourthParallelogramPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,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,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4EF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAY1D,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { coordinatesKeys } from "../../../../../exercises/utils/keys/coordinatesKeys.js";
|
|
4
|
+
import { Point, PointConstructor } from "../../../../../math/geometry/point.js";
|
|
5
|
+
import { Vector, VectorConstructor } from "../../../../../math/geometry/vector.js";
|
|
6
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const A = new Point("A", identifiers.xA, identifiers.yA);
|
|
11
|
+
const B = new Point("B", identifiers.xB, identifiers.yB);
|
|
12
|
+
const C = new Point("C", identifiers.xC, identifiers.yC);
|
|
13
|
+
return `Soient les points $${A.toTexWithCoords()}$, $${B.toTexWithCoords()}$, et $${C.toTexWithCoords()}$.
|
|
14
|
+
|
|
15
|
+
Quelles sont les coordonnées du point $D$ tel que $ABCD$ soit un parallélogramme ?`;
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const D = new Point("D", identifiers.xD, identifiers.yD);
|
|
19
|
+
const answer = D.toCoords();
|
|
20
|
+
return answer;
|
|
21
|
+
};
|
|
22
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
23
|
+
const question = {
|
|
24
|
+
answer: getAnswer(identifiers),
|
|
25
|
+
instruction: getInstruction(identifiers),
|
|
26
|
+
keys: coordinatesKeys,
|
|
27
|
+
answerFormat: "tex",
|
|
28
|
+
identifiers,
|
|
29
|
+
};
|
|
30
|
+
return question;
|
|
31
|
+
};
|
|
32
|
+
const getFourthParallelogramPointQuestion = () => {
|
|
33
|
+
const points = PointConstructor.randomDifferent(2, { names: ["A", "B"] });
|
|
34
|
+
const AB = VectorConstructor.fromPoints(points[0], points[1]);
|
|
35
|
+
let D;
|
|
36
|
+
do {
|
|
37
|
+
D = PointConstructor.random("D");
|
|
38
|
+
} while (AB.isColinear(VectorConstructor.fromPoints(D, points[0])));
|
|
39
|
+
const C = AB.getEndPoint(D, "C");
|
|
40
|
+
const identifiers = {
|
|
41
|
+
xA: points[0].x.evaluate({}),
|
|
42
|
+
xB: points[1].x.evaluate({}),
|
|
43
|
+
xC: C.x.evaluate({}),
|
|
44
|
+
xD: D.x.evaluate({}),
|
|
45
|
+
yA: points[0].y.evaluate({}),
|
|
46
|
+
yB: points[1].y.evaluate({}),
|
|
47
|
+
yC: C.y.evaluate({}),
|
|
48
|
+
yD: D.y.evaluate({}),
|
|
49
|
+
};
|
|
50
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
51
|
+
};
|
|
52
|
+
const getPropositions = (n, { answer, xA, xB, xC, yA, yB, yC, yD }) => {
|
|
53
|
+
const propositions = [];
|
|
54
|
+
addValidProp(propositions, answer, "tex");
|
|
55
|
+
const AB = new Vector("u", new NumberNode(xB - xA), new NumberNode(yB - yA));
|
|
56
|
+
const C = new Point("C", new NumberNode(xC), new NumberNode(yC));
|
|
57
|
+
const fakeD = AB.getEndPoint(C);
|
|
58
|
+
tryToAddWrongProp(propositions, fakeD.toCoords());
|
|
59
|
+
while (propositions.length < n) {
|
|
60
|
+
tryToAddWrongProp(propositions, `\\left(${randint(-10, 10)};${randint(-10, 10)}\\right)`);
|
|
61
|
+
}
|
|
62
|
+
return shuffle(propositions);
|
|
63
|
+
};
|
|
64
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
65
|
+
return [ans, ans.replace(",", ";"), "\\left(" + ans + "\\right)"].includes(answer);
|
|
66
|
+
};
|
|
67
|
+
export const fourthParallelogramPoint = {
|
|
68
|
+
id: "fourthParallelogramPoint",
|
|
69
|
+
label: "Déterminer les coordonnées du quatrième point d'un parallélogramme",
|
|
70
|
+
isSingleStep: true,
|
|
71
|
+
generator: (nb) => getDistinctQuestions(getFourthParallelogramPointQuestion, nb),
|
|
72
|
+
qcmTimer: 60,
|
|
73
|
+
freeTimer: 60,
|
|
74
|
+
getPropositions,
|
|
75
|
+
isAnswerValid,
|
|
76
|
+
subject: "Mathématiques",
|
|
77
|
+
getQuestionFromIdentifiers,
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/parallelogram/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
isAskingParallelogramName: boolean;
|
|
4
|
+
pointNames: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const parallelogramCriterion: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=parallelogramCriterion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelogramCriterion.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,yBAAyB,EAAE,OAAO,CAAC;IACnC,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAwMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
5
|
+
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
6
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
7
|
+
import { randomLetter } from "../../../../../utils/strings/randomLetter.js";
|
|
8
|
+
const getPropositions = (n, { answer, isAskingParallelogramName, pointNames }) => {
|
|
9
|
+
const propositions = [];
|
|
10
|
+
addValidProp(propositions, answer);
|
|
11
|
+
while (propositions.length < n) {
|
|
12
|
+
if (isAskingParallelogramName) {
|
|
13
|
+
const reversed = answer.split("").reverse().join("");
|
|
14
|
+
let fake = "";
|
|
15
|
+
do {
|
|
16
|
+
fake = shuffle(pointNames).join("");
|
|
17
|
+
} while (isParaNameValid(fake, answer));
|
|
18
|
+
tryToAddWrongProp(propositions, fake);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
let vec1 = "";
|
|
22
|
+
let vec2 = "";
|
|
23
|
+
do {
|
|
24
|
+
const shuffled = shuffle(pointNames);
|
|
25
|
+
vec1 = shuffled[0] + shuffled[1];
|
|
26
|
+
vec2 = shuffled[2] + shuffled[3];
|
|
27
|
+
} while (isVectorEqualityValid(vec1, vec2, pointNames.join("")));
|
|
28
|
+
tryToAddWrongProp(propositions, `\\overrightarrow{${vec1}}=\\overrightarrow{${vec2}}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return shuffleProps(propositions, n);
|
|
32
|
+
};
|
|
33
|
+
const isParaNameValid = (name, expectedName) => {
|
|
34
|
+
//exemple ABCDABCD contient bien tous les noms possibles dans un sens, et DCBADCBA dans l'autre
|
|
35
|
+
const reversed = expectedName.split("").reverse().join("");
|
|
36
|
+
return ((expectedName + expectedName).includes(name) ||
|
|
37
|
+
(reversed + reversed).includes(name));
|
|
38
|
+
};
|
|
39
|
+
const isVectorEqualityValid = (vec1, vec2, expectedName) => {
|
|
40
|
+
const reversed = expectedName.split("").reverse().join("");
|
|
41
|
+
const name = vec1 + vec2.split("").reverse().join("");
|
|
42
|
+
return ((expectedName + expectedName).includes(name) ||
|
|
43
|
+
(reversed + reversed).includes(name));
|
|
44
|
+
};
|
|
45
|
+
const getAnswer = (identifiers) => {
|
|
46
|
+
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
47
|
+
if (isAskingParallelogramName) {
|
|
48
|
+
return pointNames.join("");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const vec1 = `\\overrightarrow{${pointNames.slice(0, 2).join("")}}`;
|
|
52
|
+
const vec2 = `\\overrightarrow{${pointNames
|
|
53
|
+
.slice(2, 4)
|
|
54
|
+
.reverse()
|
|
55
|
+
.join("")}}`;
|
|
56
|
+
return `${vec1}=${vec2}`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const getInstruction = (identifiers) => {
|
|
60
|
+
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
61
|
+
if (isAskingParallelogramName) {
|
|
62
|
+
const vec1 = `\\overrightarrow{${pointNames.slice(0, 2).join("")}}`;
|
|
63
|
+
const vec2 = `\\overrightarrow{${pointNames
|
|
64
|
+
.slice(2, 4)
|
|
65
|
+
.reverse()
|
|
66
|
+
.join("")}}`;
|
|
67
|
+
return `Soient deux vecteurs $${vec1}$ et $${vec2}$ tels que $${vec1} = ${vec2}$.
|
|
68
|
+
|
|
69
|
+
Donner le nom du parallélogramme formé par ces vecteurs.`;
|
|
70
|
+
}
|
|
71
|
+
return `Soit un parallélogramme $${pointNames.join("")}$.
|
|
72
|
+
|
|
73
|
+
Donner une égalité entre deux vecteurs issus de ce parallélogramme.`;
|
|
74
|
+
};
|
|
75
|
+
const getHint = (identifiers) => {
|
|
76
|
+
return `$ABCD$ est un parallélogramme si et seulemtne si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.`;
|
|
77
|
+
};
|
|
78
|
+
const getCorrection = (identifiers) => {
|
|
79
|
+
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
80
|
+
if (isAskingParallelogramName) {
|
|
81
|
+
return `On sait que $ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.
|
|
82
|
+
|
|
83
|
+
Ici, le quadrilatère $${pointNames.join("")}$ est donc un parallélogramme.`;
|
|
84
|
+
}
|
|
85
|
+
return `On sait que $ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.
|
|
86
|
+
|
|
87
|
+
Ici, les vecteurs $${pointNames.slice(0, 2).join("")}$ et $${pointNames
|
|
88
|
+
.slice(2, 4)
|
|
89
|
+
.reverse()
|
|
90
|
+
.join("")}$ sont donc égaux.
|
|
91
|
+
`;
|
|
92
|
+
};
|
|
93
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
94
|
+
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
95
|
+
const ggb = new GeogebraConstructor({
|
|
96
|
+
commands: [
|
|
97
|
+
`${pointNames[0]} = (-1, 0)`,
|
|
98
|
+
`ShowLabel(${pointNames[0]}, true)`,
|
|
99
|
+
`SetFixed(${pointNames[0]}, true)`,
|
|
100
|
+
`${pointNames[1]} = (1,2)`,
|
|
101
|
+
`ShowLabel(${pointNames[1]}, true)`,
|
|
102
|
+
`SetFixed(${pointNames[1]}, true)`,
|
|
103
|
+
`${pointNames[2]} = (2, 0)`,
|
|
104
|
+
`ShowLabel(${pointNames[2]}, true)`,
|
|
105
|
+
`SetFixed(${pointNames[2]}, true)`,
|
|
106
|
+
`${pointNames[3]} = (0, -2)`,
|
|
107
|
+
`ShowLabel(${pointNames[3]}, true)`,
|
|
108
|
+
`SetFixed(${pointNames[3]}, true)`,
|
|
109
|
+
`Polygon(${pointNames.join(",")})`,
|
|
110
|
+
`Vector(${pointNames[0]}, ${pointNames[1]})`,
|
|
111
|
+
`Vector(${pointNames[3]}, ${pointNames[2]})`,
|
|
112
|
+
],
|
|
113
|
+
hideAxes: true,
|
|
114
|
+
});
|
|
115
|
+
return ggb.getOptions({
|
|
116
|
+
coords: [-2, 3, -3, 3],
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
const getKeys = (identifiers) => {
|
|
120
|
+
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
121
|
+
const sorted = [...pointNames].sort((a, b) => a.localeCompare(b));
|
|
122
|
+
if (isAskingParallelogramName) {
|
|
123
|
+
return sorted;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return ["overrightarrow", "equal", ...sorted];
|
|
127
|
+
}
|
|
128
|
+
return [];
|
|
129
|
+
};
|
|
130
|
+
const isAnswerValid = (ans, { answer, isAskingParallelogramName, pointNames }) => {
|
|
131
|
+
try {
|
|
132
|
+
if (isAskingParallelogramName) {
|
|
133
|
+
if (ans.length !== 4)
|
|
134
|
+
return false;
|
|
135
|
+
return isParaNameValid(ans, answer);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
//on crée le nom du parallélogramme ici de l'égalité et on check comme au dessus
|
|
139
|
+
let splitted = ans.split("=");
|
|
140
|
+
if (splitted.length !== 2)
|
|
141
|
+
return false;
|
|
142
|
+
if (splitted.some((e) => !e.startsWith("\\overrightarrow")))
|
|
143
|
+
return false;
|
|
144
|
+
splitted = splitted.map((e) => e.replace("\\overrightarrow{", "").replace("}", ""));
|
|
145
|
+
if (splitted.some((e) => e.length !== 2))
|
|
146
|
+
return false;
|
|
147
|
+
return isVectorEqualityValid(splitted[0], splitted[1], pointNames.join(""));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
return handleVEAError(err);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const getParallelogramCriterionQuestion = (ops) => {
|
|
155
|
+
const A = randomLetter(true);
|
|
156
|
+
const B = randomLetter(true, [A]);
|
|
157
|
+
const C = randomLetter(true, [A, B]);
|
|
158
|
+
const D = randomLetter(true, [A, B, C]);
|
|
159
|
+
const identifiers = {
|
|
160
|
+
isAskingParallelogramName: coinFlip(),
|
|
161
|
+
pointNames: [A, B, C, D],
|
|
162
|
+
};
|
|
163
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
164
|
+
};
|
|
165
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
166
|
+
return {
|
|
167
|
+
answer: getAnswer(identifiers),
|
|
168
|
+
instruction: getInstruction(identifiers),
|
|
169
|
+
keys: getKeys(identifiers),
|
|
170
|
+
answerFormat: "tex",
|
|
171
|
+
identifiers,
|
|
172
|
+
hint: getHint(identifiers),
|
|
173
|
+
correction: getCorrection(identifiers),
|
|
174
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export const parallelogramCriterion = {
|
|
178
|
+
id: "parallelogramCriterion",
|
|
179
|
+
label: "Utiliser la propriété caractéristique du parallélogramme",
|
|
180
|
+
isSingleStep: true,
|
|
181
|
+
generator: (nb, opts) => getDistinctQuestions(() => getParallelogramCriterionQuestion(opts), nb),
|
|
182
|
+
qcmTimer: 60,
|
|
183
|
+
freeTimer: 60,
|
|
184
|
+
getPropositions,
|
|
185
|
+
isAnswerValid,
|
|
186
|
+
subject: "Mathématiques",
|
|
187
|
+
getInstruction,
|
|
188
|
+
getHint,
|
|
189
|
+
getCorrection,
|
|
190
|
+
getAnswer,
|
|
191
|
+
getQuestionFromIdentifiers,
|
|
192
|
+
hasHintAndCorrection: true,
|
|
193
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xA: number;
|
|
4
|
+
xB: number;
|
|
5
|
+
xC: number;
|
|
6
|
+
xD: number;
|
|
7
|
+
yA: number;
|
|
8
|
+
yB: number;
|
|
9
|
+
yC: number;
|
|
10
|
+
yD: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const parallelogramViaEqualVectors: Exercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=parallelogramViaEqualVectors.d.ts.map
|
package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelogramViaEqualVectors.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,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,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4GF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor } from "../../../../../math/geometry/point.js";
|
|
4
|
+
import { Vector, VectorConstructor } from "../../../../../math/geometry/vector.js";
|
|
5
|
+
import { substract, } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
6
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
7
|
+
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
8
|
+
const getInstruction = (identifiers) => {
|
|
9
|
+
const A = new Point("A", identifiers.xA, identifiers.yA);
|
|
10
|
+
const B = new Point("B", identifiers.xB, identifiers.yB);
|
|
11
|
+
const C = new Point("C", identifiers.xC, identifiers.yC);
|
|
12
|
+
const D = new Point("D", identifiers.xD, identifiers.yD);
|
|
13
|
+
return `Soient les points $${A.toTexWithCoords()}$, $${B.toTexWithCoords()}$, $${C.toTexWithCoords()}$ et $${D.toTexWithCoords()}$.
|
|
14
|
+
|
|
15
|
+
$ABCD$ est-il un parallélogramme ?`;
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const A = new Point("A", identifiers.xA, identifiers.yA);
|
|
19
|
+
const B = new Point("B", identifiers.xB, identifiers.yB);
|
|
20
|
+
const C = new Point("C", identifiers.xC, identifiers.yC);
|
|
21
|
+
const D = new Point("D", identifiers.xD, identifiers.yD);
|
|
22
|
+
const vec1 = VectorConstructor.fromPoints(A, B);
|
|
23
|
+
const vec2 = VectorConstructor.fromPoints(D, C);
|
|
24
|
+
const isParallelogram = vec1.equals(vec2);
|
|
25
|
+
const answer = isParallelogram ? "Oui" : "Non";
|
|
26
|
+
return answer;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return `$ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.`;
|
|
30
|
+
};
|
|
31
|
+
const getCorrection = (identifiers) => {
|
|
32
|
+
const A = new Point("A", identifiers.xA, identifiers.yA);
|
|
33
|
+
const B = new Point("B", identifiers.xB, identifiers.yB);
|
|
34
|
+
const C = new Point("C", identifiers.xC, identifiers.yC);
|
|
35
|
+
const D = new Point("D", identifiers.xD, identifiers.yD);
|
|
36
|
+
const vec1 = new Vector("AB", substract(B.x, A.x), substract(B.y, A.y));
|
|
37
|
+
const vec2 = new Vector("DC", substract(C.x, D.x), substract(C.y, D.y));
|
|
38
|
+
const vec1Simp = vec1.simplify();
|
|
39
|
+
const vec2Simp = vec2.simplify();
|
|
40
|
+
const isParallelogram = vec1Simp.equals(vec2Simp);
|
|
41
|
+
return `$ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux. On calcule donc les coordonnées de ces vecteurs :
|
|
42
|
+
|
|
43
|
+
$$
|
|
44
|
+
${vec1.toTexWithCoords()}=${vec1Simp.toBinomCoords().toTex()}
|
|
45
|
+
$$
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
${vec2.toTexWithCoords()}=${vec2Simp.toBinomCoords().toTex()}
|
|
49
|
+
$$
|
|
50
|
+
|
|
51
|
+
${isParallelogram
|
|
52
|
+
? `Puisque les vecteurs sont égaux, $ABCD$ est un parallélogramme.`
|
|
53
|
+
: `Puisque les vecteurs ne sont pas égaux, $ABCD$ n'est pas un parallélogramme.`}`;
|
|
54
|
+
};
|
|
55
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
56
|
+
const question = {
|
|
57
|
+
answer: getAnswer(identifiers),
|
|
58
|
+
instruction: getInstruction(identifiers),
|
|
59
|
+
keys: [],
|
|
60
|
+
answerFormat: "raw",
|
|
61
|
+
identifiers,
|
|
62
|
+
hint: getHint(identifiers),
|
|
63
|
+
correction: getCorrection(identifiers),
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
};
|
|
67
|
+
const getParallelogramViaEqualVectorsQuestion = () => {
|
|
68
|
+
const points = PointConstructor.randomDifferent(2, { names: ["A", "B"] });
|
|
69
|
+
const AB = VectorConstructor.fromPoints(points[0], points[1]);
|
|
70
|
+
let D;
|
|
71
|
+
do {
|
|
72
|
+
D = PointConstructor.random("D");
|
|
73
|
+
} while (AB.isColinear(VectorConstructor.fromPoints(D, points[0])));
|
|
74
|
+
let C;
|
|
75
|
+
const isParallelogram = coinFlip();
|
|
76
|
+
if (isParallelogram) {
|
|
77
|
+
C = AB.getEndPoint(D, "C");
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
do {
|
|
81
|
+
C = PointConstructor.random("C");
|
|
82
|
+
} while (AB.equals(VectorConstructor.fromPoints(D, C)));
|
|
83
|
+
}
|
|
84
|
+
const identifiers = {
|
|
85
|
+
xA: points[0].x.evaluate({}),
|
|
86
|
+
xB: points[1].x.evaluate({}),
|
|
87
|
+
xC: C.x.evaluate({}),
|
|
88
|
+
xD: D.x.evaluate({}),
|
|
89
|
+
yA: points[0].y.evaluate({}),
|
|
90
|
+
yB: points[1].y.evaluate({}),
|
|
91
|
+
yC: C.y.evaluate({}),
|
|
92
|
+
yD: D.y.evaluate({}),
|
|
93
|
+
};
|
|
94
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
95
|
+
};
|
|
96
|
+
const getPropositions = (n, { answer }) => {
|
|
97
|
+
const propositions = [];
|
|
98
|
+
addValidProp(propositions, answer, "raw");
|
|
99
|
+
tryToAddWrongProp(propositions, "Oui", "raw");
|
|
100
|
+
tryToAddWrongProp(propositions, "Non", "raw");
|
|
101
|
+
tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
|
|
102
|
+
return shuffle(propositions);
|
|
103
|
+
};
|
|
104
|
+
export const parallelogramViaEqualVectors = {
|
|
105
|
+
id: "parallelogramViaEqualVectors",
|
|
106
|
+
label: "Utiliser les vecteurs pour reconnaître un parallélogramme",
|
|
107
|
+
isSingleStep: true,
|
|
108
|
+
generator: (nb) => getDistinctQuestions(getParallelogramViaEqualVectorsQuestion, nb),
|
|
109
|
+
qcmTimer: 60,
|
|
110
|
+
freeTimer: 60,
|
|
111
|
+
getPropositions,
|
|
112
|
+
answerType: "QCU",
|
|
113
|
+
subject: "Mathématiques",
|
|
114
|
+
getQuestionFromIdentifiers,
|
|
115
|
+
hasHintAndCorrection: true,
|
|
116
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
points: string[][];
|
|
4
|
+
pointAskedIndex: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const translationFromPicture: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=translationFromPicture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translationFromPicture.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/translationFromPicture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;CAG3B,CAAC;AAqGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|