math-exercises 2.2.68 → 2.2.70
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/calcul/arithmetics/divisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +2 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +3 -6
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +3 -8
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +7 -9
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +6 -19
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +146 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts +9 -0
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +175 -0
- package/lib/exercises/math/functions/absolute/index.d.ts +1 -0
- package/lib/exercises/math/functions/absolute/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +3 -3
- package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/findSecondRoot.js +5 -5
- package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsProduct.js +7 -7
- package/lib/exercises/math/functions/trinoms/rootsSum.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/rootsSum.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsSum.js +9 -10
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +6 -6
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +3 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +10 -22
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts +6 -1
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +34 -48
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +4 -1
- 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 +1 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +0 -3
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +19 -25
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -2
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +30 -65
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.js +17 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +14 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +221 -0
- package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/index.js +0 -1
- package/lib/exercises/math/geometry/thales/thales.js +2 -2
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +3 -4
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +69 -78
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +4 -3
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.d.ts +2 -3
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +32 -31
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +3 -2
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +18 -28
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +5 -4
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +60 -56
- package/lib/exercises/pc/index.d.ts +0 -4
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +6 -4
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/vea/equationVEA.d.ts +2 -0
- package/lib/exercises/vea/equationVEA.d.ts.map +1 -0
- package/lib/exercises/vea/equationVEA.js +24 -0
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/sqrtVEA.d.ts +6 -0
- package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -0
- package/lib/exercises/vea/sqrtVEA.js +30 -0
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +7 -0
- package/lib/index.d.ts +31 -46
- package/lib/index.d.ts.map +1 -1
- package/lib/math/complex/complex.d.ts +1 -1
- package/lib/math/geometry/angle.d.ts +26 -0
- package/lib/math/geometry/angle.d.ts.map +1 -0
- package/lib/math/geometry/angle.js +73 -0
- package/lib/math/geometry/line.d.ts +5 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +17 -0
- package/lib/math/geometry/parallelogram.d.ts +23 -0
- package/lib/math/geometry/parallelogram.d.ts.map +1 -0
- package/lib/math/geometry/parallelogram.js +70 -0
- 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 +16 -0
- package/lib/math/geometry/quadrilateral.d.ts +15 -0
- package/lib/math/geometry/quadrilateral.d.ts.map +1 -0
- package/lib/math/geometry/quadrilateral.js +38 -0
- package/lib/math/geometry/rectangle.d.ts +24 -0
- package/lib/math/geometry/rectangle.d.ts.map +1 -0
- package/lib/math/geometry/rectangle.js +64 -0
- package/lib/math/geometry/rhombus.d.ts +19 -0
- package/lib/math/geometry/rhombus.d.ts.map +1 -0
- package/lib/math/geometry/rhombus.js +46 -0
- package/lib/math/geometry/rightTriangle.d.ts +31 -0
- package/lib/math/geometry/rightTriangle.d.ts.map +1 -0
- package/lib/math/geometry/rightTriangle.js +113 -0
- package/lib/math/geometry/segment.d.ts +24 -6
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +70 -4
- package/lib/math/geometry/square.d.ts +22 -0
- package/lib/math/geometry/square.d.ts.map +1 -0
- package/lib/math/geometry/square.js +43 -0
- package/lib/math/geometry/triangle.d.ts +45 -45
- package/lib/math/geometry/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangle.js +159 -186
- package/lib/math/geometry/vector.d.ts +2 -2
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +18 -9
- package/lib/math/numbers/nombre.d.ts +5 -0
- package/lib/math/numbers/nombre.d.ts.map +1 -1
- package/lib/math/numbers/nombre.js +12 -0
- package/lib/math/numbers/rationals/rational.d.ts +1 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +3 -0
- package/lib/math/polynomials/generalAffine.d.ts +13 -0
- package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
- package/lib/math/polynomials/generalAffine.js +25 -1
- package/lib/math/polynomials/polynomial.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts +2 -2
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts +1 -0
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts.map +1 -1
- package/lib/math/utils/geometry/pythagoricianTriplets.js +14 -1
- package/lib/math/utils/random/randfloat.d.ts +1 -1
- package/lib/math/utils/random/randfloat.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.js +8 -1
- package/lib/math/utils/random/randint.d.ts +8 -1
- package/lib/math/utils/random/randint.d.ts.map +1 -1
- package/lib/math/utils/random/randint.js +6 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts +2 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +6 -1
- package/lib/tree/nodes/functions/functionNode.d.ts +2 -2
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +5 -5
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +3 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/nodeConstructor.d.ts +3 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +9 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +6 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +2 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +6 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +3 -3
- package/lib/tree/nodes/polynomials/trinomNode.d.ts +70 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -0
- package/lib/tree/nodes/polynomials/trinomNode.js +156 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +1 -1
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +1 -0
- package/lib/tree/parsers/discreteSetParser.d.ts +3 -0
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -0
- package/lib/tree/parsers/discreteSetParser.js +23 -0
- package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
- package/lib/tree/parsers/equationSolutionParser.js +15 -4
- package/lib/tree/parsers/latexParser.d.ts +5 -1
- package/lib/tree/parsers/latexParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +17 -3
- package/lib/tree/parsers/monomParser.js +2 -2
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/rationalParser.d.ts +1 -1
- package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
- package/lib/tree/parsers/rationalParser.js +29 -24
- package/lib/tree/parsers/sqrtParser.d.ts +9 -0
- package/lib/tree/parsers/sqrtParser.d.ts.map +1 -0
- package/lib/tree/parsers/sqrtParser.js +52 -0
- package/lib/tree/parsers/trinomParser.d.ts +1 -1
- package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
- package/lib/tree/parsers/trinomParser.js +14 -2
- package/lib/tree/utilities/functionComposition.d.ts +1 -1
- package/lib/tree/utilities/functionComposition.d.ts.map +1 -1
- package/lib/utils/arrays/rotation.d.ts +8 -0
- package/lib/utils/arrays/rotation.d.ts.map +1 -0
- package/lib/utils/arrays/rotation.js +17 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
4
4
|
type Identifiers = {
|
|
5
|
-
trinomIdentifiers:
|
|
5
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
6
6
|
firstRootIdentifiers: NodeIdentifiers;
|
|
7
7
|
};
|
|
8
8
|
export declare const findSecondRoot: Exercise<Identifiers>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.findSecondRoot = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
10
|
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
@@ -21,7 +21,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
21
21
|
};
|
|
22
22
|
const getAnswer = (identifiers) => {
|
|
23
23
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
24
|
-
const trinom =
|
|
24
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
25
25
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
26
26
|
const firstRootTex = firstRoot.toTex();
|
|
27
27
|
const roots = trinom.getRoots().map((e) => e.toTex());
|
|
@@ -29,7 +29,7 @@ const getAnswer = (identifiers) => {
|
|
|
29
29
|
};
|
|
30
30
|
const getInstruction = (identifiers) => {
|
|
31
31
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
32
|
-
const trinom =
|
|
32
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
33
33
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
34
34
|
const firstRootTex = firstRoot.toTex();
|
|
35
35
|
return `Soit $f$ la fonction polynôme du second degré définie sur $\\mathbb{R}$ par :
|
|
@@ -54,7 +54,7 @@ En remplaçant les valeurs par celles données dans l'énoncé, on peut détermi
|
|
|
54
54
|
};
|
|
55
55
|
const getCorrection = (identifiers) => {
|
|
56
56
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
57
|
-
const trinom =
|
|
57
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
58
58
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
59
59
|
const cOverA = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify();
|
|
60
60
|
return `On sait que le produit des racines $x_1$ et $x_2$ de $f$ vaut :
|
|
@@ -95,7 +95,7 @@ const getFindSecondRootQuestion = (ops) => {
|
|
|
95
95
|
//first*second = c/a
|
|
96
96
|
const identifiers = {
|
|
97
97
|
firstRootIdentifiers: firstRoot.toTree().toIdentifiers(),
|
|
98
|
-
trinomIdentifiers: new
|
|
98
|
+
trinomIdentifiers: new trinomNode_1.TrinomNode(a, b, c).toIdentifiers(),
|
|
99
99
|
};
|
|
100
100
|
const question = {
|
|
101
101
|
answer: getAnswer(identifiers),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
trinomIdentifiers:
|
|
4
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
5
5
|
};
|
|
6
6
|
export declare const rootsProduct: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.rootsProduct = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
10
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
12
12
|
const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
13
13
|
const propositions = [];
|
|
14
14
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
-
const trinom =
|
|
15
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
16
16
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex());
|
|
17
17
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.c), trinom.a).simplify().toTex());
|
|
18
18
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
|
|
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
|
23
23
|
};
|
|
24
24
|
const getAnswer = (identifiers) => {
|
|
25
25
|
const { trinomIdentifiers } = identifiers;
|
|
26
|
-
const trinom =
|
|
26
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
27
27
|
const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex();
|
|
28
28
|
return ans;
|
|
29
29
|
};
|
|
30
30
|
const getInstruction = (identifiers) => {
|
|
31
31
|
const { trinomIdentifiers } = identifiers;
|
|
32
|
-
const trinom =
|
|
32
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
33
33
|
return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
|
|
34
34
|
|
|
35
35
|
$$
|
|
@@ -49,7 +49,7 @@ $$`;
|
|
|
49
49
|
};
|
|
50
50
|
const getCorrection = (identifiers) => {
|
|
51
51
|
const { trinomIdentifiers } = identifiers;
|
|
52
|
-
const trinom =
|
|
52
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
53
53
|
const aTex = trinom.a.toTex();
|
|
54
54
|
const cTex = trinom.c.toTex();
|
|
55
55
|
const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a);
|
|
@@ -77,8 +77,8 @@ const getRootsProductQuestion = (ops) => {
|
|
|
77
77
|
//ac <= 0
|
|
78
78
|
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
79
79
|
const b = (0, randint_1.randint)(-10, 10);
|
|
80
|
-
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10,
|
|
81
|
-
const trinom = new
|
|
80
|
+
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
|
|
81
|
+
const trinom = new trinomNode_1.TrinomNode(a, b, c);
|
|
82
82
|
const identifiers = {
|
|
83
83
|
trinomIdentifiers: trinom.toIdentifiers(),
|
|
84
84
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
trinomIdentifiers:
|
|
4
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
5
5
|
};
|
|
6
6
|
export declare const rootsSum: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.rootsSum = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
10
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
12
12
|
const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
13
13
|
const propositions = [];
|
|
14
14
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
-
const trinom =
|
|
15
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
16
16
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(trinom.b, trinom.a).simplify().toTex());
|
|
17
17
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex());
|
|
18
18
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
|
|
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
|
23
23
|
};
|
|
24
24
|
const getAnswer = (identifiers) => {
|
|
25
25
|
const { trinomIdentifiers } = identifiers;
|
|
26
|
-
const trinom =
|
|
26
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
27
27
|
const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex();
|
|
28
28
|
return ans;
|
|
29
29
|
};
|
|
30
30
|
const getInstruction = (identifiers) => {
|
|
31
31
|
const { trinomIdentifiers } = identifiers;
|
|
32
|
-
const trinom =
|
|
32
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
33
33
|
return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
|
|
34
34
|
|
|
35
35
|
$$
|
|
@@ -49,14 +49,14 @@ $$`;
|
|
|
49
49
|
};
|
|
50
50
|
const getCorrection = (identifiers) => {
|
|
51
51
|
const { trinomIdentifiers } = identifiers;
|
|
52
|
-
const trinom =
|
|
52
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
53
53
|
const aTex = trinom.a.toTex();
|
|
54
54
|
const bTex = trinom.b.toTex();
|
|
55
55
|
const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a);
|
|
56
56
|
return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur somme $S$ vaut :
|
|
57
57
|
|
|
58
58
|
$$
|
|
59
|
-
S = \\frac{
|
|
59
|
+
S = \\frac{-b}{a}
|
|
60
60
|
$$
|
|
61
61
|
|
|
62
62
|
Ici, on a $a = ${aTex}$ et $b = ${bTex}$, donc :
|
|
@@ -73,13 +73,12 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
73
73
|
return (0, rationalVEA_1.rationalVEA)(ans, answer);
|
|
74
74
|
};
|
|
75
75
|
const getRootsSumQuestion = (ops) => {
|
|
76
|
-
//(b,c) != 0
|
|
77
76
|
//ac <= 0
|
|
78
77
|
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
79
78
|
const b = (0, randint_1.randint)(-10, 10);
|
|
80
|
-
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10,
|
|
81
|
-
// const trinom =
|
|
82
|
-
const trinom = new
|
|
79
|
+
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
|
|
80
|
+
// const trinom = TrinomNodeConstructor.randomNiceRoots(2);
|
|
81
|
+
const trinom = new trinomNode_1.TrinomNode(a, b, c);
|
|
83
82
|
const identifiers = {
|
|
84
83
|
trinomIdentifiers: trinom.toIdentifiers(),
|
|
85
84
|
};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.trinomSignFromRoots = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const
|
|
6
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
7
7
|
const intervals_1 = require("../../../../math/sets/intervals/intervals");
|
|
8
8
|
const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
9
9
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
@@ -13,7 +13,7 @@ const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
|
13
13
|
const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
14
14
|
const propositions = [];
|
|
15
15
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
16
|
-
const trinom =
|
|
16
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
|
|
17
17
|
const roots = trinom.getRoots();
|
|
18
18
|
const a = trinomCoeffs[2];
|
|
19
19
|
const b = trinomCoeffs[1];
|
|
@@ -26,7 +26,7 @@ const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
|
26
26
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
27
27
|
};
|
|
28
28
|
const getAnswerNode = (identifiers) => {
|
|
29
|
-
const trinom =
|
|
29
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
30
30
|
const roots = trinom.getRoots();
|
|
31
31
|
const a = identifiers.trinomCoeffs[2];
|
|
32
32
|
return a > 0 === identifiers.isAskingPositive
|
|
@@ -40,7 +40,7 @@ const getAnswer = (identifiers) => {
|
|
|
40
40
|
return getAnswerNode(identifiers).toTex();
|
|
41
41
|
};
|
|
42
42
|
const getInstruction = (identifiers) => {
|
|
43
|
-
const trinom =
|
|
43
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
44
44
|
const roots = trinom.getRoots();
|
|
45
45
|
return `Soit $f$ une fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par $f(x) = ${trinom.toTex()}$.
|
|
46
46
|
|
|
@@ -52,7 +52,7 @@ const getHint = (identifiers) => {
|
|
|
52
52
|
return `Une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.`;
|
|
53
53
|
};
|
|
54
54
|
const getCorrection = (identifiers) => {
|
|
55
|
-
const trinom =
|
|
55
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
56
56
|
const roots = trinom.getRoots();
|
|
57
57
|
const a = identifiers.trinomCoeffs[2];
|
|
58
58
|
const answer = getAnswer(identifiers);
|
|
@@ -79,7 +79,7 @@ const isAnswerValid = (ans, { answer, isAskingPositive, trinomCoeffs }) => {
|
|
|
79
79
|
return texs.includes(ans);
|
|
80
80
|
};
|
|
81
81
|
const getTrinomSignFromRootsQuestion = () => {
|
|
82
|
-
const trinom =
|
|
82
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.randomNiceRoots(2);
|
|
83
83
|
const isAskingPositive = (0, coinFlip_1.coinFlip)();
|
|
84
84
|
const identifiers = {
|
|
85
85
|
isAskingPositive,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
|
|
4
|
+
/**!! old */
|
|
5
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
4
6
|
};
|
|
5
7
|
export declare const rightTriangleArea: Exercise<Identifiers>;
|
|
6
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKnE,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
|
|
@@ -4,31 +4,17 @@ exports.rightTriangleArea = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
7
|
+
const rightTriangle_1 = require("../../../../math/geometry/rightTriangle");
|
|
8
8
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
10
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
11
11
|
const getRightTriangleArea = () => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
for (let i = 0; i < 3; i++)
|
|
15
|
-
vertices.push(String.fromCharCode(code + i));
|
|
16
|
-
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
17
|
-
minRapport: 0.4,
|
|
18
|
-
maxRapport: 1.6,
|
|
19
|
-
names: vertices,
|
|
12
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
|
|
13
|
+
randomName: true,
|
|
20
14
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
];
|
|
25
|
-
const commands = [
|
|
26
|
-
...triangle.generateCommands({
|
|
27
|
-
showLabels: [triangle.getSideBName(), triangle.getSideCName()],
|
|
28
|
-
setCaptions: [sidesLengths[0] + "", sidesLengths[1] + ""],
|
|
29
|
-
}),
|
|
30
|
-
];
|
|
31
|
-
const answer = ((sidesLengths[0] * sidesLengths[1]) / 2 + "").replace(".", ",");
|
|
15
|
+
triangle.showSidesLength([0]);
|
|
16
|
+
const commands = [...triangle.commands];
|
|
17
|
+
const answer = triangle.getArea().frenchify();
|
|
32
18
|
const answerTex = answer + "\\text{cm}^2";
|
|
33
19
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
34
20
|
commands,
|
|
@@ -36,14 +22,16 @@ const getRightTriangleArea = () => {
|
|
|
36
22
|
hideGrid: true,
|
|
37
23
|
});
|
|
38
24
|
const question = {
|
|
39
|
-
instruction: `
|
|
25
|
+
instruction: `Le triangle $${triangle.name}$ ci-dessous est rectangle en $${triangle.points[0].name}$, et tel que $${triangle.sides[1].toLengthTex()}$ cm et $${triangle.sides[2].toLengthTex()}$ cm.
|
|
26
|
+
|
|
27
|
+
Calculer l'aire de $${triangle.name}$.`,
|
|
40
28
|
answer: answerTex,
|
|
41
29
|
keys: ["cm", "cm2"],
|
|
42
30
|
ggbOptions: ggb.getOptions({
|
|
43
31
|
coords: triangle.generateCoords(),
|
|
44
32
|
}),
|
|
45
33
|
answerFormat: "tex",
|
|
46
|
-
identifiers: {
|
|
34
|
+
identifiers: { triangleIdentifiers: triangle.toIdentifiers() },
|
|
47
35
|
};
|
|
48
36
|
return question;
|
|
49
37
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
5
|
+
height: number;
|
|
6
|
+
base: number;
|
|
7
|
+
};
|
|
3
8
|
export declare const triangleArea: Exercise<Identifiers>;
|
|
4
9
|
export {};
|
|
5
10
|
//# sourceMappingURL=triangleArea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAYtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
|
|
@@ -9,65 +9,51 @@ const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
10
|
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
11
11
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
12
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
13
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
14
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
15
|
+
const segment_1 = require("../../../../math/geometry/segment");
|
|
16
|
+
const round_1 = require("../../../../math/utils/round");
|
|
12
17
|
const getTriangleArea = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
//segment de taille fixé
|
|
19
|
+
//puis hauteur de taille fixée placée sur segment (élargi)
|
|
20
|
+
//puis rotation
|
|
21
|
+
const base = (0, randfloat_1.randfloat)(1, 7, 1);
|
|
22
|
+
const height = (0, randfloat_1.randfloat)(1, 5, 1);
|
|
23
|
+
const angle = (0, randfloat_1.randfloat)(0, 2 * Math.PI);
|
|
24
|
+
const names = triangle_1.TriangleConstructor.randomName();
|
|
25
|
+
const A = point_1.PointConstructor.origin(names[0]);
|
|
26
|
+
const C = new point_1.Point(names[2], base.toTree(), (0).toTree()).rotate(angle, A);
|
|
27
|
+
const xH = (0, randfloat_1.randfloat)(-0.5 * base, 1.5 * base, 1, (x) => Math.abs(x) < 0.2 * base || Math.abs(x - base) < 0.2 * base);
|
|
28
|
+
const footName = (0, doWhile_1.doWhile)(() => (0, randomLetter_1.randomLetter)(true), (p) => names.includes(p));
|
|
29
|
+
const H = new point_1.Point(footName, xH.toTree(), (0).toTree()).rotate(angle, A);
|
|
30
|
+
const B = new point_1.Point(names[1], xH.toTree(), height.toTree()).rotate(angle, A);
|
|
31
|
+
const triangle = new triangle_1.Triangle([A, B, C], {
|
|
32
|
+
sidesLengths: [undefined, base.toTree(), undefined],
|
|
21
33
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
triangle.getSideBName(),
|
|
25
|
-
triangle.getSideCName(),
|
|
26
|
-
];
|
|
27
|
-
const sidesLengths = [
|
|
28
|
-
triangle.getSideAnumber(),
|
|
29
|
-
triangle.getSideBnumber(),
|
|
30
|
-
triangle.getSideCnumber(),
|
|
31
|
-
].map((el) => Math.round(el / 2));
|
|
32
|
-
const angles = [
|
|
33
|
-
triangle.getAngleA(),
|
|
34
|
-
triangle.getAngleB(),
|
|
35
|
-
triangle.getAngleC(),
|
|
36
|
-
];
|
|
37
|
-
const randoms = (0, shuffle_1.shuffle)([0, 1, 2]);
|
|
38
|
-
const height = Math.round(sidesLengths[randoms[1]] * Math.sin(angles[randoms[2]]));
|
|
39
|
-
const interceptName = (0, randomLetter_1.randomLetter)(true, vertices);
|
|
40
|
-
const commands = [
|
|
41
|
-
...triangle.generateCommands({
|
|
42
|
-
showLabels: [sides[randoms[0]]],
|
|
43
|
-
setCaptions: [sidesLengths[randoms[0]] + ""],
|
|
44
|
-
}),
|
|
45
|
-
`poi = Intersect(PerpendicularLine(${vertices[randoms[0]]},${sides[randoms[0]]}),${sides[randoms[0]]})`,
|
|
46
|
-
`SetCaption(poi, "${interceptName}")`,
|
|
47
|
-
`ShowLabel(poi, true)`,
|
|
48
|
-
`seg = Segment(${vertices[randoms[0]]}, poi)`,
|
|
49
|
-
`ShowLabel(seg, true)`,
|
|
50
|
-
`SetCaption(seg, "${height}")`,
|
|
51
|
-
`SetLineStyle(seg, 1)`,
|
|
52
|
-
`alpha = Angle(${vertices[randoms[0]]},poi ,${vertices[randoms[1]]}, Line(${vertices[randoms[0]]},poi))`,
|
|
53
|
-
`ShowLabel(alpha, false)`,
|
|
54
|
-
];
|
|
34
|
+
const heightSegment = new segment_1.Segment(B, H, { lengthNode: height.toTree() });
|
|
35
|
+
triangle.drawHeight(1, { footName });
|
|
55
36
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
56
|
-
commands,
|
|
37
|
+
commands: triangle.commands,
|
|
57
38
|
hideAxes: true,
|
|
58
39
|
hideGrid: true,
|
|
59
40
|
});
|
|
60
|
-
const answer = (
|
|
61
|
-
const answerTex = answer + "\\text{cm}^2";
|
|
41
|
+
const answer = (0, round_1.round)((height * base) / 2, 1);
|
|
62
42
|
const question = {
|
|
63
|
-
instruction: `Calculer l'aire du triangle $${triangle.
|
|
64
|
-
|
|
43
|
+
instruction: `Calculer l'aire du triangle $${triangle.name}$ sachant que $${triangle.sides[1].toLengthTex()}$ cm et $${heightSegment.toLengthTex()}$ cm.
|
|
44
|
+
|
|
45
|
+
Arrondir à $0,1$ cm près.`,
|
|
46
|
+
answer: answer.frenchify() + "\\text{cm}^2",
|
|
65
47
|
keys: ["cm", "cm2"],
|
|
66
48
|
ggbOptions: ggb.getOptions({
|
|
67
|
-
coords:
|
|
49
|
+
coords: ggb.getCoordsForPoints([A, B, C, H]),
|
|
68
50
|
}),
|
|
69
51
|
answerFormat: "tex",
|
|
70
|
-
identifiers: {
|
|
52
|
+
identifiers: {
|
|
53
|
+
triangleIdentifiers: triangle.toIdentifiers(),
|
|
54
|
+
height,
|
|
55
|
+
base,
|
|
56
|
+
},
|
|
71
57
|
};
|
|
72
58
|
return question;
|
|
73
59
|
};
|
package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAepE,CAAC"}
|
|
@@ -57,7 +57,10 @@ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
|
57
57
|
const studentAns = ans.filter((c) => !["A", "B", "C", "D"].includes(c[0]));
|
|
58
58
|
if (studentAns.length !== 1)
|
|
59
59
|
return false;
|
|
60
|
-
const
|
|
60
|
+
const studentPoint = studentAns[0].split("=")[1];
|
|
61
|
+
if (studentPoint === undefined)
|
|
62
|
+
return false;
|
|
63
|
+
const coords = (0, ggbPointToCoords_1.ggbPointToCoords)(studentPoint);
|
|
61
64
|
const coordsAns = (0, ggbPointToCoords_1.ggbPointToCoords)(ggbAnswer[0].split("=")[1]);
|
|
62
65
|
return ((0, approxEqual_1.approxEqual)(coords.x, coordsAns.x, 0.2) &&
|
|
63
66
|
(0, approxEqual_1.approxEqual)(coords.y, coordsAns.y, 0.2));
|
|
@@ -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;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,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;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
2
|
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
sideA: string;
|
|
5
|
-
sideB: string;
|
|
6
|
-
sideC: string;
|
|
7
4
|
triangleIdentifiers: TriangleIdentifiers;
|
|
8
5
|
};
|
|
9
6
|
export declare const pythagore: Exercise<Identifiers>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
|
|
@@ -3,57 +3,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pythagore = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
7
|
-
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
6
|
const lengthNode_1 = require("../../../../tree/nodes/geometry/lengthNode");
|
|
9
7
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
8
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
11
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
10
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
11
|
+
const rightTriangle_1 = require("../../../../math/geometry/rightTriangle");
|
|
13
12
|
const getPythagore = () => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
for (let i = 0; i < 3; i++)
|
|
17
|
-
vertices.push(String.fromCharCode(code + i));
|
|
18
|
-
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
19
|
-
minRapport: 0.7,
|
|
20
|
-
maxRapport: 1.3,
|
|
21
|
-
names: vertices,
|
|
13
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
|
|
14
|
+
randomName: true,
|
|
22
15
|
});
|
|
23
|
-
const sideA = triangle.getSideAName();
|
|
24
|
-
const sideB = triangle.getSideBName();
|
|
25
|
-
const sideC = triangle.getSideCName();
|
|
26
16
|
const triangleIdentifiers = triangle.toIdentifiers();
|
|
27
17
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
28
|
-
commands: triangle.
|
|
18
|
+
commands: triangle.commands,
|
|
29
19
|
hideAxes: true,
|
|
30
20
|
hideGrid: true,
|
|
31
21
|
});
|
|
32
|
-
const answer =
|
|
22
|
+
const answer = triangle.getPythagorianTex();
|
|
33
23
|
const question = {
|
|
34
24
|
instruction: "Écrire l'égalité de Pythagore pour le triangle rectangle suivant : ",
|
|
35
25
|
answer,
|
|
36
|
-
keys: [...
|
|
26
|
+
keys: [...triangle.points.map((p) => p.name), "equal"],
|
|
37
27
|
ggbOptions: ggb.getOptions({
|
|
38
28
|
coords: triangle.generateCoords(),
|
|
39
29
|
}),
|
|
40
30
|
answerFormat: "tex",
|
|
41
|
-
identifiers: {
|
|
31
|
+
identifiers: { triangleIdentifiers },
|
|
42
32
|
};
|
|
43
33
|
return question;
|
|
44
34
|
};
|
|
45
|
-
const getPropositions = (n, { answer,
|
|
35
|
+
const getPropositions = (n, { answer, triangleIdentifiers }) => {
|
|
46
36
|
const propositions = [];
|
|
47
37
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `${
|
|
51
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `${
|
|
52
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `${
|
|
53
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `${
|
|
38
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
39
|
+
const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}=${sideB}+${sideC}`);
|
|
41
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}^2-${sideC}^2`);
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideB}^2=${sideA}^2+${sideC}^2`);
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideC}^2= ${sideA}^2+${sideB}^2`);
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}+${sideC}^2`);
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${sideA}^2=${sideB}^2+${sideC}`);
|
|
54
46
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
55
47
|
};
|
|
56
|
-
const isAnswerValid = (ans, {
|
|
48
|
+
const isAnswerValid = (ans, { triangleIdentifiers }) => {
|
|
49
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
50
|
+
const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
|
|
57
51
|
const answer = new equalNode_1.EqualNode(new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideA)), new addNode_1.AddNode(new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideB)), new powerNode_1.SquareNode(new lengthNode_1.LengthNode(sideC))));
|
|
58
52
|
const texs = answer.toAllValidTexs();
|
|
59
53
|
return texs.includes(ans);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
2
|
import { TriangleIdentifiers } from "../../../../math/geometry/triangle";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
|
|
5
|
-
sideLengths: number[];
|
|
4
|
+
sideAsked: number;
|
|
6
5
|
triangleIdentifiers: TriangleIdentifiers;
|
|
7
6
|
};
|
|
8
7
|
export declare const pythagoreCalcul: Exercise<Identifiers>;
|