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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI9D,eAAO,MAAM,MAAM,EAAE,QASpB,CAAC;AAEF,wBAAgB,SAAS,IAAI,QAAQ,CAyDpC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getThales = exports.thales = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
exports.thales = {
|
|
7
|
+
id: 'thales',
|
|
8
|
+
connector: '=',
|
|
9
|
+
instruction: '',
|
|
10
|
+
label: "Ecrire l'égalité de Thalès",
|
|
11
|
+
levels: ['5', '4', '3', '2'],
|
|
12
|
+
isSingleStep: false,
|
|
13
|
+
section: 'Géométrie euclidienne',
|
|
14
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getThales, nb),
|
|
15
|
+
};
|
|
16
|
+
function getThales() {
|
|
17
|
+
const vertices = [];
|
|
18
|
+
const code = 65 + (0, randint_1.randint)(0, 22); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
19
|
+
for (let i = 0; i < 5; i++)
|
|
20
|
+
vertices.push(String.fromCharCode(code + i));
|
|
21
|
+
const [xA, yA] = [(0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11)];
|
|
22
|
+
let xB, yB, xC, yC;
|
|
23
|
+
let d1, d2; // distance entre le point A et B
|
|
24
|
+
let theta = 0; // angle entre AB et AC
|
|
25
|
+
do {
|
|
26
|
+
[xB, yB, xC, yC] = [(0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11)];
|
|
27
|
+
d1 = Math.hypot(xB - xA, yB - yA); // Calculer la distance entre A et B
|
|
28
|
+
d2 = Math.hypot(xC - xA, yC - yA); // Calculer la distance entre A et C
|
|
29
|
+
theta = Math.acos(((xB - xA) * (xC - xA) + (yB - yA) * (yC - yA)) / (d1 * d2));
|
|
30
|
+
} while (!theta || theta < 0.35 || theta > 2.1 || d1 / d2 > 1.3 || d1 / d2 < 0.7);
|
|
31
|
+
const factor = (0, randint_1.randint)(-5, 6, [-2, -1, 0, 1, 2]) / 10; // facteur = AB/AE, Pour que l'affichage soit acceptable, les valeurs de factor sont +- 0.5 0.4 0.3
|
|
32
|
+
const [xD, yD] = [xA + factor * (xB - xA), yA + factor * (yB - yA)];
|
|
33
|
+
const [xE, yE] = [xA + factor * (xC - xA), yA + factor * (yC - yA)];
|
|
34
|
+
const xMin = Math.min(xA, xB, xC, xD, xE);
|
|
35
|
+
const xMax = Math.max(xA, xB, xC, xD, xE);
|
|
36
|
+
const yMin = Math.min(yA, yB, yC, yD, yE);
|
|
37
|
+
const yMax = Math.max(yA, yB, yC, yD, yE);
|
|
38
|
+
const commands = [
|
|
39
|
+
`${vertices[0]} = Point({${xA}, ${yA}})`,
|
|
40
|
+
`${vertices[1]} = Point({${xB}, ${yB}})`,
|
|
41
|
+
`${vertices[2]} = Point({${xC}, ${yC}})`,
|
|
42
|
+
`${vertices[3]} = Point(${vertices[0]}, Vector(${factor}Vector(${vertices[0]},${vertices[1]})))`,
|
|
43
|
+
`${vertices[4]} = Intersect(Line(${vertices[3]}, Line(${vertices[1]}, ${vertices[2]})) , Line(${vertices[0]}, ${vertices[2]}))`,
|
|
44
|
+
`l = Segment(${vertices[0]}, ${vertices[1]})`,
|
|
45
|
+
`i = Segment(${vertices[0]}, ${vertices[2]})`,
|
|
46
|
+
`j = Segment(${vertices[1]}, ${vertices[2]})`,
|
|
47
|
+
`k = Segment(${vertices[3]}, ${vertices[4]})`,
|
|
48
|
+
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[3]}))`,
|
|
49
|
+
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[4]}))`,
|
|
50
|
+
`ShowAxes(false)`,
|
|
51
|
+
`ShowGrid(false)`,
|
|
52
|
+
`ShowLabel(${vertices[0]}, true)`,
|
|
53
|
+
`ShowLabel(${vertices[1]}, true)`,
|
|
54
|
+
`ShowLabel(${vertices[2]}, true)`,
|
|
55
|
+
`ShowLabel(${vertices[3]}, true)`,
|
|
56
|
+
`ShowLabel(${vertices[4]}, true)`,
|
|
57
|
+
];
|
|
58
|
+
const question = {
|
|
59
|
+
instruction: `En utilisant le théoreme de Thalès, Écrire l'égalité des quotients sachant que :$\\\\$ (${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]})`,
|
|
60
|
+
answer: `\\frac{${vertices[0]}${vertices[3]}}{${vertices[0]}${vertices[1]}} = \\frac{${vertices[0]}${vertices[4]}}{${vertices[0]}${vertices[2]}} = \\frac{${vertices[3]}${vertices[4]}}{${vertices[1]}${vertices[2]}}`,
|
|
61
|
+
keys: [...vertices, 'equal'],
|
|
62
|
+
commands,
|
|
63
|
+
coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
}
|
|
67
|
+
exports.getThales = getThales;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,eAAO,MAAM,YAAY,EAAE,QAS1B,CAAC;AAEF,wBAAgB,SAAS,IAAI,QAAQ,CAgHpC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getThales = exports.thalesCalcul = 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
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
exports.thalesCalcul = {
|
|
11
|
+
id: 'thalesCalcul',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Utiliser le théoreme de Thalès pour faire des calculs',
|
|
15
|
+
levels: ['5', '4', '3', '2'],
|
|
16
|
+
isSingleStep: false,
|
|
17
|
+
section: 'Géométrie euclidienne',
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getThales, nb),
|
|
19
|
+
};
|
|
20
|
+
function getThales() {
|
|
21
|
+
const vertices = [];
|
|
22
|
+
const code = 65 + (0, randint_1.randint)(0, 22); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
23
|
+
for (let i = 0; i < 5; i++)
|
|
24
|
+
vertices.push(String.fromCharCode(code + i));
|
|
25
|
+
const [xA, yA] = [(0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11)];
|
|
26
|
+
let xB, yB, xC, yC;
|
|
27
|
+
let d1, d2, d3; // distance entre le point A et B
|
|
28
|
+
let theta = 0; // angle entre AB et AC
|
|
29
|
+
do {
|
|
30
|
+
[xB, yB, xC, yC] = [(0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11), (0, randint_1.randint)(-10, 11)];
|
|
31
|
+
d1 = Math.hypot(xB - xA, yB - yA); // Calculer la distance entre A et B
|
|
32
|
+
d2 = Math.hypot(xC - xA, yC - yA); // Calculer la distance entre A et C
|
|
33
|
+
theta = Math.acos(((xB - xA) * (xC - xA) + (yB - yA) * (yC - yA)) / (d1 * d2));
|
|
34
|
+
} while (!theta || theta < 0.35 || theta > 2.1 || d1 / d2 > 1.3 || d1 / d2 < 0.7);
|
|
35
|
+
d3 = Math.sqrt(d1 ** 2 + d2 ** 2 - 2 * d1 * d2 * Math.cos(theta)); // Calculer la distance entre C et B
|
|
36
|
+
// CB² = AB² * AC² - 2*AB*AC*cos(theta) : pythagore généralisé
|
|
37
|
+
const factor = (0, randint_1.randint)(-5, 6, [-2, -1, 0, 1, 2]) / 10; // facteur = AB/AE, Pour que l'affichage soit acceptable, les valeurs de factor sont +- 0.5 0.4 0.3
|
|
38
|
+
const [xD, yD] = [xA + factor * (xB - xA), yA + factor * (yB - yA)];
|
|
39
|
+
const [xE, yE] = [xA + factor * (xC - xA), yA + factor * (yC - yA)];
|
|
40
|
+
const xMin = Math.min(xA, xB, xC, xD, xE);
|
|
41
|
+
const xMax = Math.max(xA, xB, xC, xD, xE);
|
|
42
|
+
const yMin = Math.min(yA, yB, yC, yD, yE);
|
|
43
|
+
const yMax = Math.max(yA, yB, yC, yD, yE);
|
|
44
|
+
// AB AC BC AD AE
|
|
45
|
+
const sides = [
|
|
46
|
+
`${vertices[0]}${vertices[1]}`,
|
|
47
|
+
`${vertices[0]}${vertices[3]}`,
|
|
48
|
+
`${vertices[0]}${vertices[2]}`,
|
|
49
|
+
`${vertices[0]}${vertices[4]}`,
|
|
50
|
+
`${vertices[1]}${vertices[2]}`,
|
|
51
|
+
`${vertices[3]}${vertices[4]}`,
|
|
52
|
+
];
|
|
53
|
+
// round pour avoir des valeurs dans N tout en gardant les proportions pour que ça soit cohérent. sides[i] a pour longueur sideLengths[i]
|
|
54
|
+
const sideLengths = [d1, factor * d1, d2, factor * d2, d3, factor * d3].map((el) => Math.round(Math.abs(el)));
|
|
55
|
+
const rand = (0, randint_1.randint)(0, 3);
|
|
56
|
+
let rand2 = (0, randint_1.randint)(0, 3, [rand]);
|
|
57
|
+
if (sideLengths[2 * rand] === sideLengths[2 * rand2])
|
|
58
|
+
rand2 = (0, randint_1.randint)(0, 3, [rand, rand2]); // condition pour pas prendre 2 longueurs identiques
|
|
59
|
+
let instruction = `Dans la figure ci-dessous, nous avons (${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]}), `;
|
|
60
|
+
let statement;
|
|
61
|
+
let startStatement;
|
|
62
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
63
|
+
// a/b = c/d on cherche c
|
|
64
|
+
instruction += `${sides[2 * rand]} = $${sideLengths[2 * rand]}$, ${sides[2 * rand + 1]} = $${sideLengths[2 * rand + 1]}$, ${sides[2 * rand2]} = $${sideLengths[2 * rand2]}$.$\\\\$Déterminer ${sides[2 * rand2 + 1]}`;
|
|
65
|
+
startStatement = `${sides[2 * rand2 + 1]}`;
|
|
66
|
+
statement = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(sideLengths[2 * rand2] * sideLengths[2 * rand + 1]), new numberNode_1.NumberNode(sideLengths[2 * rand])));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// a/b = c/d on cherche d
|
|
70
|
+
instruction += `${sides[2 * rand]} = $${sideLengths[2 * rand]}$, ${sides[2 * rand + 1]} = $${sideLengths[2 * rand + 1]}$, ${sides[2 * rand2 + 1]} = $${sideLengths[2 * rand2 + 1]}$.$\\\\$Déterminer ${sides[2 * rand2]}`;
|
|
71
|
+
startStatement = `${sides[2 * rand2]}`;
|
|
72
|
+
statement = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(sideLengths[2 * rand2 + 1] * sideLengths[2 * rand]), new numberNode_1.NumberNode(sideLengths[2 * rand + 1])));
|
|
73
|
+
}
|
|
74
|
+
const commands = [
|
|
75
|
+
`${vertices[0]} = Point({${xA}, ${yA}})`,
|
|
76
|
+
`${vertices[1]} = Point({${xB}, ${yB}})`,
|
|
77
|
+
`${vertices[2]} = Point({${xC}, ${yC}})`,
|
|
78
|
+
`${vertices[3]} = Point(${vertices[0]}, Vector(${factor}Vector(${vertices[0]},${vertices[1]})))`,
|
|
79
|
+
`${vertices[4]} = Intersect(Line(${vertices[3]}, Line(${vertices[1]}, ${vertices[2]})) , Line(${vertices[0]}, ${vertices[2]}))`,
|
|
80
|
+
`l = Segment(${vertices[0]}, ${vertices[1]})`,
|
|
81
|
+
`i = Segment(${vertices[0]}, ${vertices[2]})`,
|
|
82
|
+
`j = Segment(${vertices[1]}, ${vertices[2]})`,
|
|
83
|
+
`k = Segment(${vertices[3]}, ${vertices[4]})`,
|
|
84
|
+
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[3]}))`,
|
|
85
|
+
`If(${factor} < 0, Segment(${vertices[0]}, ${vertices[4]}))`,
|
|
86
|
+
`ShowAxes(false)`,
|
|
87
|
+
`ShowGrid(false)`,
|
|
88
|
+
`ShowLabel(${vertices[0]}, true)`,
|
|
89
|
+
`ShowLabel(${vertices[1]}, true)`,
|
|
90
|
+
`ShowLabel(${vertices[2]}, true)`,
|
|
91
|
+
`ShowLabel(${vertices[3]}, true)`,
|
|
92
|
+
`ShowLabel(${vertices[4]}, true)`,
|
|
93
|
+
];
|
|
94
|
+
const question = {
|
|
95
|
+
instruction,
|
|
96
|
+
startStatement,
|
|
97
|
+
answer: statement.toTex(),
|
|
98
|
+
keys: [],
|
|
99
|
+
commands,
|
|
100
|
+
coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
|
|
101
|
+
};
|
|
102
|
+
return question;
|
|
103
|
+
}
|
|
104
|
+
exports.getThales = getThales;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,YAAY,EAAE,QAS1B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CA2C1C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTrigonometry = exports.trigonometry = 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.trigonometry = {
|
|
8
|
+
id: 'trigonometry',
|
|
9
|
+
connector: '=',
|
|
10
|
+
instruction: '',
|
|
11
|
+
label: "Écrire le quotient égal au cosinus, au sinus ou à la tangente d'un angle dans un triangle rectangle",
|
|
12
|
+
levels: ['4', '3', '2'],
|
|
13
|
+
isSingleStep: false,
|
|
14
|
+
section: 'Géométrie euclidienne',
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTrigonometry, nb),
|
|
16
|
+
};
|
|
17
|
+
function getTrigonometry() {
|
|
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 trigo = ['le cosinus', 'le sinus', 'la tangente'];
|
|
24
|
+
const randTrigo = (0, randint_1.randint)(0, 3);
|
|
25
|
+
const angle = [triangle.vertexB.name, triangle.vertexC.name];
|
|
26
|
+
const randAngle = (0, randint_1.randint)(0, 2);
|
|
27
|
+
let quotient;
|
|
28
|
+
switch (randAngle) {
|
|
29
|
+
case 0:
|
|
30
|
+
quotient = [
|
|
31
|
+
`\\frac{${triangle.getSideCName()}}{${triangle.getSideAName()}}`,
|
|
32
|
+
`\\frac{${triangle.getSideBName()}}{${triangle.getSideAName()}}`,
|
|
33
|
+
`\\frac{${triangle.getSideBName()}}{${triangle.getSideCName()}}`,
|
|
34
|
+
];
|
|
35
|
+
break;
|
|
36
|
+
case 1:
|
|
37
|
+
quotient = [
|
|
38
|
+
`\\frac{${triangle.getSideBName()}}{${triangle.getSideAName()}}`,
|
|
39
|
+
`\\frac{${triangle.getSideCName()}}{${triangle.getSideAName()}}`,
|
|
40
|
+
`\\frac{${triangle.getSideCName()}}{${triangle.getSideBName()}}`,
|
|
41
|
+
];
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
quotient = [''];
|
|
45
|
+
}
|
|
46
|
+
const question = {
|
|
47
|
+
instruction: `À quel quotient est égal ${trigo[randTrigo]} de l'angle $\\widehat{${angle[randAngle]}}$?`,
|
|
48
|
+
answer: quotient[randTrigo],
|
|
49
|
+
keys: [...vertices, 'equal'],
|
|
50
|
+
commands: [...triangle.generateCommands({ highlightedAngle: angle[randAngle] })],
|
|
51
|
+
coords: triangle.generateCoords(),
|
|
52
|
+
};
|
|
53
|
+
return question;
|
|
54
|
+
}
|
|
55
|
+
exports.getTrigonometry = getTrigonometry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,uBAAuB,EAAE,QASrC,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,QAAQ,CAoCrD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTrigonometryAngleCalcul = exports.trigonometryAngleCalcul = 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 round_1 = require("../../../math/utils/round");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
exports.trigonometryAngleCalcul = {
|
|
10
|
+
id: 'trigonometryAngleCalcul',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: 'Utiliser la trigonométrie pour calculer un angle',
|
|
14
|
+
levels: ['4', '3', '2'],
|
|
15
|
+
isSingleStep: false,
|
|
16
|
+
section: 'Géométrie euclidienne',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTrigonometryAngleCalcul, nb),
|
|
18
|
+
};
|
|
19
|
+
function getTrigonometryAngleCalcul() {
|
|
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.5, maxRapport: 1.5, names: vertices });
|
|
25
|
+
const sides = [triangle.getSideCName(), triangle.getSideBName(), triangle.getSideAName()];
|
|
26
|
+
const sideLengths = [triangle.getSideCnumber(), triangle.getSideBnumber(), triangle.getSideAnumber()].map((el) => (0, round_1.round)(el / 2, 2));
|
|
27
|
+
const angle = [triangle.vertexB.name, triangle.vertexC.name];
|
|
28
|
+
const randAngle = (0, randint_1.randint)(0, 2);
|
|
29
|
+
const randSides = (0, shuffle_1.shuffle)([0, 1, 2]);
|
|
30
|
+
const answer = randAngle === 0
|
|
31
|
+
? Math.round((Math.acos(sideLengths[0] / sideLengths[2]) * 180) / Math.PI)
|
|
32
|
+
: Math.round((Math.acos(sideLengths[1] / sideLengths[2]) * 180) / Math.PI);
|
|
33
|
+
const question = {
|
|
34
|
+
instruction: `Le triangle ${triangle.getTriangleName()} rectangle en ${triangle.getRightAngle()} est tel que ${sides[randSides[0]]} = $${sideLengths[randSides[0]]}$ cm et ${sides[randSides[1]]} = $${sideLengths[randSides[1]]}$ cm.$\\\\$ Calculer $\\widehat{${angle[randAngle]}}$ à 1° près.`,
|
|
35
|
+
answer: answer + '°',
|
|
36
|
+
keys: [...vertices, 'equal', '°', 'cos', 'sin', 'tan', 'arccos', 'arcsin', 'arctan'],
|
|
37
|
+
commands: [...triangle.generateCommands({ highlightedAngle: angle[randAngle] })],
|
|
38
|
+
coords: triangle.generateCoords(),
|
|
39
|
+
};
|
|
40
|
+
return question;
|
|
41
|
+
}
|
|
42
|
+
exports.getTrigonometryAngleCalcul = getTrigonometryAngleCalcul;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM9D,eAAO,MAAM,sBAAsB,EAAE,QASpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA+CpD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTrigonometrySideCalcul = exports.trigonometrySideCalcul = 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 round_1 = require("../../../math/utils/round");
|
|
8
|
+
exports.trigonometrySideCalcul = {
|
|
9
|
+
id: 'trigonometrySideCalcul',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Utiliser la trigonométrie pour calculer un côté',
|
|
13
|
+
levels: ['4', '3', '2'],
|
|
14
|
+
isSingleStep: false,
|
|
15
|
+
section: 'Géométrie euclidienne',
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTrigonometrySideCalcul, nb),
|
|
17
|
+
};
|
|
18
|
+
function getTrigonometrySideCalcul() {
|
|
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.createRandomRightTriangle({ minRapport: 0.5, maxRapport: 1.5, names: vertices });
|
|
24
|
+
const sides = [triangle.getSideCName(), triangle.getSideBName(), triangle.getSideAName()];
|
|
25
|
+
const sideLengths = [triangle.getSideCnumber(), triangle.getSideBnumber(), triangle.getSideAnumber()].map((el) => (0, round_1.round)(el / 2, 2));
|
|
26
|
+
const angle = [triangle.vertexB.name, triangle.vertexC.name];
|
|
27
|
+
const randAngle = (0, randint_1.randint)(0, 2);
|
|
28
|
+
const randside = (0, randint_1.randint)(0, 3); // valeurs possible : 0 1 2
|
|
29
|
+
const randsideQuestion = (0, randint_1.randint)(0, 3, [randside]); // si rand = 0, valeurs possible 1 2
|
|
30
|
+
const angleValue = [
|
|
31
|
+
(0, round_1.round)((Math.acos(sideLengths[0] / sideLengths[2]) * 180) / Math.PI, 1),
|
|
32
|
+
(0, round_1.round)((Math.acos(sideLengths[1] / sideLengths[2]) * 180) / Math.PI, 1),
|
|
33
|
+
];
|
|
34
|
+
const commands = [
|
|
35
|
+
...triangle.generateCommands({
|
|
36
|
+
highlightedAngle: angle[randAngle],
|
|
37
|
+
colorHighlightedAngle: 'Black',
|
|
38
|
+
showLabels: [sides[randsideQuestion]],
|
|
39
|
+
setCaptions: ['?'],
|
|
40
|
+
highlightedSide: sides[randsideQuestion],
|
|
41
|
+
}),
|
|
42
|
+
];
|
|
43
|
+
const question = {
|
|
44
|
+
instruction: `Le triangle ${triangle.getTriangleName()} rectangle en ${triangle.getRightAngle()} tel que ${sides[randside]} = $${sideLengths[randside]}$ cm et $\\widehat{${angle[randAngle]}}$ = $${angleValue[randAngle]}$°.$\\\\$ Calculer ${sides[randsideQuestion]} à $0,1$ cm près.`,
|
|
45
|
+
answer: `${(0, round_1.round)(sideLengths[randsideQuestion], 1)}`,
|
|
46
|
+
keys: [...vertices, 'equal', '°', 'cos', 'sin', 'tan', 'arccos', 'arcsin', 'arctan'],
|
|
47
|
+
commands,
|
|
48
|
+
coords: triangle.generateCoords(),
|
|
49
|
+
};
|
|
50
|
+
return question;
|
|
51
|
+
}
|
|
52
|
+
exports.getTrigonometrySideCalcul = getTrigonometrySideCalcul;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAOF,wBAAgB,kBAAkB,IAAI,QAAQ,CAwF7C"}
|
|
@@ -16,6 +16,11 @@ exports.probabilityTree = {
|
|
|
16
16
|
section: 'Probabilités',
|
|
17
17
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProbabilityTree, nb),
|
|
18
18
|
};
|
|
19
|
+
function pgcd(a, b) {
|
|
20
|
+
while (b)
|
|
21
|
+
[a, b] = [b, a % b];
|
|
22
|
+
return a;
|
|
23
|
+
}
|
|
19
24
|
function getProbabilityTree() {
|
|
20
25
|
const A = (0, randint_1.randint)(2, 9);
|
|
21
26
|
const B = (0, randint_1.randint)(2, 10 - A);
|
|
@@ -74,12 +79,12 @@ function getProbabilityTree() {
|
|
|
74
79
|
'Segment(B,BD)',
|
|
75
80
|
'ShowAxes(false)',
|
|
76
81
|
'ShowGrid(false)',
|
|
77
|
-
`Text("\\scriptsize${A}/${A + B}", (0.3, 2.1), true, true)`,
|
|
78
|
-
`Text("\\scriptsize${AC}/${AC + AD}", (2.8, 3.5), true, true)`,
|
|
79
|
-
`Text("\\scriptsize${AD}/${AC + AD}", (2.8, 1.4), true, true)`,
|
|
80
|
-
`Text("\\scriptsize${B}/${A + B}", (0.3, -1.2), true, true)`,
|
|
81
|
-
`Text("\\scriptsize${BC}/${BC + BD}", (2.8, -0.6), true, true)`,
|
|
82
|
-
`Text("\\scriptsize${BD}/${BC + BD}", (2.8, -2.5), true, true)`,
|
|
82
|
+
`Text("\\scriptsize${A / pgcd(A, A + B)}/${(A + B) / pgcd(A, A + B)}", (0.3, 2.1), true, true)`,
|
|
83
|
+
`Text("\\scriptsize${AC / pgcd(AC, AC + AD)}/${(AC + AD) / pgcd(AC, AC + AD)}", (2.8, 3.5), true, true)`,
|
|
84
|
+
`Text("\\scriptsize${AD / pgcd(AD, AC + AD)}/${(AC + AD) / pgcd(AD, AC + AD)}", (2.8, 1.4), true, true)`,
|
|
85
|
+
`Text("\\scriptsize${B / pgcd(B, A + B)}/${(A + B) / pgcd(B, A + B)}", (0.3, -1.2), true, true)`,
|
|
86
|
+
`Text("\\scriptsize${BC / pgcd(BC, BC + BD)}/${(BC + BD) / pgcd(BC, BC + BD)}", (2.8, -0.6), true, true)`,
|
|
87
|
+
`Text("\\scriptsize${BD / pgcd(BD, BC + BD)}/${(BC + BD) / pgcd(BD, BC + BD)}", (2.8, -2.5), true, true)`,
|
|
83
88
|
'Text("A", (1.85 , 2.5))',
|
|
84
89
|
'Text("B", (1.85 , -2.8))',
|
|
85
90
|
'Text("C", (5.5 , 2.85))',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droite.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/droite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"droite.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/droite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,MAAM;IAM5D,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,SAAM,GAAG,MAAM;IAI/D,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,SAAM,GAAG,MAAM;CAKpE;AAED,qBAAa,MAAM;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBAEI,IAAI,oBAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAOxC,KAAK,IAAI,MAAM;IAIf,cAAc,IAAI,MAAM;IAIxB,oBAAoB,IAAI,MAAM;IAI9B,UAAU,IAAI,MAAM;IAKpB,qBAAqB,IAAI,MAAM;IAI/B,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,SAAM,GAAG,KAAK,GAAG,IAAI;CAMlD"}
|
|
@@ -10,6 +10,7 @@ const simplify_1 = require("../../tree/parsers/simplify");
|
|
|
10
10
|
const mathjs_1 = require("mathjs");
|
|
11
11
|
const point_1 = require("./point");
|
|
12
12
|
const polynomial_1 = require("../polynomials/polynomial");
|
|
13
|
+
const round_1 = require("../utils/round");
|
|
13
14
|
class DroiteConstructor {
|
|
14
15
|
static fromTwoPoints(A, B, name = 'd') {
|
|
15
16
|
const a = new fractionNode_1.FractionNode(new substractNode_1.SubstractNode(B.y, A.y), new substractNode_1.SubstractNode(B.x, A.x));
|
|
@@ -20,7 +21,7 @@ class DroiteConstructor {
|
|
|
20
21
|
return new Droite(name, (0, simplify_1.simplifyNode)(m), (0, simplify_1.simplifyNode)(new substractNode_1.SubstractNode(A.y, new multiplyNode_1.MultiplyNode(m, A.x))));
|
|
21
22
|
}
|
|
22
23
|
static fromPointAndAngle(A, theta, name = 'd') {
|
|
23
|
-
const m = new numberNode_1.NumberNode((0,
|
|
24
|
+
const m = new numberNode_1.NumberNode((0, round_1.round)(Math.tan(parseFloat(theta.toMathString())), 2));
|
|
24
25
|
const b = new substractNode_1.SubstractNode(A.y, new multiplyNode_1.MultiplyNode(m, A.x));
|
|
25
26
|
return new Droite(name, (0, simplify_1.simplifyNode)(m), (0, simplify_1.simplifyNode)(b));
|
|
26
27
|
}
|
|
@@ -43,7 +44,7 @@ class Droite {
|
|
|
43
44
|
return `(${this.name}) : y = ${this.toEquationForm()}`; // (D) : y = ax + b
|
|
44
45
|
}
|
|
45
46
|
toPolynome() {
|
|
46
|
-
const polynome = new polynomial_1.Polynomial([
|
|
47
|
+
const polynome = new polynomial_1.Polynomial([(0, mathjs_1.evaluate)(this.b.toMathString()), (0, mathjs_1.evaluate)(this.a.toMathString())], 'x');
|
|
47
48
|
return polynome.toTex();
|
|
48
49
|
}
|
|
49
50
|
getLeadingCoefficient() {
|
|
@@ -8,7 +8,11 @@ export declare class Point {
|
|
|
8
8
|
constructor(name: string, x: Node, y: Node);
|
|
9
9
|
toTex(): string;
|
|
10
10
|
toTexWithCoords(): string;
|
|
11
|
+
getXnumber(): number;
|
|
12
|
+
getYnumber(): number;
|
|
11
13
|
midpoint(B: Point, name?: string): Point;
|
|
14
|
+
distanceTo(B: Point): number;
|
|
15
|
+
equalTo(B: Point): boolean;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Droite{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAO7C,8BAAsB,gBAAgB;CAMrC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBACI,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAM1C,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAIzB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,MAAM;IAIpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAQrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;CAG3B;AAED;;;;;;;;;;;;GAYG"}
|
|
@@ -5,6 +5,7 @@ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
|
5
5
|
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
6
6
|
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
7
7
|
const simplify_1 = require("../../tree/parsers/simplify");
|
|
8
|
+
const mathjs_1 = require("mathjs");
|
|
8
9
|
class PointConstructor {
|
|
9
10
|
}
|
|
10
11
|
exports.PointConstructor = PointConstructor;
|
|
@@ -20,9 +21,23 @@ class Point {
|
|
|
20
21
|
toTexWithCoords() {
|
|
21
22
|
return `${this.name}\\left(${this.x.toTex()}; ${this.y.toTex()}\\right)`;
|
|
22
23
|
}
|
|
24
|
+
getXnumber() {
|
|
25
|
+
return (0, mathjs_1.evaluate)(this.x.toMathString());
|
|
26
|
+
}
|
|
27
|
+
getYnumber() {
|
|
28
|
+
return (0, mathjs_1.evaluate)(this.y.toMathString());
|
|
29
|
+
}
|
|
23
30
|
midpoint(B, name = 'I') {
|
|
24
31
|
return new Point(name, (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new addNode_1.AddNode(this.x, B.x), new numberNode_1.NumberNode(2))), (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new addNode_1.AddNode(this.y, B.y), new numberNode_1.NumberNode(2))));
|
|
25
32
|
}
|
|
33
|
+
distanceTo(B) {
|
|
34
|
+
const dx = this.getXnumber() - B.getXnumber();
|
|
35
|
+
const dy = this.getYnumber() - B.getYnumber();
|
|
36
|
+
return Math.sqrt(dx ** 2 + dy ** 2);
|
|
37
|
+
}
|
|
38
|
+
equalTo(B) {
|
|
39
|
+
return this.getXnumber() === B.getXnumber() && this.getYnumber() === B.getYnumber();
|
|
40
|
+
}
|
|
26
41
|
}
|
|
27
42
|
exports.Point = Point;
|
|
28
43
|
/**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Point } from './point';
|
|
2
|
+
import { Node } from '../../tree/nodes/node';
|
|
3
|
+
export declare abstract class TriangleConstructor {
|
|
4
|
+
static createRandomRightTriangle({ minRapport, maxRapport, names }: {
|
|
5
|
+
minRapport?: number | undefined;
|
|
6
|
+
maxRapport?: number | undefined;
|
|
7
|
+
names?: string[] | undefined;
|
|
8
|
+
}): Triangle;
|
|
9
|
+
static createRandomTriangle({ minAngle, maxAngle, names }: {
|
|
10
|
+
minAngle?: number | undefined;
|
|
11
|
+
maxAngle?: number | undefined;
|
|
12
|
+
names?: string[] | undefined;
|
|
13
|
+
}): Triangle;
|
|
14
|
+
}
|
|
15
|
+
type GenerateCommandsProps = {
|
|
16
|
+
highlightedAngle?: string;
|
|
17
|
+
colorHighlightedAngle?: string;
|
|
18
|
+
highlightedSide?: string;
|
|
19
|
+
colorHighlightedSide?: string;
|
|
20
|
+
showLabels?: string[];
|
|
21
|
+
setCaptions?: string[];
|
|
22
|
+
showAxes?: boolean;
|
|
23
|
+
showGrid?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare class Triangle {
|
|
26
|
+
vertexA: Point;
|
|
27
|
+
vertexB: Point;
|
|
28
|
+
vertexC: Point;
|
|
29
|
+
constructor(vertexA: Point, vertexB: Point, vertexC: Point);
|
|
30
|
+
getSideAnumber(): number;
|
|
31
|
+
getSideBnumber(): number;
|
|
32
|
+
getSideCnumber(): number;
|
|
33
|
+
getTriangleName(): string;
|
|
34
|
+
getSideAnode(): Node;
|
|
35
|
+
getSideBnode(): Node;
|
|
36
|
+
getSideCnode(): Node;
|
|
37
|
+
getAngleA(): number;
|
|
38
|
+
getAngleB(): number;
|
|
39
|
+
getAngleC(): number;
|
|
40
|
+
getPerimeter(): number;
|
|
41
|
+
getArea(): number;
|
|
42
|
+
isRight(): Boolean;
|
|
43
|
+
isEquilateral(): Boolean;
|
|
44
|
+
isIsosceles(): Boolean;
|
|
45
|
+
isScalene(): boolean;
|
|
46
|
+
getRightAngle(): string;
|
|
47
|
+
generateCommands({ highlightedAngle: highlightedAngle, colorHighlightedAngle: colorHighlightedAngle, showLabels: showLabels, setCaptions: setCaptions, highlightedSide: highlightedSide, colorHighlightedSide: colorHighlightedSide, showAxes, showGrid, }: GenerateCommandsProps): string[];
|
|
48
|
+
generateCoords(): number[];
|
|
49
|
+
getSideAName(): string;
|
|
50
|
+
getSideBName(): string;
|
|
51
|
+
getSideCName(): string;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=triangles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangles.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/triangles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAO7C,8BAAsB,mBAAmB;IACvC,MAAM,CAAC,yBAAyB,CAAC,EAAE,UAAc,EAAE,UAAc,EAAE,KAAuB,EAAE;;;;KAAA,GAAG,QAAQ;IAkBvG,MAAM,CAAC,oBAAoB,CAAC,EAAE,QAAe,EAAE,QAAc,EAAE,KAAuB,EAAE;;;;KAAA,GAAG,QAAQ;CAmBpG;AAED,KAAK,qBAAqB,GAAG;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,qBAAa,QAAQ;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;gBAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK;IAM1D,cAAc,IAAI,MAAM;IAOxB,cAAc,IAAI,MAAM;IAOxB,cAAc,IAAI,MAAM;IAIxB,eAAe,IAAI,MAAM;IAIzB,YAAY,IAAI,IAAI;IASpB,YAAY,IAAI,IAAI;IASpB,YAAY,IAAI,IAAI;IASpB,SAAS,IAAI,MAAM;IAOnB,SAAS,IAAI,MAAM;IAOnB,SAAS,IAAI,MAAM;IAOnB,YAAY,IAAI,MAAM;IAItB,OAAO,IAAI,MAAM;IAKjB,OAAO,IAAI,OAAO;IAOlB,aAAa,IAAI,OAAO;IAIxB,WAAW,IAAI,OAAO;IAQtB,SAAS,IAAI,OAAO;IAQpB,aAAa,IAAI,MAAM;IAOvB,gBAAgB,CAAC,EACf,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB,EAC5C,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EACR,QAAQ,GACT,EAAE,qBAAqB,GAAG,MAAM,EAAE;IAiDnC,cAAc,IAAI,MAAM,EAAE;IAS1B,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;CAGvB"}
|