math-exercises 2.2.17 → 2.2.19
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/exercise.d.ts +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +9 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +9 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.js +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +77 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +1 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +1 -0
- package/lib/exercises/math/functions/basics/imageFunction.js +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
- package/lib/exercises/math/geometry/cartesian/index.d.ts +1 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +2 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts +8 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +101 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts +8 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +103 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +8 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +125 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +17 -0
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/index.js +2 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +1 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +55 -0
- package/lib/exercises/math/geometry/vectors/scalarProductViaCos.js +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +1 -1
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
- package/lib/exercises/math/percent/htToTTC.js +16 -1
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
- package/lib/exercises/math/percent/ttcToHT.js +16 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.js +21 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +9 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.js +1 -1
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
- package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -1
- package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +1 -1
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +1 -1
- package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +1 -1
- package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -1
- package/lib/exercises/pc/energy/energyTransfer.js +1 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +1 -1
- package/lib/exercises/pc/mole/molarMass.js +1 -1
- package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +1 -1
- package/lib/exercises/pc/motion/motionReference.js +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
- package/lib/exercises/utils/geometry/randomSegmentName.d.ts +2 -0
- package/lib/exercises/utils/geometry/randomSegmentName.d.ts.map +1 -0
- package/lib/exercises/utils/geometry/randomSegmentName.js +10 -0
- package/lib/geogebra/geogebraConstructor.js +1 -1
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- 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 +12 -3
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +10 -0
- package/lib/math/geometry/segment.d.ts +9 -0
- package/lib/math/geometry/segment.d.ts.map +1 -0
- package/lib/math/geometry/segment.js +16 -0
- package/lib/tree/nodes/inequations/inequationNode.js +1 -1
- package/lib/tree/parsers/numberParser.d.ts +2 -0
- package/lib/tree/parsers/numberParser.d.ts.map +1 -0
- package/lib/tree/parsers/numberParser.js +11 -0
- package/lib/utils/strings/isLetter.d.ts +2 -0
- package/lib/utils/strings/isLetter.d.ts.map +1 -0
- package/lib/utils/strings/isLetter.js +7 -0
- package/lib/utils/strings/pluralize.d.ts +2 -0
- package/lib/utils/strings/pluralize.d.ts.map +1 -0
- package/lib/utils/strings/pluralize.js +12 -0
- package/lib/utils/strings/randomLetter.d.ts +2 -0
- package/lib/utils/strings/randomLetter.d.ts.map +1 -0
- package/lib/utils/strings/randomLetter.js +11 -0
- package/lib/utils/strings/requiresApostropheBefore.d.ts +2 -0
- package/lib/utils/strings/requiresApostropheBefore.d.ts.map +1 -0
- package/lib/utils/strings/requiresApostropheBefore.js +7 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC"}
|
|
@@ -22,3 +22,5 @@ __exportStar(require("./thales"), exports);
|
|
|
22
22
|
__exportStar(require("./vectors"), exports);
|
|
23
23
|
__exportStar(require("./convexity"), exports);
|
|
24
24
|
__exportStar(require("./volumes"), exports);
|
|
25
|
+
// export * from "./triangles";
|
|
26
|
+
__exportStar(require("./euclidianConstructions"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=traceMedianInTriangle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceMedianInTriangle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/traceMedianInTriangle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {
|
|
3
|
+
// Exercise,
|
|
4
|
+
// Proposition,
|
|
5
|
+
// QCMGenerator,
|
|
6
|
+
// Question,
|
|
7
|
+
// QuestionGenerator,
|
|
8
|
+
// VEA,
|
|
9
|
+
// GGBVEA,
|
|
10
|
+
// addValidProp,
|
|
11
|
+
// shuffleProps,
|
|
12
|
+
// tryToAddWrongProp,
|
|
13
|
+
// } from '../../../../exercises/exercise';
|
|
14
|
+
// import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions';
|
|
15
|
+
// type Identifiers = {
|
|
16
|
+
// };
|
|
17
|
+
// const getTraceMedianInTriangleQuestion: QuestionGenerator<Identifiers> = ()=>{
|
|
18
|
+
// const question: Question<Identifiers> = {
|
|
19
|
+
// answer,
|
|
20
|
+
// instruction: ``,
|
|
21
|
+
// keys: [],
|
|
22
|
+
// answerFormat: 'tex',
|
|
23
|
+
// identifiers : {}
|
|
24
|
+
// };
|
|
25
|
+
// return question;
|
|
26
|
+
// }
|
|
27
|
+
// const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
|
|
28
|
+
// const propositions: Proposition[] = [];
|
|
29
|
+
// addValidProp(propositions, answer);
|
|
30
|
+
// while (propositions.length < n) {
|
|
31
|
+
// throw Error("QCM not implemented")
|
|
32
|
+
// }
|
|
33
|
+
// return shuffleProps(propositions, n);
|
|
34
|
+
// };
|
|
35
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, {answer})=>{
|
|
36
|
+
// throw Error("VEA not implemented")
|
|
37
|
+
// }
|
|
38
|
+
// const isGGBAnswerValid: GGBVEA<Identifiers> = (ans, {ggbAnswer}) => {
|
|
39
|
+
// throw Error("GGBVea not implemented")
|
|
40
|
+
// }
|
|
41
|
+
// export const traceMedianInTriangle: Exercise<Identifiers> = {
|
|
42
|
+
// id: 'traceMedianInTriangle',
|
|
43
|
+
// connector: "",
|
|
44
|
+
// label: "",
|
|
45
|
+
// levels: [],
|
|
46
|
+
// isSingleStep: true,
|
|
47
|
+
// sections: [],
|
|
48
|
+
// generator: (nb: number) => getDistinctQuestions(getTraceMedianInTriangleQuestion, nb),
|
|
49
|
+
// qcmTimer: 60,
|
|
50
|
+
// freeTimer: 60,
|
|
51
|
+
// getPropositions,
|
|
52
|
+
// isAnswerValid,
|
|
53
|
+
// isGGBAnswerValid,
|
|
54
|
+
// subject: "Mathématiques"
|
|
55
|
+
// };
|
|
@@ -8,7 +8,7 @@ const remarkableValues_1 = require("../../../../math/trigonometry/remarkableValu
|
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
|
-
const randomLetter_1 = require("../../../../utils/randomLetter");
|
|
11
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
12
12
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
13
13
|
//|u| |v| cos(u,v)
|
|
14
14
|
const getScalarProductViaCosQuestion = () => {
|
|
@@ -6,7 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
7
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
8
8
|
const alignTex_1 = require("../../../../utils/alignTex");
|
|
9
|
-
const randomLetter_1 = require("../../../../utils/randomLetter");
|
|
9
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
10
10
|
const getVectorCoordinatesFromTwoPointsQuestion = () => {
|
|
11
11
|
const A = [(0, randint_1.randint)(-9, 9), (0, randint_1.randint)(-9, 9)];
|
|
12
12
|
const B = [(0, randint_1.randint)(-9, 9), (0, randint_1.randint)(-9, 9)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA6CF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAczC,CAAC"}
|
|
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
6
6
|
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
9
10
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
11
|
const random_1 = require("../../../utils/random");
|
|
11
12
|
const getHtToTtcQuestion = () => {
|
|
@@ -18,6 +19,19 @@ const getHtToTtcQuestion = () => {
|
|
|
18
19
|
keys: [],
|
|
19
20
|
answerFormat: "tex",
|
|
20
21
|
identifiers: { TVA, ht },
|
|
22
|
+
hint: `Pour augmenter un prix de $t\\%$, on le multiplie par $1 + \\frac{t}{100}$.`,
|
|
23
|
+
correction: `Pour augmenter $${ht.frenchify()}$ de $${TVA.frenchify()}\\%$, on le multiplie par :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
1 + \\frac{${TVA.frenchify()}}{100} = ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()}
|
|
27
|
+
$$
|
|
28
|
+
|
|
29
|
+
Le prix TTC est donc :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
${ht.frenchify()} \\times ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()} = ${answer}
|
|
33
|
+
$$
|
|
34
|
+
`,
|
|
21
35
|
};
|
|
22
36
|
return question;
|
|
23
37
|
};
|
|
@@ -32,7 +46,7 @@ const getPropositions = (n, { answer, TVA, ht }) => {
|
|
|
32
46
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
33
47
|
};
|
|
34
48
|
const isAnswerValid = (ans, { answer }) => {
|
|
35
|
-
return ans === answer;
|
|
49
|
+
return (0, numberParser_1.numberParser)(ans) === answer;
|
|
36
50
|
};
|
|
37
51
|
exports.htToTTC = {
|
|
38
52
|
id: "htToTTC",
|
|
@@ -47,4 +61,5 @@ exports.htToTTC = {
|
|
|
47
61
|
getPropositions,
|
|
48
62
|
isAnswerValid,
|
|
49
63
|
subject: "Mathématiques",
|
|
64
|
+
hasHintAndCorrection: true,
|
|
50
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAuDF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAczC,CAAC"}
|
|
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
6
6
|
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
9
10
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
11
|
const random_1 = require("../../../utils/random");
|
|
11
12
|
const getTtcToHtQuestion = () => {
|
|
@@ -18,6 +19,19 @@ const getTtcToHtQuestion = () => {
|
|
|
18
19
|
keys: [],
|
|
19
20
|
answerFormat: "tex",
|
|
20
21
|
identifiers: { TTC, TVA },
|
|
22
|
+
hint: `Pour retrouver le prix HT d'un objet après une hausse de $t\\%$, on divise le prix TTC par $1 + \\frac{t}{100}$.`,
|
|
23
|
+
correction: `Pour retrouver le prix HT après une hausse de $${TVA.frenchify()}\\%$, on divise le prix TTC par :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
1 + \\frac{${TVA.frenchify()}}{100} = ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()}
|
|
27
|
+
$$
|
|
28
|
+
|
|
29
|
+
Le prix HT est donc :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
${TTC.frenchify()} \\div ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()} \\approx ${answer}
|
|
33
|
+
$$
|
|
34
|
+
`,
|
|
21
35
|
};
|
|
22
36
|
return question;
|
|
23
37
|
};
|
|
@@ -32,7 +46,7 @@ const getPropositions = (n, { answer, TTC, TVA }) => {
|
|
|
32
46
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
33
47
|
};
|
|
34
48
|
const isAnswerValid = (ans, { answer }) => {
|
|
35
|
-
return ans === answer;
|
|
49
|
+
return (0, numberParser_1.numberParser)(ans) === answer;
|
|
36
50
|
};
|
|
37
51
|
exports.ttcToHT = {
|
|
38
52
|
id: "ttcToHT",
|
|
@@ -47,4 +61,5 @@ exports.ttcToHT = {
|
|
|
47
61
|
getPropositions,
|
|
48
62
|
isAnswerValid,
|
|
49
63
|
subject: "Mathématiques",
|
|
64
|
+
hasHintAndCorrection: true,
|
|
50
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAmEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -6,6 +6,8 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../../math/utils/round");
|
|
9
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
+
const operatorComposition_1 = require("../../../../tree/utilities/operatorComposition");
|
|
9
11
|
const average_1 = require("../../../../utils/average");
|
|
10
12
|
const getAverageListQuestion = () => {
|
|
11
13
|
let randomValues = [];
|
|
@@ -13,7 +15,9 @@ const getAverageListQuestion = () => {
|
|
|
13
15
|
for (let i = 0; i < length; i++)
|
|
14
16
|
randomValues.push((0, randint_1.randint)(1, 20));
|
|
15
17
|
const sortedValues = randomValues.sort((a, b) => a - b);
|
|
18
|
+
const avg = (0, average_1.average)(sortedValues);
|
|
16
19
|
const answer = (0, round_1.round)((0, average_1.average)(sortedValues), 2).frenchify();
|
|
20
|
+
const hasRounded = avg.frenchify() !== answer;
|
|
17
21
|
const question = {
|
|
18
22
|
answer,
|
|
19
23
|
instruction: `On considère la liste suivante : $${randomValues.join(";\\ ")}.$
|
|
@@ -21,6 +25,22 @@ const getAverageListQuestion = () => {
|
|
|
21
25
|
keys: [],
|
|
22
26
|
answerFormat: "tex",
|
|
23
27
|
identifiers: { sortedValues },
|
|
28
|
+
hint: "La moyenne d'une liste de valeurs est la somme de ses valeurs divisé par le nombre de valeurs.",
|
|
29
|
+
correction: `
|
|
30
|
+
On additionne toutes les valeurs :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
${(0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, sortedValues.map((e) => e.toTree())).toTex()} = ${sortedValues.reduce((acc, curr) => acc + curr)}
|
|
34
|
+
$$
|
|
35
|
+
|
|
36
|
+
puis on divise par le nombre de valeurs :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
${sortedValues.reduce((acc, curr) => acc + curr)}\\div ${sortedValues.length} ${hasRounded ? "\\approx" : "="} ${answer}
|
|
40
|
+
$$
|
|
41
|
+
|
|
42
|
+
La moyenne ${hasRounded ? "arrondie au centième" : ""} est donc $${answer}$.
|
|
43
|
+
`,
|
|
24
44
|
};
|
|
25
45
|
return question;
|
|
26
46
|
};
|
|
@@ -49,4 +69,5 @@ exports.averageList = {
|
|
|
49
69
|
getPropositions,
|
|
50
70
|
isAnswerValid,
|
|
51
71
|
subject: "Mathématiques",
|
|
72
|
+
hasHintAndCorrection: true,
|
|
52
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"etendueList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/etendueList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"etendueList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/etendueList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAmDF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -18,6 +18,14 @@ const getEtendueListQuestion = () => {
|
|
|
18
18
|
keys: [],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { sortedValues },
|
|
21
|
+
hint: "L'étendue d'une liste de valeurs est la différence entre la valeur maximale et la valeur minimale.",
|
|
22
|
+
correction: `
|
|
23
|
+
On calcule la différence entre la valeur maximale et la valeur minimale :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
${sortedValues[sortedValues.length - 1]} - ${sortedValues[0]} = ${answer}
|
|
27
|
+
$$
|
|
28
|
+
`,
|
|
21
29
|
};
|
|
22
30
|
return question;
|
|
23
31
|
};
|
|
@@ -46,4 +54,5 @@ exports.etendueList = {
|
|
|
46
54
|
getPropositions,
|
|
47
55
|
isAnswerValid,
|
|
48
56
|
subject: "Mathématiques",
|
|
57
|
+
hasHintAndCorrection: true,
|
|
49
58
|
};
|
|
@@ -7,7 +7,7 @@ const randint_1 = require("../../math/utils/random/randint");
|
|
|
7
7
|
const molecule_1 = require("../../pc/constants/molecularChemistry/molecule");
|
|
8
8
|
const arrayEqual_1 = require("../../utils/arrayEqual");
|
|
9
9
|
const random_1 = require("../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getPointFromGGB_1 = require("../utils/geogebra/getPointFromGGB");
|
|
12
12
|
const isGGBPoint_1 = require("../utils/geogebra/isGGBPoint");
|
|
13
13
|
const toolBarConstructor_1 = require("../utils/geogebra/toolBarConstructor");
|
|
@@ -7,7 +7,7 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
8
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getAtomicStructureOfNucleusQuestion = () => {
|
|
12
12
|
const atom = (0, random_1.random)(atome_1.atomes.slice(0, 50));
|
|
13
13
|
const mass = (0, round_1.round)(atom.masseAtomique, 0);
|
|
@@ -8,7 +8,7 @@ const round_1 = require("../../../math/utils/round");
|
|
|
8
8
|
const atoms_1 = require("../../../pc/constants/molecularChemistry/atoms");
|
|
9
9
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
10
10
|
const random_1 = require("../../../utils/random");
|
|
11
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
11
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
12
12
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
13
13
|
const getCalculateProtonsNumberFromMassQuestion = () => {
|
|
14
14
|
const atom = (0, random_1.random)(atome_1.atomes.slice(0, 50));
|
|
@@ -10,7 +10,7 @@ const atoms_1 = require("../../../pc/constants/molecularChemistry/atoms");
|
|
|
10
10
|
const measure_1 = require("../../../pc/measure/measure");
|
|
11
11
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
12
12
|
const random_1 = require("../../../utils/random");
|
|
13
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
13
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
14
14
|
const massUnits_1 = require("../../../pc/units/massUnits");
|
|
15
15
|
const getFindAtomEntitiesNumberFromMassQuestion = () => {
|
|
16
16
|
const atom = (0, random_1.random)(atome_1.atomes.slice(5, 30));
|
|
@@ -7,7 +7,7 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
8
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const possibleElements = [
|
|
12
12
|
"proton",
|
|
13
13
|
"neutron",
|
package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js
CHANGED
|
@@ -8,7 +8,7 @@ const getElectronicConfigurationFromShells_1 = require("../../../exercises/utils
|
|
|
8
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
9
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
10
10
|
const random_1 = require("../../../utils/random");
|
|
11
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
11
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
12
12
|
const getFindValenceElectronsNumberFromElectronicConfigurationQuestion = () => {
|
|
13
13
|
const atom = (0, random_1.random)((0, getAtoms_1.getAtoms)(3));
|
|
14
14
|
const configurationTex = (0, getElectronicConfigurationFromShells_1.getElectronicConfigurationFromShells)(atom.electronsShells);
|
|
@@ -7,7 +7,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getFindValenceElectronsNumberFromTableQuestion = () => {
|
|
12
12
|
const atom = (0, random_1.random)((0, getAtoms_1.getAtoms)(3));
|
|
13
13
|
const instruction = `
|
|
@@ -7,7 +7,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
7
7
|
const getElectronicConfigurationFromShells_1 = require("../../../exercises/utils/getElectronicConfigurationFromShells");
|
|
8
8
|
const atome_1 = require("../../../pc/constants/molecularChemistry/atome");
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getIdentifyRightElectronicConfigurationQuestion = () => {
|
|
12
12
|
const atom = (0, random_1.random)((0, getAtoms_1.getAtoms)(3).slice(2));
|
|
13
13
|
const question = {
|
|
@@ -7,7 +7,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
7
7
|
const random_1 = require("../../../utils/random");
|
|
8
8
|
const molecule_1 = require("../../../pc/constants/molecularChemistry/molecule");
|
|
9
9
|
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
12
12
|
const round_1 = require("../../../math/utils/round");
|
|
13
13
|
const getMassOrVolumeProportionQuestion = () => {
|
|
@@ -6,7 +6,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
8
|
const random_1 = require("../../../utils/random");
|
|
9
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
9
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
10
10
|
const combustibles = [
|
|
11
11
|
{ name: "bois", value: 15 },
|
|
12
12
|
{ name: "éthanol", value: 29 },
|
|
@@ -6,7 +6,7 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
6
6
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
8
|
const random_1 = require("../../../utils/random");
|
|
9
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
9
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
10
10
|
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
11
11
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
12
12
|
const molecule_1 = require("../../../pc/constants/molecularChemistry/molecule");
|
|
@@ -6,7 +6,7 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
6
6
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
7
7
|
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
9
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
10
10
|
const substances = [
|
|
11
11
|
{ name: "eau", latentHeat: 334 }, // kJ/kg for melting ice
|
|
12
12
|
{ name: "fer", latentHeat: 276 }, // kJ/kg for melting iron
|
|
@@ -7,7 +7,7 @@ const randint_1 = require("../../math/utils/random/randint");
|
|
|
7
7
|
const round_1 = require("../../math/utils/round");
|
|
8
8
|
const coinFlip_1 = require("../../utils/coinFlip");
|
|
9
9
|
const random_1 = require("../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getAtoms_1 = require("../utils/getAtoms");
|
|
12
12
|
const getIdentifyAtomicMassOrAtomicNbQuestion = () => {
|
|
13
13
|
const exo = generateExercise();
|
|
@@ -7,7 +7,7 @@ const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
8
|
const molecule_1 = require("../../../pc/constants/molecularChemistry/molecule");
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
10
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
11
11
|
const getMolarMassQuestion = () => {
|
|
12
12
|
const molecule = (0, random_1.random)(molecule_1.molecules.slice(0, 50).filter((m) => m.atoms.length > 1));
|
|
13
13
|
const article = (0, requiresApostropheBefore_1.requiresApostropheBefore)(molecule.name) ? "de l'" : "du ";
|
|
@@ -9,7 +9,7 @@ const molecule_1 = require("../../../pc/constants/molecularChemistry/molecule");
|
|
|
9
9
|
const random_1 = require("../../../utils/random");
|
|
10
10
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
11
|
const atoms_1 = require("../../../pc/constants/molecularChemistry/atoms");
|
|
12
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
12
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
13
13
|
const getMoleculeCountFromMassAndAvogadroQuestion = () => {
|
|
14
14
|
const molecule = (0, random_1.random)(molecule_1.molecules);
|
|
15
15
|
const sampleMass = (0, randfloat_1.randfloat)(0.1, 2, 2); // Sample mass in grams
|
|
@@ -5,7 +5,7 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
-
const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
|
|
8
|
+
const requiresApostropheBefore_1 = require("../../../utils/strings/requiresApostropheBefore");
|
|
9
9
|
const situations = [
|
|
10
10
|
{
|
|
11
11
|
object1: "avion de chasse",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAAa;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAAa;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,WAUA,CAAC"}
|
|
@@ -15,6 +15,8 @@ const toolBarConstructor = (options) => {
|
|
|
15
15
|
customToolBar += "||5";
|
|
16
16
|
if (options.vector)
|
|
17
17
|
customToolBar += "||7";
|
|
18
|
+
if (options.circleTwoPoints)
|
|
19
|
+
customToolBar += "||10";
|
|
18
20
|
return customToolBar;
|
|
19
21
|
};
|
|
20
22
|
exports.toolBarConstructor = toolBarConstructor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randomSegmentName.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geometry/randomSegmentName.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,cAI7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.randomSegmentName = void 0;
|
|
4
|
+
const randomLetter_1 = require("../../../utils/strings/randomLetter");
|
|
5
|
+
const randomSegmentName = () => {
|
|
6
|
+
const A = (0, randomLetter_1.randomLetter)(true);
|
|
7
|
+
const B = (0, randomLetter_1.randomLetter)(true, [A]);
|
|
8
|
+
return `${A}${B}`;
|
|
9
|
+
};
|
|
10
|
+
exports.randomSegmentName = randomSegmentName;
|
|
@@ -18,7 +18,7 @@ class GeogebraConstructor {
|
|
|
18
18
|
this.yAxis = options?.yAxis;
|
|
19
19
|
}
|
|
20
20
|
getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }) {
|
|
21
|
-
const showAxes = forceShowAxes ?? this.hideAxes ? false : true;
|
|
21
|
+
const showAxes = forceShowAxes ?? (this.hideAxes ? false : true);
|
|
22
22
|
const xDelta = xMax - xMin;
|
|
23
23
|
const yDelta = yMax - yMin;
|
|
24
24
|
if (this.is3D && zMin !== undefined && zMax !== undefined) {
|
package/lib/index.d.ts
CHANGED
|
@@ -149,6 +149,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
149
149
|
nbIds: any;
|
|
150
150
|
nbValue: number;
|
|
151
151
|
pow: number;
|
|
152
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
153
|
+
type: number;
|
|
154
|
+
a: number;
|
|
155
|
+
b: number;
|
|
152
156
|
}> | import("./exercises/exercise").Exercise<{
|
|
153
157
|
dec: number;
|
|
154
158
|
pow: number;
|
|
@@ -808,6 +812,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
808
812
|
}> | import("./exercises/exercise").Exercise<{
|
|
809
813
|
x: number;
|
|
810
814
|
y: number;
|
|
815
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
816
|
+
x: number;
|
|
817
|
+
y: number;
|
|
811
818
|
}> | import("./exercises/exercise").Exercise<{
|
|
812
819
|
coin: boolean;
|
|
813
820
|
radius: number;
|
|
@@ -957,6 +964,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
957
964
|
width: number;
|
|
958
965
|
height: number;
|
|
959
966
|
angle: number;
|
|
967
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
968
|
+
A: number[];
|
|
969
|
+
B: number[];
|
|
960
970
|
}> | import("./exercises/exercise").Exercise<{
|
|
961
971
|
coeffs: number[];
|
|
962
972
|
to: string;
|
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,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -10,7 +10,7 @@ export declare class Line {
|
|
|
10
10
|
b: AlgebraicNode | undefined;
|
|
11
11
|
constructor(pointA: Point, pointB: Point);
|
|
12
12
|
getParallele(point: Point): Line;
|
|
13
|
-
includes(point: Point): boolean;
|
|
13
|
+
includes(point: Point, allowApprox?: boolean): boolean;
|
|
14
14
|
getRandomPoint(name?: string): Point;
|
|
15
15
|
getEquation: (u: Vector, a: Point) => EqualNode;
|
|
16
16
|
getCartesianEquation(): EqualNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;gBACjB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAkBxC,YAAY,CAAC,KAAK,EAAE,KAAK;IASzB,QAAQ,CAAC,KAAK,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;gBACjB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK;IAkBxC,YAAY,CAAC,KAAK,EAAE,KAAK;IASzB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,OAAe;IAgBnD,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM;IAa5B,WAAW,MAAO,MAAM,KAAK,KAAK,KAAG,SAAS,CAmB5C;IAEF,oBAAoB,IAAI,SAAS;CAsBlC"}
|
|
@@ -47,11 +47,20 @@ class Line {
|
|
|
47
47
|
const secondPoint = new point_1.Point("D", x, y);
|
|
48
48
|
return new Line(point, secondPoint);
|
|
49
49
|
}
|
|
50
|
-
includes(point) {
|
|
50
|
+
includes(point, allowApprox = false) {
|
|
51
51
|
if (this.isVertical) {
|
|
52
|
-
|
|
52
|
+
if (allowApprox) {
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
return point.x.equals(this.pointA.x);
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
const evaluation = new substractNode_1.SubstractNode(point.y, new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.a, point.x), this.b)).evaluate({});
|
|
58
|
+
console.log("eval", evaluation);
|
|
59
|
+
if (allowApprox) {
|
|
60
|
+
return Math.abs(evaluation) < 0.0000001;
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
return evaluation === 0;
|
|
55
64
|
}
|
|
56
65
|
//! caution: simplify ne gère pas bien ici
|
|
57
66
|
getRandomPoint(name) {
|
|
@@ -3,6 +3,7 @@ import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
|
|
|
3
3
|
export declare abstract class PointConstructor {
|
|
4
4
|
static random(name: string): Point;
|
|
5
5
|
static randomDifferent(names: string[]): Point[];
|
|
6
|
+
static fromGGBCommand(str: string): Point;
|
|
6
7
|
}
|
|
7
8
|
export declare class Point {
|
|
8
9
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IAetC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM;CAclC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAM5D,KAAK,IAAI,MAAM;IAGf,aAAa;;;;;;;;;;IAQb,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAMpB,UAAU,IAAI,MAAM;IAMpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;IAM5B,YAAY;CAKb"}
|