math-exercises 1.3.30 → 1.3.32
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/calcul/fractions/fractionToPercentToDecimal.js +2 -2
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +39 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +39 -0
- package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/aeraConversion.js +4 -2
- package/lib/exercises/conversion/capacityConversion.js +1 -1
- package/lib/exercises/conversion/lengthConversion.js +1 -1
- package/lib/exercises/conversion/massConversion.js +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.js +5 -3
- package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeConversion.js +4 -2
- package/lib/exercises/exercise.d.ts +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +26 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.js +30 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.js +29 -0
- package/lib/exercises/geometry/cartesian/midpoint.js +1 -1
- package/lib/exercises/geometry/euclidean/TriangleArea.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/TriangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/TriangleArea.js +53 -0
- package/lib/exercises/geometry/euclidean/pythagore.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/pythagore.js +31 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +60 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.js +39 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/thales.js +67 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.js +104 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometry.js +55 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +42 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +52 -0
- package/lib/exercises/proba/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/proba/probabilityTree.js +11 -6
- package/lib/math/geometry/droite.d.ts.map +1 -1
- package/lib/math/geometry/droite.js +3 -2
- package/lib/math/geometry/point.d.ts +4 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +15 -0
- package/lib/math/geometry/triangles.d.ts +54 -0
- package/lib/math/geometry/triangles.d.ts.map +1 -0
- package/lib/math/geometry/triangles.js +183 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ exports.fractionToPercentToDecimal = {
|
|
|
19
19
|
};
|
|
20
20
|
function getFractionToPercentToDecimal() {
|
|
21
21
|
const denominator = 2 ** (0, randint_1.randint)(0, 5) * 5 ** (0, randint_1.randint)(0, 5);
|
|
22
|
-
const numerator = (0, randint_1.randint)(1, denominator);
|
|
22
|
+
const numerator = denominator !== 1 ? (0, randint_1.randint)(1, denominator) : (0, randint_1.randint)(1, 100);
|
|
23
23
|
const fraction = new fractionNode_1.FractionNode(new numberNode_1.NumberNode(numerator), new numberNode_1.NumberNode(denominator));
|
|
24
24
|
const decimal = numerator / denominator;
|
|
25
25
|
const percent = (0, round_1.round)((numerator / denominator) * 100, 2);
|
|
@@ -60,7 +60,7 @@ function getFractionToPercentToDecimal() {
|
|
|
60
60
|
}
|
|
61
61
|
const question = {
|
|
62
62
|
instruction,
|
|
63
|
-
//startStatement: `${
|
|
63
|
+
//startStatement: `${numerator} et ${denominator}`,
|
|
64
64
|
answer,
|
|
65
65
|
keys: ['percent'],
|
|
66
66
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,eAAO,MAAM,gBAAgB,EAAE,QAU9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAuB9C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFractionEquation = exports.fractionEquation = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
9
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
10
|
+
exports.fractionEquation = {
|
|
11
|
+
id: 'fractionEquation',
|
|
12
|
+
connector: '\\iff',
|
|
13
|
+
instruction: 'Résoudre :',
|
|
14
|
+
label: 'Résoudre une équation quotient nul',
|
|
15
|
+
levels: ['2', '1'],
|
|
16
|
+
section: 'Équations',
|
|
17
|
+
isSingleStep: false,
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionEquation, nb),
|
|
19
|
+
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou', 'emptyset'],
|
|
20
|
+
};
|
|
21
|
+
function getFractionEquation() {
|
|
22
|
+
// (ax + b)/(cx + d) = 0
|
|
23
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
24
|
+
const b = (0, randint_1.randint)(-9, 10, [0]);
|
|
25
|
+
const c = (0, randint_1.randint)(-9, 10, [0]);
|
|
26
|
+
const d = (0, randint_1.randint)(-9, 10, [0]);
|
|
27
|
+
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
28
|
+
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
29
|
+
const answer = -d / c === -b / a
|
|
30
|
+
? `S = \\emptyset`
|
|
31
|
+
: `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()}\\right\\}`;
|
|
32
|
+
const question = {
|
|
33
|
+
startStatement: `\\frac{${polynome1.toTex()}}{${polynome2.toTex()}} = 0`,
|
|
34
|
+
answer,
|
|
35
|
+
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou', 'emptyset'],
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
}
|
|
39
|
+
exports.getFractionEquation = getFractionEquation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,eAAO,MAAM,sBAAsB,EAAE,QAUpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAsBpD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMultiplicationEquation = exports.multiplicationEquation = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
9
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
10
|
+
exports.multiplicationEquation = {
|
|
11
|
+
id: 'multiplicationEquation',
|
|
12
|
+
connector: '\\iff',
|
|
13
|
+
instruction: 'Résoudre :',
|
|
14
|
+
label: 'Résoudre une équation produit nul',
|
|
15
|
+
levels: ['2', '1'],
|
|
16
|
+
section: 'Équations',
|
|
17
|
+
isSingleStep: false,
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMultiplicationEquation, nb),
|
|
19
|
+
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou'],
|
|
20
|
+
};
|
|
21
|
+
function getMultiplicationEquation() {
|
|
22
|
+
// (ax + b)(cx + d) = 0
|
|
23
|
+
let a, b, c, d;
|
|
24
|
+
do {
|
|
25
|
+
a = (0, randint_1.randint)(-9, 10, [0]);
|
|
26
|
+
b = (0, randint_1.randint)(-9, 10, [0]);
|
|
27
|
+
c = (0, randint_1.randint)(-9, 10, [0]);
|
|
28
|
+
d = (0, randint_1.randint)(-9, 10, [0]);
|
|
29
|
+
} while (a / c === b / d);
|
|
30
|
+
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
31
|
+
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
32
|
+
const question = {
|
|
33
|
+
startStatement: `(${polynome1.toTex()})(${polynome2.toTex()}) = 0`,
|
|
34
|
+
answer: `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()};${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-d), new numberNode_1.NumberNode(c))).toTex()}\\right\\}`,
|
|
35
|
+
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou'],
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
}
|
|
39
|
+
exports.getMultiplicationEquation = getMultiplicationEquation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,cAAc,EAAE,QAU5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,cAAc,EAAE,QAU5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CAmB5C"}
|
|
@@ -18,10 +18,12 @@ exports.aeraConversion = {
|
|
|
18
18
|
function getAeraConversion() {
|
|
19
19
|
const units = ['mm^2', 'cm^2', 'dm^2', 'm^2', 'dam^2', 'hm^2', 'km^2'];
|
|
20
20
|
const randomUnitIndex = (0, randint_1.randint)(0, 7);
|
|
21
|
-
const randomUnitInstructionIndex = (0, randint_1.randint)(
|
|
21
|
+
const randomUnitInstructionIndex = (0, randint_1.randint)(
|
|
22
|
+
// cette manip a pour but d'éviter des conversion de type km² --> cm² ou le contraire (chiffre trop grand/petit)
|
|
23
|
+
randomUnitIndex - 2 < 0 ? 0 : randomUnitIndex - 2, randomUnitIndex + 2 > 7 ? 7 : randomUnitIndex + 3, [randomUnitIndex]);
|
|
22
24
|
const randomAera = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
23
25
|
const question = {
|
|
24
|
-
instruction: `$${randomAera.value}$
|
|
26
|
+
instruction: `$${randomAera.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
|
|
25
27
|
answer: randomAera.multiplyByPowerOfTen(2 * (randomUnitIndex - randomUnitInstructionIndex)).value + '',
|
|
26
28
|
keys: [],
|
|
27
29
|
};
|
|
@@ -21,7 +21,7 @@ function getCapacityConversion() {
|
|
|
21
21
|
const randomUnitInstructionIndex = (0, randint_1.randint)(0, 7, [randomUnitIndex]);
|
|
22
22
|
const randomCapacity = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
23
23
|
const question = {
|
|
24
|
-
instruction: `$${randomCapacity.value}$
|
|
24
|
+
instruction: `$${randomCapacity.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
|
|
25
25
|
answer: randomCapacity.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
|
|
26
26
|
keys: [],
|
|
27
27
|
};
|
|
@@ -21,7 +21,7 @@ function getLengthConversion() {
|
|
|
21
21
|
const randomUnitInstructionIndex = (0, randint_1.randint)(0, 7, [randomUnitIndex]);
|
|
22
22
|
const randomlength = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
23
23
|
const question = {
|
|
24
|
-
instruction: `$${randomlength.value}$
|
|
24
|
+
instruction: `$${randomlength.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
|
|
25
25
|
answer: randomlength.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
|
|
26
26
|
keys: [],
|
|
27
27
|
};
|
|
@@ -21,7 +21,7 @@ function getMassConversion() {
|
|
|
21
21
|
const randomUnitInstructionIndex = (0, randint_1.randint)(0, 7, [randomUnitIndex]);
|
|
22
22
|
const randomMass = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
23
23
|
const question = {
|
|
24
|
-
instruction: `$${randomMass.value}$
|
|
24
|
+
instruction: `$${randomMass.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
|
|
25
25
|
answer: randomMass.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
|
|
26
26
|
keys: [],
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumeCapacityConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeCapacityConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"volumeCapacityConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeCapacityConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CAiCtD"}
|
|
@@ -19,9 +19,11 @@ exports.volumeCapacityConversion = {
|
|
|
19
19
|
function getVolumeCapacityConversion() {
|
|
20
20
|
const volumeUnits = ['mm^3', 'cm^3', 'dm^3', 'm^3', 'dam^3', 'hm^3', 'km^3'];
|
|
21
21
|
const capacityUnits = ['mL', 'cL', 'dL', 'L', 'daL', 'hL', 'kL'];
|
|
22
|
-
const randomUnitIndex = (0, randint_1.randint)(0, 7);
|
|
23
22
|
const randomUnitInstructionIndex = (0, randint_1.randint)(0, 7);
|
|
24
|
-
|
|
23
|
+
const randomUnitIndex = (0, randint_1.randint)(
|
|
24
|
+
// cette manip a pour but d'éviter des conversion avec des nombres trop grand/petit
|
|
25
|
+
randomUnitInstructionIndex - 1 < 0 ? 0 : randomUnitInstructionIndex - 1, randomUnitInstructionIndex + 2 > 7 ? 7 : randomUnitInstructionIndex + 2);
|
|
26
|
+
const random = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
25
27
|
let instructionUnit;
|
|
26
28
|
let AsnwerUnit;
|
|
27
29
|
let answer;
|
|
@@ -36,7 +38,7 @@ function getVolumeCapacityConversion() {
|
|
|
36
38
|
answer = random.multiplyByPowerOfTen(randomUnitIndex - 3 + 3 * (2 - randomUnitInstructionIndex)).value + '';
|
|
37
39
|
}
|
|
38
40
|
const question = {
|
|
39
|
-
instruction: `$${random.value}$
|
|
41
|
+
instruction: `$${random.value}$ $${instructionUnit}$ = ... $${AsnwerUnit}$`,
|
|
40
42
|
answer,
|
|
41
43
|
keys: [],
|
|
42
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeConversion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,gBAAgB,EAAE,QAU9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeConversion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,gBAAgB,EAAE,QAU9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAmB9C"}
|
|
@@ -18,10 +18,12 @@ exports.volumeConversion = {
|
|
|
18
18
|
function getVolumeConversion() {
|
|
19
19
|
const units = ['mm^3', 'cm^3', 'dm^3', 'm^3', 'dam^3', 'hm^3', 'km^3'];
|
|
20
20
|
const randomUnitIndex = (0, randint_1.randint)(0, 7);
|
|
21
|
-
const randomUnitInstructionIndex = (0, randint_1.randint)(
|
|
21
|
+
const randomUnitInstructionIndex = (0, randint_1.randint)(
|
|
22
|
+
// cette manip a pour but d'éviter des conversion de type km³ --> cm³ ou le contraire (chiffre trop grand/petit)
|
|
23
|
+
randomUnitIndex - 2 < 0 ? 0 : randomUnitIndex - 2, randomUnitIndex + 2 > 7 ? 7 : randomUnitIndex + 3, [randomUnitIndex]);
|
|
22
24
|
const randomVolume = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
23
25
|
const question = {
|
|
24
|
-
instruction: `$${randomVolume.value}$
|
|
26
|
+
instruction: `$${randomVolume.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
|
|
25
27
|
answer: randomVolume.multiplyByPowerOfTen(3 * (randomUnitIndex - randomUnitInstructionIndex)).value + '',
|
|
26
28
|
keys: [],
|
|
27
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAkGA,eAAO,MAAM,SAAS,iCAgJrB,CAAC"}
|
|
@@ -30,6 +30,8 @@ const equationType2Exercise_1 = require("./calculLitteral/equation/equationType2
|
|
|
30
30
|
const equationType3Exercise_1 = require("./calculLitteral/equation/equationType3Exercise");
|
|
31
31
|
const equationType4Exercise_1 = require("./calculLitteral/equation/equationType4Exercise");
|
|
32
32
|
const firstDegreeEquation_1 = require("./calculLitteral/equation/firstDegreeEquation");
|
|
33
|
+
const fractionEquation_1 = require("./calculLitteral/equation/fractionEquation");
|
|
34
|
+
const multiplicationEquation_1 = require("./calculLitteral/equation/multiplicationEquation");
|
|
33
35
|
const factoIdRmq1_1 = require("./calculLitteral/factorisation/factoIdRmq1");
|
|
34
36
|
const factoIdRmq2_1 = require("./calculLitteral/factorisation/factoIdRmq2");
|
|
35
37
|
const factoIdRmq3_1 = require("./calculLitteral/factorisation/factoIdRmq3");
|
|
@@ -50,7 +52,18 @@ const thirdDegreeDerivative_1 = require("./derivation/derivative/thirdDegreeDeri
|
|
|
50
52
|
const usualderivative_1 = require("./derivation/derivative/usualderivative");
|
|
51
53
|
const derivativeNumberReading_1 = require("./geometry/cartesian/derivativeNumberReading");
|
|
52
54
|
const leadingCoefficient_1 = require("./geometry/cartesian/leadingCoefficient");
|
|
55
|
+
const leadingCoefficientCalculV1_1 = require("./geometry/cartesian/leadingCoefficientCalculV1");
|
|
56
|
+
const leadingCoefficientCalculV2_1 = require("./geometry/cartesian/leadingCoefficientCalculV2");
|
|
53
57
|
const midpoint_1 = require("./geometry/cartesian/midpoint");
|
|
58
|
+
const TriangleArea_1 = require("./geometry/euclidean/TriangleArea");
|
|
59
|
+
const pythagore_1 = require("./geometry/euclidean/pythagore");
|
|
60
|
+
const pythagoreCalcul_1 = require("./geometry/euclidean/pythagoreCalcul");
|
|
61
|
+
const rightTriangleArea_1 = require("./geometry/euclidean/rightTriangleArea");
|
|
62
|
+
const thales_1 = require("./geometry/euclidean/thales");
|
|
63
|
+
const thalesCalcul_1 = require("./geometry/euclidean/thalesCalcul");
|
|
64
|
+
const trigonometry_1 = require("./geometry/euclidean/trigonometry");
|
|
65
|
+
const trigonometryAngleCalcul_1 = require("./geometry/euclidean/trigonometryAngleCalcul");
|
|
66
|
+
const trigonometrySideCalcul_1 = require("./geometry/euclidean/trigonometrySideCalcul");
|
|
54
67
|
const scalarProductViaCoords_1 = require("./geometry/vectors/scalarProductViaCoords");
|
|
55
68
|
const applyPercent_1 = require("./percent/applyPercent");
|
|
56
69
|
const averageEvolutionRate_1 = require("./percent/averageEvolutionRate");
|
|
@@ -186,6 +199,15 @@ exports.exercises = [
|
|
|
186
199
|
mentalMultiplications_1.mentalMultiplications,
|
|
187
200
|
mentalDivisions_1.mentalDivisions,
|
|
188
201
|
mentalPercentage_1.mentalPercentage,
|
|
202
|
+
thales_1.thales,
|
|
203
|
+
thalesCalcul_1.thalesCalcul,
|
|
204
|
+
pythagore_1.pythagore,
|
|
205
|
+
pythagoreCalcul_1.pythagoreCalcul,
|
|
206
|
+
trigonometry_1.trigonometry,
|
|
207
|
+
trigonometryAngleCalcul_1.trigonometryAngleCalcul,
|
|
208
|
+
trigonometrySideCalcul_1.trigonometrySideCalcul,
|
|
209
|
+
rightTriangleArea_1.rightTriangleArea,
|
|
210
|
+
TriangleArea_1.triangleArea,
|
|
189
211
|
/**
|
|
190
212
|
* nv generateurs
|
|
191
213
|
*/
|
|
@@ -195,4 +217,8 @@ exports.exercises = [
|
|
|
195
217
|
aeraConversion_1.aeraConversion,
|
|
196
218
|
volumeConversion_1.volumeConversion,
|
|
197
219
|
volumeCapacityConversion_1.volumeCapacityConversion,
|
|
220
|
+
multiplicationEquation_1.multiplicationEquation,
|
|
221
|
+
fractionEquation_1.fractionEquation,
|
|
222
|
+
leadingCoefficientCalculV1_1.leadingCoefficientCalculV1,
|
|
223
|
+
leadingCoefficientCalculV2_1.leadingCoefficientCalculV2,
|
|
198
224
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAWhE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV1 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
exports.leadingCoefficientCalculV1 = {
|
|
10
|
+
id: 'leadingCoefficientCalculV1',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Calculer le coefficient directeur d'une fonction affine",
|
|
14
|
+
levels: ['3', '2', '1'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
section: 'Fonctions affines',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientCalculV1Question, nb),
|
|
18
|
+
};
|
|
19
|
+
function getLeadingCoefficientCalculV1Question() {
|
|
20
|
+
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
|
+
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
|
+
const yB = (0, randint_1.randint)(-9, 10);
|
|
23
|
+
const question = {
|
|
24
|
+
instruction: `Soit $f$ une fonction affine telle que $f(${xA})$ = $${yA}$ et $f(${xB})$ = $${yB}$.$\\\\$Quel est le coefficient directeur de $f$ ?`,
|
|
25
|
+
startStatement: 'a',
|
|
26
|
+
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
27
|
+
};
|
|
28
|
+
return question;
|
|
29
|
+
}
|
|
30
|
+
exports.getLeadingCoefficientCalculV1Question = getLeadingCoefficientCalculV1Question;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAUhE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV2 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
exports.leadingCoefficientCalculV2 = {
|
|
10
|
+
id: 'leadingCoefficientCalculV2',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Coefficient directeur à l'aide de deux points",
|
|
14
|
+
levels: ['3', '2', '1'],
|
|
15
|
+
isSingleStep: false,
|
|
16
|
+
section: 'Droites',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientCalculV1Question, nb),
|
|
18
|
+
};
|
|
19
|
+
function getLeadingCoefficientCalculV1Question() {
|
|
20
|
+
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
|
+
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
|
+
const yB = (0, randint_1.randint)(-9, 10);
|
|
23
|
+
const question = {
|
|
24
|
+
instruction: `Soit $d$ une droite passant par les points A(${xA},${yA}) et B(${xB},${yB}).$\\\\$Déterminer le coefficient directeur de $d$.`,
|
|
25
|
+
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
26
|
+
};
|
|
27
|
+
return question;
|
|
28
|
+
}
|
|
29
|
+
exports.getLeadingCoefficientCalculV1Question = getLeadingCoefficientCalculV1Question;
|
|
@@ -12,7 +12,7 @@ exports.midpoint = {
|
|
|
12
12
|
label: 'Coordonnées du milieu',
|
|
13
13
|
levels: ['3', '2', '1'],
|
|
14
14
|
isSingleStep: false,
|
|
15
|
-
section: 'Géométrie
|
|
15
|
+
section: 'Géométrie cartésienn',
|
|
16
16
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMidpointQuestion, nb),
|
|
17
17
|
keys: ['semicolon'],
|
|
18
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/TriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM9D,eAAO,MAAM,YAAY,EAAE,QAS1B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CA4C1C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTriangleArea = exports.triangleArea = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
exports.triangleArea = {
|
|
9
|
+
id: 'triangleArea',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: "Calculer l'aire d'un triangle",
|
|
13
|
+
levels: ['4', '3', '2'],
|
|
14
|
+
isSingleStep: false,
|
|
15
|
+
section: 'Géométrie euclidienne',
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTriangleArea, nb),
|
|
17
|
+
};
|
|
18
|
+
function getTriangleArea() {
|
|
19
|
+
const vertices = [];
|
|
20
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
21
|
+
for (let i = 0; i < 3; i++)
|
|
22
|
+
vertices.push(String.fromCharCode(code + i));
|
|
23
|
+
const triangle = triangles_1.TriangleConstructor.createRandomTriangle({ minAngle: 0.69, maxAngle: 1.5, names: vertices });
|
|
24
|
+
const sides = [triangle.getSideAName(), triangle.getSideBName(), triangle.getSideCName()];
|
|
25
|
+
const sidesLength = [triangle.getSideAnumber(), triangle.getSideBnumber(), triangle.getSideCnumber()].map((el) => Math.round(el / 2));
|
|
26
|
+
const angles = [triangle.getAngleA(), triangle.getAngleB(), triangle.getAngleC()];
|
|
27
|
+
const randoms = (0, shuffle_1.shuffle)([0, 1, 2]);
|
|
28
|
+
const height = Math.round(sidesLength[randoms[1]] * Math.sin(angles[randoms[2]]));
|
|
29
|
+
const commands = [
|
|
30
|
+
...triangle.generateCommands({
|
|
31
|
+
showLabels: [sides[randoms[0]]],
|
|
32
|
+
setCaptions: [sidesLength[randoms[0]] + ''],
|
|
33
|
+
}),
|
|
34
|
+
`poi = Intersect(PerpendicularLine(${vertices[randoms[0]]},${sides[randoms[0]]}),${sides[randoms[0]]})`,
|
|
35
|
+
`ShowLabel(poi, true)`,
|
|
36
|
+
`SetCaption(poi, "${String.fromCharCode(code + 3)}")`,
|
|
37
|
+
`seg = Segment(${vertices[randoms[0]]}, poi)`,
|
|
38
|
+
`ShowLabel(seg, true)`,
|
|
39
|
+
`SetCaption(seg, "${height}")`,
|
|
40
|
+
`SetLineStyle(seg, 1)`,
|
|
41
|
+
`alpha = Angle(${vertices[randoms[0]]},poi ,${vertices[randoms[1]]}, Line(${vertices[randoms[0]]},poi))`,
|
|
42
|
+
`ShowLabel(alpha, false)`,
|
|
43
|
+
];
|
|
44
|
+
const question = {
|
|
45
|
+
instruction: `Calculer l'aire du triangle ${triangle.getTriangleName()} sachant que ${sides[randoms[0]]} = $${sidesLength[randoms[0]]}$ cm et la hauteur ${vertices[randoms[0]]}${String.fromCharCode(code + 3)} = $${height}$ cm.`,
|
|
46
|
+
answer: (sidesLength[randoms[0]] * height) / 2 + '',
|
|
47
|
+
keys: [...vertices, 'equal', 'cm2'],
|
|
48
|
+
commands,
|
|
49
|
+
coords: triangle.generateCoords(),
|
|
50
|
+
};
|
|
51
|
+
return question;
|
|
52
|
+
}
|
|
53
|
+
exports.getTriangleArea = getTriangleArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,SAAS,EAAE,QASvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,CAevC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythagore = exports.pythagore = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
exports.pythagore = {
|
|
8
|
+
id: 'pythagore',
|
|
9
|
+
connector: '=',
|
|
10
|
+
instruction: "Écrire l'égalité de Pythagore pour la figure suivante : ",
|
|
11
|
+
label: "Ecrire l'égalité de Pythagore",
|
|
12
|
+
levels: ['4', '3', '2'],
|
|
13
|
+
isSingleStep: false,
|
|
14
|
+
section: 'Géométrie euclidienne',
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPythagore, nb),
|
|
16
|
+
};
|
|
17
|
+
function getPythagore() {
|
|
18
|
+
const vertices = [];
|
|
19
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
20
|
+
for (let i = 0; i < 3; i++)
|
|
21
|
+
vertices.push(String.fromCharCode(code + i));
|
|
22
|
+
const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({ minRapport: 0.7, maxRapport: 1.3, names: vertices });
|
|
23
|
+
const question = {
|
|
24
|
+
answer: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 + ${triangle.getSideCName()}^2`,
|
|
25
|
+
keys: [...vertices, 'equal'],
|
|
26
|
+
commands: triangle.generateCommands({}),
|
|
27
|
+
coords: triangle.generateCoords(),
|
|
28
|
+
};
|
|
29
|
+
return question;
|
|
30
|
+
}
|
|
31
|
+
exports.getPythagore = getPythagore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAoD7C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythagoreCalcul = exports.pythagoreCalcul = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
exports.pythagoreCalcul = {
|
|
10
|
+
id: 'pythagoreCalcul',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: 'Utiliser le théoreme de Pythagore pour faire des calculs',
|
|
14
|
+
levels: ['3', '2'],
|
|
15
|
+
isSingleStep: false,
|
|
16
|
+
section: 'Géométrie euclidienne',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPythagoreCalcul, nb),
|
|
18
|
+
};
|
|
19
|
+
function getPythagoreCalcul() {
|
|
20
|
+
const vertices = [];
|
|
21
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
22
|
+
for (let i = 0; i < 3; i++)
|
|
23
|
+
vertices.push(String.fromCharCode(code + i));
|
|
24
|
+
const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({ minRapport: 0.7, maxRapport: 1.3, names: vertices });
|
|
25
|
+
const sides = [triangle.getSideCName(), triangle.getSideBName(), triangle.getSideAName()];
|
|
26
|
+
const sideLengths = [triangle.getSideCnumber(), triangle.getSideBnumber(), triangle.getSideAnumber()].map((el) => Math.round(el / 2));
|
|
27
|
+
const zeroOrOne = (0, shuffle_1.shuffle)([0, 1]);
|
|
28
|
+
const randoms = (0, coinFlip_1.coinFlip)() ? [...zeroOrOne, 2] : [2, ...zeroOrOne];
|
|
29
|
+
// le but est d'avoir une chance sur 2 d'avoir un hépoténus et une 1 chance sur 2 d'avoir un a des 2 autres cote
|
|
30
|
+
let answer;
|
|
31
|
+
if (randoms[2] === 2) {
|
|
32
|
+
// cas de l'hypoténus
|
|
33
|
+
answer = Math.hypot(sideLengths[0], sideLengths[1]);
|
|
34
|
+
answer = Math.round(answer) === answer ? answer : `\\sqrt{${sideLengths[0] ** 2 + sideLengths[1] ** 2}}`;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// les deux autres cotés
|
|
38
|
+
answer = Math.sqrt(Math.abs(sideLengths[randoms[0]] ** 2 - sideLengths[randoms[1]] ** 2));
|
|
39
|
+
answer =
|
|
40
|
+
Math.round(answer) === answer
|
|
41
|
+
? answer
|
|
42
|
+
: `\\sqrt{${Math.abs(sideLengths[randoms[0]] ** 2 - sideLengths[randoms[1]] ** 2)}}`;
|
|
43
|
+
}
|
|
44
|
+
const commands = [
|
|
45
|
+
...triangle.generateCommands({
|
|
46
|
+
showLabels: [...sides, sides[randoms[2]]],
|
|
47
|
+
setCaptions: [...sideLengths.map((el) => el + ''), '?'],
|
|
48
|
+
highlightedSide: sides[randoms[2]],
|
|
49
|
+
}),
|
|
50
|
+
];
|
|
51
|
+
const question = {
|
|
52
|
+
instruction: `Dans le triangle ${triangle.getTriangleName()} ci-dessous rectangle en ${triangle.getRightAngle()}, on sait que ${sides[randoms[0]]} = $${sideLengths[randoms[0]]}$ et que ${sides[randoms[1]]} = $${sideLengths[randoms[1]]}$.$\\\\$Calculer la longueur exacte ${sides[randoms[2]]}`,
|
|
53
|
+
answer: answer + '',
|
|
54
|
+
keys: [...vertices, 'equal'],
|
|
55
|
+
commands,
|
|
56
|
+
coords: triangle.generateCoords(),
|
|
57
|
+
};
|
|
58
|
+
return question;
|
|
59
|
+
}
|
|
60
|
+
exports.getPythagoreCalcul = getPythagoreCalcul;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,iBAAiB,EAAE,QAS/B,CAAC;AAEF,wBAAgB,oBAAoB,IAAI,QAAQ,CA2B/C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRightTriangleArea = exports.rightTriangleArea = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
exports.rightTriangleArea = {
|
|
8
|
+
id: 'rightTriangleArea',
|
|
9
|
+
connector: '=',
|
|
10
|
+
instruction: '',
|
|
11
|
+
label: "Calculer l'aire d'un triangle rectangle",
|
|
12
|
+
levels: ['4', '3', '2'],
|
|
13
|
+
isSingleStep: false,
|
|
14
|
+
section: 'Géométrie euclidienne',
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRightTriangleArea, nb),
|
|
16
|
+
};
|
|
17
|
+
function getRightTriangleArea() {
|
|
18
|
+
const vertices = [];
|
|
19
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
20
|
+
for (let i = 0; i < 3; i++)
|
|
21
|
+
vertices.push(String.fromCharCode(code + i));
|
|
22
|
+
const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({ minRapport: 0.4, maxRapport: 1.6, names: vertices });
|
|
23
|
+
const sidesLength = [Math.round(triangle.getSideBnumber() / 2), Math.round(triangle.getSideCnumber() / 2)];
|
|
24
|
+
const commands = [
|
|
25
|
+
...triangle.generateCommands({
|
|
26
|
+
showLabels: [triangle.getSideBName(), triangle.getSideCName()],
|
|
27
|
+
setCaptions: [sidesLength[0] + '', sidesLength[1] + ''],
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
30
|
+
const question = {
|
|
31
|
+
instruction: `Calculer l'aire du triangle ${triangle.getTriangleName()} rectangle en ${triangle.getRightAngle()} sachant que ${triangle.getSideBName()} = $${sidesLength[0]}$ cm et ${triangle.getSideCName()} = $${sidesLength[1]}$ cm.`,
|
|
32
|
+
answer: (sidesLength[0] * sidesLength[1]) / 2 + '',
|
|
33
|
+
keys: [...vertices, 'equal', 'cm2'],
|
|
34
|
+
commands,
|
|
35
|
+
coords: triangle.generateCoords(),
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
}
|
|
39
|
+
exports.getRightTriangleArea = getRightTriangleArea;
|