math-exercises 2.2.77 → 2.2.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.js +44 -5
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +57 -26
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +50 -8
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +67 -13
- package/lib/exercises/math/derivation/derivative/usualderivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/usualderivative.js +1 -2
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +124 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/index.js +17 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts +10 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +107 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +1 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/applyPercent.js +2 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts +8 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.js +104 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/powers/index.d.ts +1 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +1 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts +11 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/powers/powersMixOperations.js +99 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/confidenceInterval.js +134 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/fluctuationInterval.js +131 -0
- package/lib/exercises/math/sampling/index.d.ts +4 -0
- package/lib/exercises/math/sampling/index.d.ts.map +1 -0
- package/lib/exercises/math/sampling/index.js +19 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts +11 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.js +116 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts +9 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.js +124 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -2
- package/lib/geogebra/parsers/parseGGBPoints.js +1 -1
- package/lib/index.d.ts +32 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/circle.d.ts +10 -0
- package/lib/math/geometry/circle.d.ts.map +1 -0
- package/lib/math/geometry/circle.js +33 -0
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -7
- package/lib/math/geometry/point.d.ts +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +11 -12
- package/lib/math/numbers/rationals/rational.d.ts +3 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +3 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +6 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +15 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +6 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +126 -2
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +2 -1
- package/lib/tree/parsers/intervalParser.d.ts +8 -0
- package/lib/tree/parsers/intervalParser.d.ts.map +1 -0
- package/lib/tree/parsers/intervalParser.js +38 -0
- package/lib/tree/parsers/monomParser.d.ts +1 -3
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +7 -129
- package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
- package/lib/tree/parsers/polynomialParser.js +2 -1
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/powerParser.d.ts.map +1 -1
- package/lib/tree/parsers/powerParser.js +2 -1
- package/lib/tree/parsers/trinomParser.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fluctuationInterval = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const sqrtNode_1 = require("../../../tree/nodes/functions/sqrtNode");
|
|
10
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
11
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
12
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
13
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
14
|
+
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
15
|
+
const intervalParser_1 = require("../../../tree/parsers/intervalParser");
|
|
16
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
17
|
+
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
18
|
+
const getPropositions = (nb, { answer, n, p, wordingType }) => {
|
|
19
|
+
const propositions = [];
|
|
20
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
21
|
+
while (propositions.length < nb) {
|
|
22
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({
|
|
23
|
+
n: (0, coinFlip_1.coinFlip)() ? n : 50 * (0, randint_1.randint)(1, 20),
|
|
24
|
+
p: (0, coinFlip_1.coinFlip)() ? p : (0, randfloat_1.randfloat)(0.2, 0.8, 2),
|
|
25
|
+
wordingType,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
return (0, exercise_1.shuffleProps)(propositions, nb);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
//p-1/sqrt(n), p+1/sqrt(n)
|
|
32
|
+
const { p, n } = identifiers;
|
|
33
|
+
const oneOverSqrt = 1 / Math.sqrt(n);
|
|
34
|
+
const a = (0, round_1.round)(p - oneOverSqrt, 2);
|
|
35
|
+
const b = (0, round_1.round)(p + oneOverSqrt, 2);
|
|
36
|
+
return new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure_1.ClosureType.FF).toTex();
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { p, n } = identifiers;
|
|
40
|
+
const pPercent = (0, round_1.round)(p * 100, 1);
|
|
41
|
+
switch (identifiers.wordingType) {
|
|
42
|
+
case 1:
|
|
43
|
+
return `Une urne opaque contient $${pPercent}\\%$ de boules rouges. On effectue $${n}$ tirages avec remise. On note $f$ la fréquence des boules rouges tirées. Au seuil de $95\\%$, à quel intervalle devrait appartenir $f$ ? Arrondir les données au centième.`;
|
|
44
|
+
case 2:
|
|
45
|
+
return `Une loterie contient $${pPercent}\\%$ de tickets gagnants. Un joueur achète $${n}$ tickets. On note $f$ la fréquence des tickets gagnants achetés par le joueur. Au seuil de $95\\%$, à quel intervalle devrait appartenir $f$ ? Arrondir les données au centième.`;
|
|
46
|
+
case 3:
|
|
47
|
+
default:
|
|
48
|
+
return `Un fabricant prétend que $${pPercent}\\%$ de ses produits sont recyclables. Dans un contrôle qualité sur un échantillon de $${n}$ produits, quel sera l'intervalle probable pour la fréquence observée de produits recyclables, avec un seuil de confiance de 99% ?`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const getHint = (identifiers) => {
|
|
52
|
+
return `Si $p$ est la proportion théorique et $n$ est la taille de l'échantillon, alors l'intervalle de fluctuation au seuil de $95\\%$ est :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
\\left[p-\\frac{1}{\\sqrt{n}}; p+\\frac{1}{\\sqrt{n}}\\right]
|
|
56
|
+
$$
|
|
57
|
+
|
|
58
|
+
Cela signifie que dans $95\\%$ des cas, la fréquence $f$ observée est comprise entre $p-\\frac{1}{\\sqrt{n}}$ et $p+\\frac{1}{\\sqrt{n}}$.`;
|
|
59
|
+
};
|
|
60
|
+
const getCorrection = (identifiers) => {
|
|
61
|
+
const { p, n } = identifiers;
|
|
62
|
+
const pPercent = (0, round_1.round)(p * 100, 1);
|
|
63
|
+
const answer = getAnswer(identifiers);
|
|
64
|
+
const a = (0, substractNode_1.substract)(p, (0, fractionNode_1.frac)(1, (0, sqrtNode_1.sqrt)(n))).toTex();
|
|
65
|
+
const b = (0, addNode_1.add)(p, (0, fractionNode_1.frac)(1, (0, sqrtNode_1.sqrt)(n))).toTex();
|
|
66
|
+
return `La proportion théorique $p$ est $p = ${p.frenchify()}$. La taille de l'échantillon $n$ est $n = ${n.frenchify()}$.
|
|
67
|
+
|
|
68
|
+
On sait que l'intervalle de fluctuation au seuil de $95\\%$ est :
|
|
69
|
+
|
|
70
|
+
$$
|
|
71
|
+
\\left[p-\\frac{1}{\\sqrt{n}}; p+\\frac{1}{\\sqrt{n}}\\right]
|
|
72
|
+
$$
|
|
73
|
+
|
|
74
|
+
Dans $95\\%$ des cas, on peut donc affirmer que la fréquence $f$ observée devrait appartenir à l'intervalle :
|
|
75
|
+
|
|
76
|
+
${(0, alignTex_1.alignTex)([
|
|
77
|
+
["", `\\left[ ${a} ; ${b} \\right]`],
|
|
78
|
+
["=", answer],
|
|
79
|
+
])}
|
|
80
|
+
`;
|
|
81
|
+
};
|
|
82
|
+
const getKeys = (identifiers) => {
|
|
83
|
+
return ["lbracket", "semicolon", "rbracket"];
|
|
84
|
+
};
|
|
85
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
86
|
+
try {
|
|
87
|
+
const parsed = (0, intervalParser_1.intervalParser)(ans);
|
|
88
|
+
if (!parsed)
|
|
89
|
+
return false;
|
|
90
|
+
return parsed.toTex() === answer;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const getFluctuationIntervalQuestion = (ops) => {
|
|
97
|
+
const p = (0, randfloat_1.randfloat)(0.2, 0.8, 2);
|
|
98
|
+
const n = 50 * (0, randint_1.randint)(1, 20);
|
|
99
|
+
const identifiers = {
|
|
100
|
+
p,
|
|
101
|
+
n,
|
|
102
|
+
wordingType: (0, randint_1.randint)(1, 4),
|
|
103
|
+
};
|
|
104
|
+
const question = {
|
|
105
|
+
answer: getAnswer(identifiers),
|
|
106
|
+
instruction: getInstruction(identifiers),
|
|
107
|
+
keys: getKeys(identifiers),
|
|
108
|
+
answerFormat: "tex",
|
|
109
|
+
identifiers,
|
|
110
|
+
hint: getHint(identifiers),
|
|
111
|
+
correction: getCorrection(identifiers),
|
|
112
|
+
};
|
|
113
|
+
return question;
|
|
114
|
+
};
|
|
115
|
+
exports.fluctuationInterval = {
|
|
116
|
+
id: "fluctuationInterval",
|
|
117
|
+
connector: "=",
|
|
118
|
+
label: "Déterminer l'intervalle de fluctuation au seuil de $95\\%$",
|
|
119
|
+
isSingleStep: true,
|
|
120
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFluctuationIntervalQuestion(opts), nb),
|
|
121
|
+
qcmTimer: 60,
|
|
122
|
+
freeTimer: 60,
|
|
123
|
+
getPropositions,
|
|
124
|
+
isAnswerValid,
|
|
125
|
+
subject: "Mathématiques",
|
|
126
|
+
getInstruction,
|
|
127
|
+
getHint,
|
|
128
|
+
getCorrection,
|
|
129
|
+
getAnswer,
|
|
130
|
+
hasHintAndCorrection: true,
|
|
131
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fluctuationInterval"), exports);
|
|
18
|
+
__exportStar(require("./confidenceInterval"), exports);
|
|
19
|
+
__exportStar(require("./isSamplingRepresentative"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
p: number;
|
|
4
|
+
k: number;
|
|
5
|
+
n: number;
|
|
6
|
+
isRepresentative: boolean;
|
|
7
|
+
wordingType: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const isSamplingRepresentative: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=isSamplingRepresentative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSamplingRepresentative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/isSamplingRepresentative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4GF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAiB1D,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSamplingRepresentative = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
10
|
+
const getPropositions = (n, { answer }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
13
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
16
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
17
|
+
};
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
return identifiers.isRepresentative ? "Oui" : "Non";
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = (identifiers) => {
|
|
22
|
+
const { p, k, n, wordingType } = identifiers;
|
|
23
|
+
switch (wordingType) {
|
|
24
|
+
case 1:
|
|
25
|
+
return `La fréquence des yeux bleus en France est d'environ $${p.frenchify()}$. On a prélevé un échantillon de $${n}$ individus dont $${k}$ ont les yeux bleus. Cet échantillon est-il représentatif de la population pour ce caractère ?`;
|
|
26
|
+
case 2:
|
|
27
|
+
return `La proportion de français possédant un animal de compagnie est d'environ $${p.frenchify()}$. On a prélevé un échantillon de $${n}$ individus dont $${k}$ possèdent un animal de compagnie. Cet échantillon est-il représentatif de la population pour ce caractère ?`;
|
|
28
|
+
case 3:
|
|
29
|
+
default:
|
|
30
|
+
return `La proportion de français lisant au moins un livre par an est d'environ $${p.frenchify()}$. On a prélevé un échantillon de $${n}$ individus dont $${k}$ lisent au moins un livre par an. Cet échantillon est-il représentatif de la population pour ce caractère ?`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const getHint = (identifiers) => {
|
|
34
|
+
return `Déterminer l'intervalle de fluctuation au seuil de $95\\%$ :
|
|
35
|
+
|
|
36
|
+
$$
|
|
37
|
+
\\left[p-\\frac{1}{\\sqrt{n}}; p+\\frac{1}{\\sqrt{n}}\\right]
|
|
38
|
+
$$
|
|
39
|
+
|
|
40
|
+
où $p$ est la proportion théorique et $n$ est la taille de l'échantillon.
|
|
41
|
+
|
|
42
|
+
Si la fréquence $f$ observée est comprise dans cet intervalle, alors l'échantillon est représentatif de la population pour ce caractère, au seuil de $95\\%$.
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
45
|
+
const getCorrection = (identifiers) => {
|
|
46
|
+
const { p, n, k } = identifiers;
|
|
47
|
+
return `L'échantillon est représentatif si la fréquence $f$ observée est comprise dans l'intervalle de fluctuation.
|
|
48
|
+
|
|
49
|
+
On détermine l'intervalle de fluctuation au seuil de $95\\%$ :
|
|
50
|
+
|
|
51
|
+
$$
|
|
52
|
+
\\left[p-\\frac{1}{\\sqrt{n}}; p+\\frac{1}{\\sqrt{n}}\\right] \\approx \\left[${(0, round_1.round)(p - 1 / Math.sqrt(n), 2).frenchify()} ; ${(0, round_1.round)(p + 1 / Math.sqrt(n), 2).frenchify()} \\right]
|
|
53
|
+
$$
|
|
54
|
+
|
|
55
|
+
Puis, on calcule la fréquence $f$ observée :
|
|
56
|
+
|
|
57
|
+
$$
|
|
58
|
+
f = \\frac{${k}}{${n}} \\approx ${(0, round_1.round)(k / n, 2).frenchify()}
|
|
59
|
+
$$
|
|
60
|
+
|
|
61
|
+
${identifiers.isRepresentative
|
|
62
|
+
? `Puisque $f$ appartient bien à l'intervalle de fluctuation, on peut affirmer que l'échantillon est représentatif au seuil de $95\\%$.`
|
|
63
|
+
: `Puisque $f$ n'appartient pas à l'intervalle de fluctuation, on peut affirmer que l'échantillon n'est pas représentatif au seuil de $95\\%$.`}`;
|
|
64
|
+
};
|
|
65
|
+
const getKeys = (identifiers) => {
|
|
66
|
+
return [];
|
|
67
|
+
};
|
|
68
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
69
|
+
throw Error("VEA not implemented");
|
|
70
|
+
};
|
|
71
|
+
const getIsSamplingRepresentativeQuestion = (ops) => {
|
|
72
|
+
const p = (0, randfloat_1.randfloat)(0.2, 0.8, 2);
|
|
73
|
+
const n = 50 * (0, randint_1.randint)(1, 20);
|
|
74
|
+
const isRepresentative = (0, coinFlip_1.coinFlip)();
|
|
75
|
+
//k est dans n*(p-1/sqrt(n)), n*(p+1/sqrt(n))
|
|
76
|
+
const interval = [p - 1 / Math.sqrt(n), p + 1 / Math.sqrt(n)];
|
|
77
|
+
const k = isRepresentative
|
|
78
|
+
? (0, randint_1.randint)(Math.ceil(n * interval[0]), Math.floor(n * interval[1]))
|
|
79
|
+
: (0, coinFlip_1.coinFlip)()
|
|
80
|
+
? (0, randint_1.randint)(1, Math.floor(n * interval[0]))
|
|
81
|
+
: (0, randint_1.randint)(Math.ceil(n * interval[1]), n - 1);
|
|
82
|
+
const identifiers = {
|
|
83
|
+
p,
|
|
84
|
+
k,
|
|
85
|
+
n,
|
|
86
|
+
isRepresentative,
|
|
87
|
+
wordingType: (0, randint_1.randint)(1, 4),
|
|
88
|
+
};
|
|
89
|
+
const question = {
|
|
90
|
+
answer: getAnswer(identifiers),
|
|
91
|
+
instruction: getInstruction(identifiers),
|
|
92
|
+
keys: getKeys(identifiers),
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers,
|
|
95
|
+
hint: getHint(identifiers),
|
|
96
|
+
correction: getCorrection(identifiers),
|
|
97
|
+
};
|
|
98
|
+
return question;
|
|
99
|
+
};
|
|
100
|
+
exports.isSamplingRepresentative = {
|
|
101
|
+
id: "isSamplingRepresentative",
|
|
102
|
+
label: "Déterminer si un échantillon est représentatif",
|
|
103
|
+
isSingleStep: true,
|
|
104
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getIsSamplingRepresentativeQuestion(opts), nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getInstruction,
|
|
111
|
+
getHint,
|
|
112
|
+
getCorrection,
|
|
113
|
+
getAnswer,
|
|
114
|
+
hasHintAndCorrection: true,
|
|
115
|
+
answerType: "QCU",
|
|
116
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
q: NodeIdentifiers;
|
|
5
|
+
a: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const geometricVariations: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=geometricVariations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAM1C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.geometricVariations = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
8
|
+
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
12
|
+
const getPropositions = (n, { answer }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Strictement croissante", "raw");
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Strictement décroissante", "raw");
|
|
17
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Constante", "raw");
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non monotone", "raw");
|
|
19
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const qEv = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q).evaluate();
|
|
23
|
+
if (qEv > 1) {
|
|
24
|
+
return identifiers.a > 0
|
|
25
|
+
? "Strictement croissante"
|
|
26
|
+
: "Strictement décroissante";
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return identifiers.a > 0
|
|
30
|
+
? "Strictement décroissante"
|
|
31
|
+
: "Strictement croissante";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const getInstruction = (identifiers) => {
|
|
35
|
+
const q = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q);
|
|
36
|
+
const a = identifiers.a;
|
|
37
|
+
const statement = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.power)(q, "n")).simplify();
|
|
38
|
+
return `Soit $u$ la suite définie sur $\\mathbb{N}$ par
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
u_n = ${statement.toTex()}
|
|
42
|
+
$$
|
|
43
|
+
|
|
44
|
+
Quel est le sens de variations de $u$ ?`;
|
|
45
|
+
};
|
|
46
|
+
const getHint = (identifiers) => {
|
|
47
|
+
return `La suite géométrique $u_n = q^n$ est :
|
|
48
|
+
|
|
49
|
+
- strictement croissante si $q>1$;
|
|
50
|
+
- strictement décroissante si $0<q<1$.
|
|
51
|
+
|
|
52
|
+
Puis, multiplier $u$ par un nombre positif ne change pas son sens de variations, tandis que multiplier par un nombre negatif inverse le sens de variations.
|
|
53
|
+
`;
|
|
54
|
+
};
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const q = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q);
|
|
57
|
+
const qEv = q.evaluate();
|
|
58
|
+
const qLessThanOne = qEv < 1;
|
|
59
|
+
const a = identifiers.a;
|
|
60
|
+
const answer = getAnswer(identifiers);
|
|
61
|
+
const statement = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.power)(q, "x")).simplify();
|
|
62
|
+
return `Puisque $${qLessThanOne ? `0 < ${q.toTex()} < 1` : `${q.toTex()}>1`}$, la suite $${(0, powerNode_1.power)(q, "n").toTex()}$ est strictement ${qLessThanOne ? "décroissante" : " croissante"}.
|
|
63
|
+
|
|
64
|
+
En multipliant $${(0, powerNode_1.power)(q, "n").toTex()}$ par $${a.frenchify()} ${a < 0 ? "<0" : ">0"}$, ${a < 0
|
|
65
|
+
? `on inverse son sens de variations.`
|
|
66
|
+
: `on ne change pas son sens de variation.`}
|
|
67
|
+
|
|
68
|
+
Ainsi, la suite $u_n = ${statement.toTex()}$ est ${answer.toLocaleLowerCase()}.
|
|
69
|
+
`;
|
|
70
|
+
};
|
|
71
|
+
const getKeys = (identifiers) => {
|
|
72
|
+
return [];
|
|
73
|
+
};
|
|
74
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
75
|
+
return ans === answer;
|
|
76
|
+
};
|
|
77
|
+
const getGeometricVariationsQuestion = (ops) => {
|
|
78
|
+
const a = (0, randfloat_1.randfloat)(0.1, 3, 2, [1]) * ((0, coinFlip_1.coinFlip)() ? 1 : -1);
|
|
79
|
+
const qLessThanOne = (0, coinFlip_1.coinFlip)();
|
|
80
|
+
let q;
|
|
81
|
+
if (qLessThanOne) {
|
|
82
|
+
q = (0, coinFlip_1.coinFlip)()
|
|
83
|
+
? (0, randfloat_1.randfloat)(0.1, 1, 2).toTree()
|
|
84
|
+
: rational_1.RationalConstructor.randomIrreductibleProba().toTree();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
q = (0, coinFlip_1.coinFlip)()
|
|
88
|
+
? (0, randfloat_1.randfloat)(1.1, 10, 2).toTree()
|
|
89
|
+
: rational_1.RationalConstructor.randomIrreductible(11, {
|
|
90
|
+
onlySupOne: true,
|
|
91
|
+
}).toTree();
|
|
92
|
+
}
|
|
93
|
+
const identifiers = {
|
|
94
|
+
a,
|
|
95
|
+
q: q.toIdentifiers(),
|
|
96
|
+
};
|
|
97
|
+
const question = {
|
|
98
|
+
answer: getAnswer(identifiers),
|
|
99
|
+
instruction: getInstruction(identifiers),
|
|
100
|
+
keys: getKeys(identifiers),
|
|
101
|
+
answerFormat: "raw",
|
|
102
|
+
identifiers,
|
|
103
|
+
hint: getHint(identifiers),
|
|
104
|
+
correction: getCorrection(identifiers),
|
|
105
|
+
};
|
|
106
|
+
return question;
|
|
107
|
+
};
|
|
108
|
+
exports.geometricVariations = {
|
|
109
|
+
id: "geometricVariations",
|
|
110
|
+
label: "Déterminer le sens de variations d'une suite géométrique",
|
|
111
|
+
isSingleStep: true,
|
|
112
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getGeometricVariationsQuestion(opts), nb),
|
|
113
|
+
qcmTimer: 60,
|
|
114
|
+
freeTimer: 60,
|
|
115
|
+
getPropositions,
|
|
116
|
+
isAnswerValid,
|
|
117
|
+
subject: "Mathématiques",
|
|
118
|
+
getInstruction,
|
|
119
|
+
getHint,
|
|
120
|
+
getCorrection,
|
|
121
|
+
getAnswer,
|
|
122
|
+
answerType: "QCU",
|
|
123
|
+
hasHintAndCorrection: true,
|
|
124
|
+
};
|
|
@@ -8,4 +8,5 @@ export * from "./geometricFindExplicitFormulaFirstTermRandom";
|
|
|
8
8
|
export * from "./geometricFindTerm";
|
|
9
9
|
export * from "./geometricRecognizeReasonFromFirstTerms";
|
|
10
10
|
export * from "./geometricFirstTermsGeneralSum";
|
|
11
|
+
export * from "./geometricVariations";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
|
|
@@ -24,3 +24,4 @@ __exportStar(require("./geometricFindExplicitFormulaFirstTermRandom"), exports);
|
|
|
24
24
|
__exportStar(require("./geometricFindTerm"), exports);
|
|
25
25
|
__exportStar(require("./geometricRecognizeReasonFromFirstTerms"), exports);
|
|
26
26
|
__exportStar(require("./geometricFirstTermsGeneralSum"), exports);
|
|
27
|
+
__exportStar(require("./geometricVariations"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
|
|
@@ -5,14 +5,14 @@ const toolBarConstructor = (options) => {
|
|
|
5
5
|
let customToolBar = "0||6";
|
|
6
6
|
if (options.point)
|
|
7
7
|
customToolBar += "||1";
|
|
8
|
+
if (options.intersect)
|
|
9
|
+
customToolBar += "||5";
|
|
8
10
|
if (options.join)
|
|
9
11
|
customToolBar += "||2";
|
|
10
12
|
if (options.parallel)
|
|
11
13
|
customToolBar += "||3";
|
|
12
14
|
if (options.orthogonal)
|
|
13
15
|
customToolBar += "||4";
|
|
14
|
-
if (options.intersect)
|
|
15
|
-
customToolBar += "||5";
|
|
16
16
|
if (options.vector)
|
|
17
17
|
customToolBar += "||7";
|
|
18
18
|
if (options.circleTwoPoints)
|
|
@@ -4,7 +4,7 @@ exports.parseGGBPoints = void 0;
|
|
|
4
4
|
const deleteObjectNamesFromAnswer_1 = require("../deleteObjectNamesFromAnswer");
|
|
5
5
|
const parseGGBPoints = (commands) => {
|
|
6
6
|
const unnamed = (0, deleteObjectNamesFromAnswer_1.deleteObjectNamesFromAnswer)(commands);
|
|
7
|
-
const re =
|
|
7
|
+
const re = /^\([^,]*,[^)]*\)/;
|
|
8
8
|
return unnamed.filter((cmd) => !!cmd.match(re)?.length);
|
|
9
9
|
};
|
|
10
10
|
exports.parseGGBPoints = parseGGBPoints;
|
package/lib/index.d.ts
CHANGED
|
@@ -903,6 +903,9 @@ declare const mathExercises: (Exercise<{
|
|
|
903
903
|
b: number;
|
|
904
904
|
aU: number;
|
|
905
905
|
bU: number;
|
|
906
|
+
}, {}> | Exercise<{
|
|
907
|
+
q: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
|
|
908
|
+
a: number;
|
|
906
909
|
}, {}> | Exercise<{
|
|
907
910
|
coin: boolean;
|
|
908
911
|
radius: number;
|
|
@@ -1186,6 +1189,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1186
1189
|
}, {
|
|
1187
1190
|
useVector: boolean;
|
|
1188
1191
|
}> | Exercise<{
|
|
1192
|
+
point: import("./math/geometry/point").PointIdentifiers;
|
|
1193
|
+
line: import("./math/geometry/line").LineIdentifiers;
|
|
1194
|
+
}, {}> | Exercise<{
|
|
1189
1195
|
type: number;
|
|
1190
1196
|
commands: string[];
|
|
1191
1197
|
}, {}> | Exercise<{
|
|
@@ -1305,6 +1311,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1305
1311
|
subPopulationEffectif: number;
|
|
1306
1312
|
subPopulationPercent: number;
|
|
1307
1313
|
contextType: number;
|
|
1314
|
+
}, {}> | Exercise<{
|
|
1315
|
+
vd: number;
|
|
1316
|
+
percentRate: number;
|
|
1308
1317
|
}, {}> | Exercise<{
|
|
1309
1318
|
int: number;
|
|
1310
1319
|
power: number;
|
|
@@ -1339,6 +1348,12 @@ declare const mathExercises: (Exercise<{
|
|
|
1339
1348
|
}> | Exercise<{
|
|
1340
1349
|
tenPower: number;
|
|
1341
1350
|
decimal: number;
|
|
1351
|
+
}, {}> | Exercise<{
|
|
1352
|
+
a: number;
|
|
1353
|
+
b: number;
|
|
1354
|
+
k: number;
|
|
1355
|
+
l: number;
|
|
1356
|
+
m: number;
|
|
1342
1357
|
}, {}> | Exercise<{
|
|
1343
1358
|
c: number;
|
|
1344
1359
|
}, {}> | Exercise<{
|
|
@@ -1590,6 +1605,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1590
1605
|
firstValue: number;
|
|
1591
1606
|
reason: number;
|
|
1592
1607
|
nbTerms: number;
|
|
1608
|
+
}, {}> | Exercise<{
|
|
1609
|
+
q: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
|
|
1610
|
+
a: number;
|
|
1593
1611
|
}, {}> | Exercise<{
|
|
1594
1612
|
rank: number;
|
|
1595
1613
|
coeffs: number[];
|
|
@@ -1771,6 +1789,20 @@ declare const mathExercises: (Exercise<{
|
|
|
1771
1789
|
n: number;
|
|
1772
1790
|
p: number;
|
|
1773
1791
|
};
|
|
1792
|
+
}, {}> | Exercise<{
|
|
1793
|
+
p: number;
|
|
1794
|
+
n: number;
|
|
1795
|
+
wordingType: number;
|
|
1796
|
+
}, {}> | Exercise<{
|
|
1797
|
+
k: number;
|
|
1798
|
+
n: number;
|
|
1799
|
+
wordingType: number;
|
|
1800
|
+
}, {}> | Exercise<{
|
|
1801
|
+
p: number;
|
|
1802
|
+
k: number;
|
|
1803
|
+
n: number;
|
|
1804
|
+
isRepresentative: boolean;
|
|
1805
|
+
wordingType: number;
|
|
1774
1806
|
}, {}>)[];
|
|
1775
1807
|
declare const pcExercises: (Exercise<{
|
|
1776
1808
|
numbers: number[];
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToGGBCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps";
|
|
2
|
+
import { Point } from "./point";
|
|
3
|
+
export declare class Circle {
|
|
4
|
+
center: Point;
|
|
5
|
+
point: Point;
|
|
6
|
+
name: string;
|
|
7
|
+
constructor(center: Point, point: Point, name?: string);
|
|
8
|
+
toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, }?: ToGGBCommandsProps): string[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=circle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,MAAM;IACjB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;gBACD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM;IAMtD,aAAa,CACX,iBAAiB,EAAE,OAAO,EAC1B,EACE,OAAc,EACd,SAAiB,EACjB,yBAAgC,EAChC,oBAA2B,GAC5B,GAAE,kBAAuB;CAkC7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Circle = void 0;
|
|
4
|
+
class Circle {
|
|
5
|
+
constructor(center, point, name) {
|
|
6
|
+
this.center = center;
|
|
7
|
+
this.point = point;
|
|
8
|
+
this.name = name ?? "C";
|
|
9
|
+
}
|
|
10
|
+
toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, showUnderlyingPoints = true, } = {}) {
|
|
11
|
+
const commands = [];
|
|
12
|
+
if (shouldBuildPoints) {
|
|
13
|
+
const ACommands = this.center.toGGBCommand({
|
|
14
|
+
isFixed,
|
|
15
|
+
showLabel: showUnderlyingPointsLabel,
|
|
16
|
+
});
|
|
17
|
+
const BCommands = this.point.toGGBCommand({
|
|
18
|
+
isFixed,
|
|
19
|
+
showLabel: showUnderlyingPointsLabel,
|
|
20
|
+
});
|
|
21
|
+
commands.push(...ACommands, ...BCommands, `${this.name}=Circle(${this.center.name},${this.point.name})`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
commands.push(`${this.name}=Circle(${this.center.toMathString()},${this.point.toMathString()})`);
|
|
25
|
+
}
|
|
26
|
+
commands.push(...[
|
|
27
|
+
`SetFixed(${this.name},${isFixed ? "true" : "false"})`,
|
|
28
|
+
`ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
|
|
29
|
+
]);
|
|
30
|
+
return commands;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Circle = Circle;
|
|
@@ -49,7 +49,7 @@ export declare class Line {
|
|
|
49
49
|
};
|
|
50
50
|
toTex(): string;
|
|
51
51
|
toTexNoLeftRight(): string;
|
|
52
|
-
toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, }?: ToGGBCommandsProps): string[];
|
|
52
|
+
toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, showUnderlyingPoints, }?: ToGGBCommandsProps): string[];
|
|
53
53
|
intersect(line: Line, intersectName?: string): Point;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAO,MAAM,oCAAoC,CAAC;AAMlE,OAAO,EACL,aAAa,EAEd,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAqB,MAAM,UAAU,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AACF,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;IAO3B,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,eAAe;IAOnD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO;CAGpC;AACD,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,S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