math-exercises 2.0.20 → 2.0.22
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/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +8 -7
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +3 -2
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.js +2 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.js +2 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.js +2 -1
- package/lib/exercises/geometry/vectors/alignementViaColinearity.d.ts +12 -0
- package/lib/exercises/geometry/vectors/alignementViaColinearity.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/alignementViaColinearity.js +64 -0
- package/lib/exercises/geometry/vectors/colinearity.d.ts +10 -0
- package/lib/exercises/geometry/vectors/colinearity.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/colinearity.js +59 -0
- package/lib/exercises/geometry/vectors/fourthParallelogramPoint.d.ts +14 -0
- package/lib/exercises/geometry/vectors/fourthParallelogramPoint.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/fourthParallelogramPoint.js +65 -0
- package/lib/exercises/geometry/vectors/index.d.ts +5 -0
- package/lib/exercises/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/index.js +5 -0
- package/lib/exercises/geometry/vectors/paralellismViaColinearity.d.ts +14 -0
- package/lib/exercises/geometry/vectors/paralellismViaColinearity.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/paralellismViaColinearity.js +75 -0
- package/lib/exercises/geometry/vectors/parallelogramViaEqualVectors.d.ts +14 -0
- package/lib/exercises/geometry/vectors/parallelogramViaEqualVectors.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/parallelogramViaEqualVectors.js +67 -0
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.js +1 -1
- package/lib/exercises/probaStat/independancy.d.ts +9 -0
- package/lib/exercises/probaStat/independancy.d.ts.map +1 -0
- package/lib/exercises/probaStat/independancy.js +59 -0
- package/lib/exercises/probaStat/index.d.ts +1 -0
- package/lib/exercises/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/probaStat/index.js +1 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +1 -1
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +1 -1
- package/lib/exercises/utils/keys/coordinatesKeys.d.ts +3 -0
- package/lib/exercises/utils/keys/coordinatesKeys.d.ts.map +1 -0
- package/lib/exercises/utils/keys/coordinatesKeys.js +4 -0
- package/lib/index.d.ts +43 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +11 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +46 -0
- package/lib/math/geometry/point.d.ts +4 -15
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +29 -20
- package/lib/math/geometry/vector.d.ts +10 -5
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +21 -3
- package/lib/math/numbers/decimals/decimal.d.ts +1 -2
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +31 -87
- package/lib/math/numbers/reals/extendedRingElement.d.ts +2 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/server.js +0 -10
- package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +2 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -15,15 +15,16 @@ const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
|
|
|
15
15
|
const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
|
|
16
16
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
17
17
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
18
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
18
19
|
const getEquationType3ExerciseQuestion = () => {
|
|
19
20
|
const interval = new intervals_1.Interval("[[-10; 10]]");
|
|
20
21
|
const intervalStar = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
21
|
-
const b =
|
|
22
|
-
const a =
|
|
23
|
-
const c =
|
|
24
|
-
const affine = new affine_1.Affine(a
|
|
25
|
-
const solution = new rational_1.Rational(c
|
|
26
|
-
const statementTree = new equalNode_1.EqualNode(affine,
|
|
22
|
+
const b = (0, randint_1.randint)(-10, 11, [0]);
|
|
23
|
+
const a = (0, randint_1.randint)(-10, 11, [0, 1]);
|
|
24
|
+
const c = (0, randint_1.randint)(-10, 11);
|
|
25
|
+
const affine = new affine_1.Affine(a, b).toTree();
|
|
26
|
+
const solution = new rational_1.Rational(c - b, a).simplify();
|
|
27
|
+
const statementTree = new equalNode_1.EqualNode(affine, new numberNode_1.NumberNode(c));
|
|
27
28
|
const answerTree = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), solution.toTree());
|
|
28
29
|
const answer = answerTree.toTex();
|
|
29
30
|
const question = {
|
|
@@ -32,7 +33,7 @@ const getEquationType3ExerciseQuestion = () => {
|
|
|
32
33
|
answer,
|
|
33
34
|
keys: equationKeys_1.equationKeys,
|
|
34
35
|
answerFormat: "tex",
|
|
35
|
-
identifiers: { a
|
|
36
|
+
identifiers: { a, b, c },
|
|
36
37
|
};
|
|
37
38
|
return question;
|
|
38
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA8DF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}
|
|
@@ -13,15 +13,16 @@ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
|
13
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
14
14
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
15
15
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
16
|
+
/**x +b < c */
|
|
16
17
|
const getFirstDegreeInequationsQuestion = () => {
|
|
17
|
-
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 11));
|
|
18
|
+
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 11, [0]));
|
|
18
19
|
const c = (0, randint_1.randint)(-10, 11);
|
|
19
20
|
const result = c - affine.b;
|
|
20
21
|
const ineqType = inequation_1.InequationSymbolConstructor.random();
|
|
21
22
|
const answer = `x${ineqType.symbol}${result}`;
|
|
22
23
|
const question = {
|
|
23
24
|
answer: answer,
|
|
24
|
-
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
|
|
25
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType.symbol} ${c}$ `,
|
|
25
26
|
keys: inequationKeys_1.inequationKeys,
|
|
26
27
|
answerFormat: "tex",
|
|
27
28
|
identifiers: { ineqType: ineqType.symbol, b: affine.b, c },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAS3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAqEF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAcjE,CAAC"}
|
|
@@ -13,6 +13,7 @@ const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequa
|
|
|
13
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
14
14
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
15
15
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
16
|
+
/**ax<b */
|
|
16
17
|
const getFirstDegreeInequationsQuestion = () => {
|
|
17
18
|
const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), 0);
|
|
18
19
|
const b = (0, randint_1.randint)(-10, 11);
|
|
@@ -22,7 +23,7 @@ const getFirstDegreeInequationsQuestion = () => {
|
|
|
22
23
|
const answer = `x${affine.a > 0 ? ineqType.symbol : invIneqType}${result}`;
|
|
23
24
|
const question = {
|
|
24
25
|
answer: answer,
|
|
25
|
-
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${b}$ `,
|
|
26
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType.symbol} ${b}$ `,
|
|
26
27
|
keys: inequationKeys_1.inequationKeys,
|
|
27
28
|
answerFormat: "tex",
|
|
28
29
|
identifiers: { a: affine.a, b, ineqType: ineqType.symbol },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAc3C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAc3C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyEF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}
|
|
@@ -13,6 +13,7 @@ const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequa
|
|
|
13
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
14
14
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
15
15
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
16
|
+
/**ax+b<c */
|
|
16
17
|
const getFirstDegreeInequationsQuestion = () => {
|
|
17
18
|
const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), (0, randint_1.randint)(-10, 10, [0]));
|
|
18
19
|
const c = (0, randint_1.randint)(-10, 11);
|
|
@@ -25,7 +26,7 @@ const getFirstDegreeInequationsQuestion = () => {
|
|
|
25
26
|
const answer = `x${affine.a > 0 ? ineqType.symbol : invIneqType}${result}`;
|
|
26
27
|
const question = {
|
|
27
28
|
answer: answer,
|
|
28
|
-
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
|
|
29
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType.symbol} ${c}$ `,
|
|
29
30
|
keys: inequationKeys_1.inequationKeys,
|
|
30
31
|
answerFormat: "tex",
|
|
31
32
|
identifiers: { a: affine.a, b: affine.b, c, ineqType: ineqType.symbol },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}
|
|
@@ -13,6 +13,7 @@ const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequa
|
|
|
13
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
14
14
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
15
15
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
16
|
+
/**ax+b<cx+d */
|
|
16
17
|
const getFirstDegreeInequationsQuestion = () => {
|
|
17
18
|
const affine1 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0]), (0, randint_1.randint)(-10, 10));
|
|
18
19
|
const affine2 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, affine1.a]), (0, randint_1.randint)(-10, 10));
|
|
@@ -26,7 +27,7 @@ const getFirstDegreeInequationsQuestion = () => {
|
|
|
26
27
|
const answer = `x${coeff > 0 ? ineqType.symbol : invIneqType}${result}`;
|
|
27
28
|
const question = {
|
|
28
29
|
answer: answer,
|
|
29
|
-
instruction: `Résoudre l'inéquation : $${affine1.toTex()} ${ineqType} ${affine2.toTex()}$ `,
|
|
30
|
+
instruction: `Résoudre l'inéquation : $${affine1.toTex()} ${ineqType.symbol} ${affine2.toTex()}$ `,
|
|
30
31
|
keys: inequationKeys_1.inequationKeys,
|
|
31
32
|
answerFormat: "tex",
|
|
32
33
|
identifiers: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xA: number;
|
|
4
|
+
xB: number;
|
|
5
|
+
xC: number;
|
|
6
|
+
yA: number;
|
|
7
|
+
yB: number;
|
|
8
|
+
yC: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const alignementViaColinearity: MathExercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=alignementViaColinearity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignementViaColinearity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/alignementViaColinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,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;CACZ,CAAC;AAkDF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,WAAW,CAY9D,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alignementViaColinearity = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const point_1 = require("../../../math/geometry/point");
|
|
7
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
8
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
11
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
|
+
const getAlignementViaColinearityQuestion = () => {
|
|
13
|
+
const points = point_1.PointConstructor.randomDifferent(["A", "B"]);
|
|
14
|
+
const AB = vector_1.VectorConstructor.fromPoints(points[0], points[1]);
|
|
15
|
+
let C;
|
|
16
|
+
const isAligned = (0, coinFlip_1.coinFlip)();
|
|
17
|
+
const coeff = new numberNode_1.NumberNode((0, randint_1.randint)(-4, 4, [0, 1]));
|
|
18
|
+
if (isAligned) {
|
|
19
|
+
console.log("1");
|
|
20
|
+
C = AB.times(coeff).getEndPoint(points[0], "C");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
do {
|
|
24
|
+
console.log(`2 : ${AB.x.toTex()} et ${AB.y.toTex()}`);
|
|
25
|
+
C = point_1.PointConstructor.random("C");
|
|
26
|
+
} while (AB.isColinear(vector_1.VectorConstructor.fromPoints(points[0], C)));
|
|
27
|
+
}
|
|
28
|
+
const answer = isAligned ? "Oui" : "Non";
|
|
29
|
+
const question = {
|
|
30
|
+
answer,
|
|
31
|
+
instruction: `Soient trois points $${points[0].toTexWithCoords()}$, $${points[1].toTexWithCoords()}$ et $${C.toTexWithCoords()}$. Les points $A$, $B$ et $C$ sont-ils alignés ?`,
|
|
32
|
+
keys: [],
|
|
33
|
+
answerFormat: "raw",
|
|
34
|
+
identifiers: {
|
|
35
|
+
xA: points[0].x.evaluate({}),
|
|
36
|
+
xB: points[1].x.evaluate({}),
|
|
37
|
+
xC: C.x.evaluate({}),
|
|
38
|
+
yA: points[0].y.evaluate({}),
|
|
39
|
+
yB: points[1].y.evaluate({}),
|
|
40
|
+
yC: C.y.evaluate({}),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
return question;
|
|
44
|
+
};
|
|
45
|
+
const getPropositions = (n, { answer }) => {
|
|
46
|
+
const propositions = [];
|
|
47
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
48
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
49
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
50
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
51
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
52
|
+
};
|
|
53
|
+
exports.alignementViaColinearity = {
|
|
54
|
+
id: "alignementViaColinearity",
|
|
55
|
+
label: "Utiliser la colinéarité pour déterminer un alignement",
|
|
56
|
+
levels: ["2nde", "1reSpé"],
|
|
57
|
+
isSingleStep: true,
|
|
58
|
+
sections: ["Vecteurs", "Droites"],
|
|
59
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAlignementViaColinearityQuestion, nb),
|
|
60
|
+
qcmTimer: 60,
|
|
61
|
+
freeTimer: 60,
|
|
62
|
+
getPropositions,
|
|
63
|
+
answerType: "QCM",
|
|
64
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xu: number;
|
|
4
|
+
yu: number;
|
|
5
|
+
xv: number;
|
|
6
|
+
yv: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const colinearity: MathExercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=colinearity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colinearity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/colinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyCF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAWjD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.colinearity = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const getColinearityQuestion = () => {
|
|
12
|
+
const u = vector_1.VectorConstructor.random("u", false);
|
|
13
|
+
const isColinear = (0, coinFlip_1.coinFlip)();
|
|
14
|
+
let v;
|
|
15
|
+
if (isColinear) {
|
|
16
|
+
const coeff = new numberNode_1.NumberNode((0, randint_1.randint)(-5, 5));
|
|
17
|
+
v = u.times(coeff, "v");
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
do {
|
|
21
|
+
v = vector_1.VectorConstructor.random("v", false);
|
|
22
|
+
} while (u.isColinear(v));
|
|
23
|
+
}
|
|
24
|
+
// const isColinear = u.isColinear(v);
|
|
25
|
+
const answer = isColinear ? "Oui" : "Non";
|
|
26
|
+
const question = {
|
|
27
|
+
answer,
|
|
28
|
+
instruction: `Soit deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$. $${u.toTex()}$ et $${v.toTex()}$ sont-ils colinéaires ?`,
|
|
29
|
+
keys: [],
|
|
30
|
+
answerFormat: "raw",
|
|
31
|
+
identifiers: {
|
|
32
|
+
xu: u.x.evaluate({}),
|
|
33
|
+
xv: v.x.evaluate({}),
|
|
34
|
+
yu: u.y.evaluate({}),
|
|
35
|
+
yv: v.y.evaluate({}),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
return question;
|
|
39
|
+
};
|
|
40
|
+
const getPropositions = (n, { answer }) => {
|
|
41
|
+
const propositions = [];
|
|
42
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
46
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
47
|
+
};
|
|
48
|
+
exports.colinearity = {
|
|
49
|
+
id: "colinearity",
|
|
50
|
+
label: "Déterminer si deux vecteurs sont colinéaires",
|
|
51
|
+
levels: ["2nde", "1reSpé"],
|
|
52
|
+
isSingleStep: true,
|
|
53
|
+
sections: ["Vecteurs"],
|
|
54
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getColinearityQuestion, nb),
|
|
55
|
+
qcmTimer: 60,
|
|
56
|
+
freeTimer: 60,
|
|
57
|
+
getPropositions,
|
|
58
|
+
answerType: "QCM",
|
|
59
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
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: MathExercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=fourthParallelogramPoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fourthParallelogramPoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/fourthParallelogramPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAWlC,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;AAwDF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,WAAW,CAY9D,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fourthParallelogramPoint = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const coordinatesKeys_1 = require("../../../exercises/utils/keys/coordinatesKeys");
|
|
7
|
+
const point_1 = require("../../../math/geometry/point");
|
|
8
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
10
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
11
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
|
+
const getFourthParallelogramPointQuestion = () => {
|
|
13
|
+
const points = point_1.PointConstructor.randomDifferent(["A", "B"]);
|
|
14
|
+
const AB = vector_1.VectorConstructor.fromPoints(points[0], points[1]);
|
|
15
|
+
let D;
|
|
16
|
+
do {
|
|
17
|
+
D = point_1.PointConstructor.random("D");
|
|
18
|
+
} while (AB.isColinear(vector_1.VectorConstructor.fromPoints(D, points[0])));
|
|
19
|
+
const C = AB.getEndPoint(D, "C");
|
|
20
|
+
const answer = D.toCoords();
|
|
21
|
+
const question = {
|
|
22
|
+
answer,
|
|
23
|
+
instruction: `Soient les points $${points[0].toTexWithCoords()}$, $${points[1].toTexWithCoords()}$, et $${C.toTexWithCoords()}$. Quelles sont les coordonnées du point $D$ tel que $ABCD$ soit un parallélogramme ?`,
|
|
24
|
+
keys: coordinatesKeys_1.coordinatesKeys,
|
|
25
|
+
answerFormat: "tex",
|
|
26
|
+
identifiers: {
|
|
27
|
+
xA: points[0].x.evaluate({}),
|
|
28
|
+
xB: points[1].x.evaluate({}),
|
|
29
|
+
xC: C.x.evaluate({}),
|
|
30
|
+
xD: D.x.evaluate({}),
|
|
31
|
+
yA: points[0].y.evaluate({}),
|
|
32
|
+
yB: points[1].y.evaluate({}),
|
|
33
|
+
yC: C.y.evaluate({}),
|
|
34
|
+
yD: D.y.evaluate({}),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
};
|
|
39
|
+
const getPropositions = (n, { answer, xA, xB, xC, yA, yB, yC, yD }) => {
|
|
40
|
+
const propositions = [];
|
|
41
|
+
(0, exercise_1.addValidProp)(propositions, answer, "tex");
|
|
42
|
+
const AB = new vector_1.Vector("u", new numberNode_1.NumberNode(xB - xA), new numberNode_1.NumberNode(yB - yA));
|
|
43
|
+
const C = new point_1.Point("C", new numberNode_1.NumberNode(xC), new numberNode_1.NumberNode(yC));
|
|
44
|
+
const fakeD = AB.getEndPoint(C);
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, fakeD.toCoords());
|
|
46
|
+
while (propositions.length < n) {
|
|
47
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `\\left(${(0, randint_1.randint)(-10, 10)};${(0, randint_1.randint)(-10, 10)}\\right)`);
|
|
48
|
+
}
|
|
49
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
50
|
+
};
|
|
51
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
52
|
+
return [ans, ans.replace(",", ";"), "\\left(" + ans + "\\right)"].includes(answer);
|
|
53
|
+
};
|
|
54
|
+
exports.fourthParallelogramPoint = {
|
|
55
|
+
id: "fourthParallelogramPoint",
|
|
56
|
+
label: "Déterminer les coordonnées du quatrième point d'un parallélogramme",
|
|
57
|
+
levels: ["2nde", "1reSpé"],
|
|
58
|
+
isSingleStep: true,
|
|
59
|
+
sections: ["Vecteurs", "Droites"],
|
|
60
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFourthParallelogramPointQuestion, nb),
|
|
61
|
+
qcmTimer: 60,
|
|
62
|
+
freeTimer: 60,
|
|
63
|
+
getPropositions,
|
|
64
|
+
isAnswerValid,
|
|
65
|
+
};
|
|
@@ -4,4 +4,9 @@ export * from "./determinant";
|
|
|
4
4
|
export * from "./scalarProductViaCoords";
|
|
5
5
|
export * from "./vectorCoordinatesFromTwoPoints";
|
|
6
6
|
export * from "./scalarProductViaCos";
|
|
7
|
+
export * from "./colinearity";
|
|
8
|
+
export * from "./alignementViaColinearity";
|
|
9
|
+
export * from "./paralellismViaColinearity";
|
|
10
|
+
export * from "./parallelogramViaEqualVectors";
|
|
11
|
+
export * from "./fourthParallelogramPoint";
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}
|
|
@@ -20,3 +20,8 @@ __exportStar(require("./determinant"), exports);
|
|
|
20
20
|
__exportStar(require("./scalarProductViaCoords"), exports);
|
|
21
21
|
__exportStar(require("./vectorCoordinatesFromTwoPoints"), exports);
|
|
22
22
|
__exportStar(require("./scalarProductViaCos"), exports);
|
|
23
|
+
__exportStar(require("./colinearity"), exports);
|
|
24
|
+
__exportStar(require("./alignementViaColinearity"), exports);
|
|
25
|
+
__exportStar(require("./paralellismViaColinearity"), exports);
|
|
26
|
+
__exportStar(require("./parallelogramViaEqualVectors"), exports);
|
|
27
|
+
__exportStar(require("./fourthParallelogramPoint"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
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 paralellismViaColinearity: MathExercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=paralellismViaColinearity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paralellismViaColinearity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/paralellismViaColinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAalC,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;AA2DF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,WAAW,CAY/D,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paralellismViaColinearity = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const line_1 = require("../../../math/geometry/line");
|
|
7
|
+
const point_1 = require("../../../math/geometry/point");
|
|
8
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
10
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
11
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
12
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
+
const getParalellismViaColinearityQuestion = () => {
|
|
14
|
+
let points = [];
|
|
15
|
+
do {
|
|
16
|
+
points = point_1.PointConstructor.randomDifferent(["A", "B"]);
|
|
17
|
+
} while (points[0].x.equals(points[1].x));
|
|
18
|
+
const line = new line_1.Line(points[0], points[1]);
|
|
19
|
+
let C;
|
|
20
|
+
do {
|
|
21
|
+
C = point_1.PointConstructor.random("C");
|
|
22
|
+
} while (line.includes(C));
|
|
23
|
+
let D;
|
|
24
|
+
const coeff = new numberNode_1.NumberNode((0, randint_1.randint)(-4, 4, [0]));
|
|
25
|
+
const parallele = line.getParallele(C);
|
|
26
|
+
const isParallele = (0, coinFlip_1.coinFlip)();
|
|
27
|
+
if (isParallele) {
|
|
28
|
+
D = vector_1.VectorConstructor.fromPoints(points[0], points[1])
|
|
29
|
+
.times(coeff)
|
|
30
|
+
.getEndPoint(C, "D");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
do {
|
|
34
|
+
D = point_1.PointConstructor.random("D");
|
|
35
|
+
} while (parallele.includes(D));
|
|
36
|
+
}
|
|
37
|
+
const answer = isParallele ? "Oui" : "Non";
|
|
38
|
+
const question = {
|
|
39
|
+
answer,
|
|
40
|
+
instruction: `Soient les points $${points[0].toTexWithCoords()}$, $${points[1].toTexWithCoords()}$, $${C.toTexWithCoords()}$ et $${D.toTexWithCoords()}$. Les droites $(AB)$ et $(CD)$ sont-elles parallèles ?`,
|
|
41
|
+
keys: [],
|
|
42
|
+
answerFormat: "raw",
|
|
43
|
+
identifiers: {
|
|
44
|
+
xA: points[0].x.evaluate({}),
|
|
45
|
+
xB: points[1].x.evaluate({}),
|
|
46
|
+
xC: C.x.evaluate({}),
|
|
47
|
+
xD: D.x.evaluate({}),
|
|
48
|
+
yA: points[0].y.evaluate({}),
|
|
49
|
+
yB: points[1].y.evaluate({}),
|
|
50
|
+
yC: C.y.evaluate({}),
|
|
51
|
+
yD: D.y.evaluate({}),
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return question;
|
|
55
|
+
};
|
|
56
|
+
const getPropositions = (n, { answer }) => {
|
|
57
|
+
const propositions = [];
|
|
58
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
59
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
60
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
61
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
62
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
63
|
+
};
|
|
64
|
+
exports.paralellismViaColinearity = {
|
|
65
|
+
id: "paralellismViaColinearity",
|
|
66
|
+
label: "Utiliser la colinéarité pour déterminer un parallélisme",
|
|
67
|
+
levels: ["2nde", "1reSpé"],
|
|
68
|
+
isSingleStep: true,
|
|
69
|
+
sections: ["Vecteurs", "Droites"],
|
|
70
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParalellismViaColinearityQuestion, nb),
|
|
71
|
+
qcmTimer: 60,
|
|
72
|
+
freeTimer: 60,
|
|
73
|
+
getPropositions,
|
|
74
|
+
answerType: "QCM",
|
|
75
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
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: MathExercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=parallelogramViaEqualVectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelogramViaEqualVectors.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/parallelogramViaEqualVectors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAWlC,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;AAyDF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAYlE,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parallelogramViaEqualVectors = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const point_1 = require("../../../math/geometry/point");
|
|
7
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const getParallelogramViaEqualVectorsQuestion = () => {
|
|
11
|
+
const points = point_1.PointConstructor.randomDifferent(["A", "B"]);
|
|
12
|
+
const AB = vector_1.VectorConstructor.fromPoints(points[0], points[1]);
|
|
13
|
+
let D;
|
|
14
|
+
do {
|
|
15
|
+
console.log(`1 : points: ${points.map((p) => p.toCoords())}, vec : ${AB.x.toTex()} et ${AB.y.toTex()}`);
|
|
16
|
+
D = point_1.PointConstructor.random("D");
|
|
17
|
+
} while (AB.isColinear(vector_1.VectorConstructor.fromPoints(D, points[0])));
|
|
18
|
+
let C;
|
|
19
|
+
const isParallelogram = (0, coinFlip_1.coinFlip)();
|
|
20
|
+
if (isParallelogram) {
|
|
21
|
+
C = AB.getEndPoint(D, "C");
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
do {
|
|
25
|
+
console.log("2");
|
|
26
|
+
C = point_1.PointConstructor.random("C");
|
|
27
|
+
} while (AB.equals(vector_1.VectorConstructor.fromPoints(D, C)));
|
|
28
|
+
}
|
|
29
|
+
const answer = isParallelogram ? "Oui" : "Non";
|
|
30
|
+
const question = {
|
|
31
|
+
answer,
|
|
32
|
+
instruction: `Soient les points $${points[0].toTexWithCoords()}$, $${points[1].toTexWithCoords()}$, $${C.toTexWithCoords()}$ et $${D.toTexWithCoords()}$. $ABCD$ est-il un parallélogramme ?`,
|
|
33
|
+
keys: [],
|
|
34
|
+
answerFormat: "raw",
|
|
35
|
+
identifiers: {
|
|
36
|
+
xA: points[0].x.evaluate({}),
|
|
37
|
+
xB: points[1].x.evaluate({}),
|
|
38
|
+
xC: C.x.evaluate({}),
|
|
39
|
+
xD: D.x.evaluate({}),
|
|
40
|
+
yA: points[0].y.evaluate({}),
|
|
41
|
+
yB: points[1].y.evaluate({}),
|
|
42
|
+
yC: C.y.evaluate({}),
|
|
43
|
+
yD: D.y.evaluate({}),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
return question;
|
|
47
|
+
};
|
|
48
|
+
const getPropositions = (n, { answer }) => {
|
|
49
|
+
const propositions = [];
|
|
50
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
52
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
54
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
55
|
+
};
|
|
56
|
+
exports.parallelogramViaEqualVectors = {
|
|
57
|
+
id: "parallelogramViaEqualVectors",
|
|
58
|
+
label: "Utiliser les vecteurs pour reconnaître un parallélogramme",
|
|
59
|
+
levels: ["2nde", "1reSpé"],
|
|
60
|
+
isSingleStep: true,
|
|
61
|
+
sections: ["Vecteurs", "Droites"],
|
|
62
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParallelogramViaEqualVectorsQuestion, nb),
|
|
63
|
+
qcmTimer: 60,
|
|
64
|
+
freeTimer: 60,
|
|
65
|
+
getPropositions,
|
|
66
|
+
answerType: "QCM",
|
|
67
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AAyDF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CAapE,CAAC"}
|
|
@@ -35,7 +35,7 @@ const getPropositions = (n, { answer, A, B }) => {
|
|
|
35
35
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
36
36
|
};
|
|
37
37
|
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
-
return ans
|
|
38
|
+
return [ans, ans.replace(",", ";"), "\\left(" + ans + "\\right)"].includes(answer);
|
|
39
39
|
};
|
|
40
40
|
exports.vectorCoordinatesFromTwoPoints = {
|
|
41
41
|
id: "vectorCoordinatesFromTwoPoints",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"independancy.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/independancy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAiDF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAalD,CAAC"}
|