math-exercises 2.2.69 → 2.2.71
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 +6 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts +12 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.js +128 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.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.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -5
- 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 +6 -6
- 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 +7 -7
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +6 -6
- package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/index.js +17 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts +11 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +272 -0
- 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.js +1 -1
- package/lib/exercises/math/geometry/index.d.ts +2 -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/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.js +3 -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 +39 -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 +47 -0
- package/lib/math/geometry/angle.d.ts.map +1 -0
- package/lib/math/geometry/angle.js +210 -0
- package/lib/math/geometry/line.d.ts +7 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +33 -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 +4 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +20 -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 +5 -2
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +27 -9
- 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 +3 -0
- package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
- package/lib/math/polynomials/generalAffine.js +5 -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/playground.js +1 -8
- package/lib/tree/nodes/functions/absNode.d.ts +1 -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 +6 -2
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +3 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +8 -0
- 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 +123 -89
- 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/monomNode.d.ts +47 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -0
- package/lib/tree/nodes/polynomials/monomNode.js +214 -0
- 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 +2 -1
- 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.d.ts +2 -2
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +61 -8
- 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 +28 -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);
|
|
@@ -78,7 +78,7 @@ const getRootsProductQuestion = (ops) => {
|
|
|
78
78
|
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
79
79
|
const b = (0, randint_1.randint)(-10, 10);
|
|
80
80
|
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
|
|
81
|
-
const trinom = new
|
|
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,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 bTex = trinom.b.toTex();
|
|
55
55
|
const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a);
|
|
@@ -77,8 +77,8 @@ const getRootsSumQuestion = (ops) => {
|
|
|
77
77
|
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
78
78
|
const b = (0, randint_1.randint)(-10, 10);
|
|
79
79
|
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
|
|
80
|
-
// const trinom =
|
|
81
|
-
const trinom = new
|
|
80
|
+
// const trinom = TrinomNodeConstructor.randomNiceRoots(2);
|
|
81
|
+
const trinom = new trinomNode_1.TrinomNode(a, b, c);
|
|
82
82
|
const identifiers = {
|
|
83
83
|
trinomIdentifiers: trinom.toIdentifiers(),
|
|
84
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,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./recognizeAngleType"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
points: PointIdentifiers[];
|
|
5
|
+
angleType: string;
|
|
6
|
+
angleIndex: number;
|
|
7
|
+
apexIndex: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const recognizeAngleType: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=recognizeAngleType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAWnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8TF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recognizeAngleType = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
+
const angle_1 = require("../../../../math/geometry/angle");
|
|
8
|
+
const line_1 = require("../../../../math/geometry/line");
|
|
9
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
10
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
11
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
12
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
13
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
14
|
+
const isLetter_1 = require("../../../../utils/strings/isLetter");
|
|
15
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
16
|
+
const getAngle = (identifiers) => {
|
|
17
|
+
const indexes = getAnglePointsIndexes(identifiers.angleIndex, identifiers.apexIndex);
|
|
18
|
+
return new angle_1.Angle(indexes.map((i) => point_1.PointConstructor.fromIdentifiers(identifiers.points[i])));
|
|
19
|
+
};
|
|
20
|
+
const getAnglePointsIndexes = (angleIndex, apexIndex) => {
|
|
21
|
+
const angles = [
|
|
22
|
+
[apexIndex + 2, apexIndex, apexIndex + 1],
|
|
23
|
+
[(apexIndex + 3 + 12) % 12, apexIndex, apexIndex + 2],
|
|
24
|
+
[(apexIndex - 3 + 12) % 12, apexIndex, (apexIndex + 3 + 12) % 12],
|
|
25
|
+
[apexIndex + 1, apexIndex, (apexIndex - 3 + 12) % 12],
|
|
26
|
+
];
|
|
27
|
+
//les angles 0 ne peuvent pas etre alterne-interne
|
|
28
|
+
return angles[angleIndex];
|
|
29
|
+
};
|
|
30
|
+
const getPropositions = (n, { answer, angleIndex, angleType, apexIndex, points }) => {
|
|
31
|
+
const propositions = [];
|
|
32
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
33
|
+
let anglesPointsIndexes = [];
|
|
34
|
+
switch (angleType) {
|
|
35
|
+
case "alterne-interne":
|
|
36
|
+
//angles 0 exclus
|
|
37
|
+
if (angleIndex === 1) {
|
|
38
|
+
//angle+1 de l'apex supérieur
|
|
39
|
+
//angles 1: une solution :
|
|
40
|
+
anglesPointsIndexes = [
|
|
41
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3) % 12),
|
|
42
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3) % 12),
|
|
43
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, (apexIndex + 3) % 12),
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
if (angleIndex === 2) {
|
|
47
|
+
//angles 2 ont deux solution :
|
|
48
|
+
//-- apex inférieur : angle -1
|
|
49
|
+
//-- apex supérieur : angle +1
|
|
50
|
+
//on choisit l'apex supérieur arbitrairement
|
|
51
|
+
anglesPointsIndexes = [
|
|
52
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3 + 12) % 12),
|
|
53
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3 + 12) % 12),
|
|
54
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, (apexIndex + 3 + 12) % 12),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
//angles 3 : une solution :
|
|
58
|
+
//-- angle-1 de l'apex inférieur
|
|
59
|
+
if (angleIndex === 3) {
|
|
60
|
+
anglesPointsIndexes = [
|
|
61
|
+
getAnglePointsIndexes(angleIndex, (apexIndex - 3 + 12) % 12),
|
|
62
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex - 3 + 12) % 12),
|
|
63
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, (apexIndex - 3 + 12) % 12),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "correspondant":
|
|
68
|
+
//deux solutions :
|
|
69
|
+
//-- apex supérieur: angle-1
|
|
70
|
+
//-- apex inférieur : angle +1
|
|
71
|
+
//on choisit l'apex supérieur arbitrairement
|
|
72
|
+
anglesPointsIndexes = [
|
|
73
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3 + 12) % 12),
|
|
74
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, (apexIndex + 3 + 12) % 12),
|
|
75
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3 + 12) % 12),
|
|
76
|
+
];
|
|
77
|
+
break;
|
|
78
|
+
case "opposé par le sommet":
|
|
79
|
+
default:
|
|
80
|
+
//sol == angle +2 du meme apex
|
|
81
|
+
anglesPointsIndexes = [
|
|
82
|
+
getAnglePointsIndexes(angleIndex, apexIndex),
|
|
83
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, apexIndex),
|
|
84
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, apexIndex),
|
|
85
|
+
];
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
anglesPointsIndexes.forEach((indexes) => {
|
|
89
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new angle_1.Angle(indexes.map((i) => point_1.PointConstructor.fromIdentifiers(points[i]))).toTex());
|
|
90
|
+
});
|
|
91
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
92
|
+
};
|
|
93
|
+
const getAnswerAngle = (identifiers) => {
|
|
94
|
+
const { angleIndex, angleType, apexIndex, points } = identifiers;
|
|
95
|
+
let anglePointsIndexes = [];
|
|
96
|
+
switch (angleType) {
|
|
97
|
+
case "alterne-interne":
|
|
98
|
+
//angles 0 exclus
|
|
99
|
+
if (angleIndex === 1) {
|
|
100
|
+
//angles 1: une solution :
|
|
101
|
+
//angle+1 de l'apex supérieur
|
|
102
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 1) % 4, (identifiers.apexIndex + 3) % 12);
|
|
103
|
+
}
|
|
104
|
+
if (angleIndex === 2) {
|
|
105
|
+
//angles 2 ont deux solution :
|
|
106
|
+
//-- apex inférieur : angle -1
|
|
107
|
+
//-- apex supérieur : angle +1
|
|
108
|
+
//on choisit l'apex supérieur arbitrairement
|
|
109
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 1) % 4, (identifiers.apexIndex + 3 + 12) % 12);
|
|
110
|
+
}
|
|
111
|
+
//angles 3 : une solution :
|
|
112
|
+
//-- angle-1 de l'apex inférieur
|
|
113
|
+
if (angleIndex === 3) {
|
|
114
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex - 1 + 4) % 4, (identifiers.apexIndex - 3 + 12) % 12);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "correspondant":
|
|
118
|
+
//deux solutions :
|
|
119
|
+
//-- apex supérieur: angle-1
|
|
120
|
+
//-- apex inférieur : angle +1
|
|
121
|
+
//on choisit l'apex supérieur arbitrairement
|
|
122
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex - 1 + 4) % 4, (identifiers.apexIndex + 3 + 12) % 12);
|
|
123
|
+
break;
|
|
124
|
+
case "opposé par le sommet":
|
|
125
|
+
default:
|
|
126
|
+
//angle +2 du meme apex
|
|
127
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 2) % 4, identifiers.apexIndex);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
const angle = new angle_1.Angle(anglePointsIndexes.map((i) => point_1.PointConstructor.fromIdentifiers(points[i])));
|
|
131
|
+
return angle;
|
|
132
|
+
};
|
|
133
|
+
const getAnswer = (identifiers) => {
|
|
134
|
+
return getAnswerAngle(identifiers).toTex();
|
|
135
|
+
};
|
|
136
|
+
const getInstruction = (identifiers) => {
|
|
137
|
+
const angleTex = getAngle(identifiers).toTex();
|
|
138
|
+
return `Donner un angle ${identifiers.angleType} à l'angle $${angleTex}$.`;
|
|
139
|
+
};
|
|
140
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
141
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
142
|
+
const getGGBOptions = (identifiers) => {
|
|
143
|
+
const points = identifiers.points.map(point_1.PointConstructor.fromIdentifiers);
|
|
144
|
+
const lines = [
|
|
145
|
+
new line_1.Line(points[0], points[3]),
|
|
146
|
+
new line_1.Line(points[3], points[6]),
|
|
147
|
+
new line_1.Line(points[6], points[9]),
|
|
148
|
+
new line_1.Line(points[9], points[0]),
|
|
149
|
+
];
|
|
150
|
+
const angle = getAngle(identifiers);
|
|
151
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
152
|
+
commands: [
|
|
153
|
+
...points.flatMap((p) => p.toGGBCommand()),
|
|
154
|
+
...lines.flatMap((l) => l.toGGBCommands(false)),
|
|
155
|
+
...angle.toCommands({ color: "red" }),
|
|
156
|
+
],
|
|
157
|
+
hideAxes: true,
|
|
158
|
+
hideGrid: true,
|
|
159
|
+
});
|
|
160
|
+
return ggb.getOptions({
|
|
161
|
+
coords: [-5, 5, -5, 5],
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
const getKeys = (identifiers) => {
|
|
165
|
+
const points = identifiers.points.map(point_1.PointConstructor.fromIdentifiers);
|
|
166
|
+
//! devrait on mettre widehat
|
|
167
|
+
return points.map((p) => p.name);
|
|
168
|
+
};
|
|
169
|
+
const isAnswerValid = (ans, { answer, angleIndex, angleType, apexIndex, points }) => {
|
|
170
|
+
let formated = ans;
|
|
171
|
+
if (ans.includes("widehat")) {
|
|
172
|
+
formated = formated.replaceAll("\\widehat{", "").replaceAll("}", "");
|
|
173
|
+
}
|
|
174
|
+
const pointsNames = Array.from(new Set(formated.split("")));
|
|
175
|
+
if (pointsNames.length !== 3 || pointsNames.some((char) => !(0, isLetter_1.isLetter)(char)))
|
|
176
|
+
return false;
|
|
177
|
+
const studentPoints = pointsNames.map((char) => point_1.PointConstructor.fromIdentifiers(points.find((p) => p.name === char)));
|
|
178
|
+
const answerAngle = getAngle({ angleIndex, apexIndex, points });
|
|
179
|
+
const studentAngle = new angle_1.Angle(studentPoints);
|
|
180
|
+
//? on va accpter aussi des angles correspondants ou alternes-internes qui ne sont pas définis par les sécantes tracées
|
|
181
|
+
//? c'est chelou mais dans le fond ça fait sens (c'est vrai mathémtiquement)
|
|
182
|
+
switch (angleType) {
|
|
183
|
+
case "opposé par le sommet":
|
|
184
|
+
return studentAngle.isSummitOpposite(answerAngle);
|
|
185
|
+
case "alterne-interne":
|
|
186
|
+
return studentAngle.isAlterneInterne(answerAngle);
|
|
187
|
+
break;
|
|
188
|
+
case "correspondant":
|
|
189
|
+
default:
|
|
190
|
+
return studentAngle.isCorrespondant(answerAngle);
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
};
|
|
195
|
+
//deux paires de sécantes
|
|
196
|
+
const getRecognizeAngleTypeQuestion = (opts) => {
|
|
197
|
+
const angleType = (0, random_1.random)([
|
|
198
|
+
"alterne-interne",
|
|
199
|
+
"correspondant",
|
|
200
|
+
"opposé par le sommet",
|
|
201
|
+
]);
|
|
202
|
+
const names = [];
|
|
203
|
+
for (let i = 0; i < 12; i++) {
|
|
204
|
+
names.push((0, randomLetter_1.randomLetter)(true, names));
|
|
205
|
+
}
|
|
206
|
+
const buildIntersectionsPoints = (index) => {
|
|
207
|
+
//les 4 intersections sont (+-2, +-2)
|
|
208
|
+
let [x, y] = [index < 3 || index > 8 ? -2 : 2, index < 6 ? 2 : -2];
|
|
209
|
+
//bruit
|
|
210
|
+
x += (0, randfloat_1.randfloat)(-1, 1, 1);
|
|
211
|
+
y += (0, randfloat_1.randfloat)(-1, 1, 1);
|
|
212
|
+
return new point_1.Point(names[index], x.toTree(), y.toTree());
|
|
213
|
+
};
|
|
214
|
+
const intersections = [0, 3, 6, 9].map(buildIntersectionsPoints);
|
|
215
|
+
const buildAnglesPoints = (index) => {
|
|
216
|
+
const intersectionIndex = Math.floor(index / 3);
|
|
217
|
+
const apex = intersections[intersectionIndex];
|
|
218
|
+
const next = intersections[(intersectionIndex + 1) % 4];
|
|
219
|
+
const prev = intersections[(intersectionIndex - 1 + 4) % 4];
|
|
220
|
+
let [x, y] = [apex.x.evaluate(), apex.y.evaluate()];
|
|
221
|
+
if (index % 2 === 0) {
|
|
222
|
+
const line = new line_1.Line(apex, intersectionIndex % 2 === 0 ? prev : next);
|
|
223
|
+
//lignes verticales (ordonnées +-1)
|
|
224
|
+
y = y + (y < 0 ? -1 : 1);
|
|
225
|
+
return line.getPointWithY(new numberNode_1.NumberNode(y), names[index]);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
//lignes horizontales (abscisse +-1)
|
|
229
|
+
const line = new line_1.Line(apex, intersectionIndex % 2 === 0 ? next : prev);
|
|
230
|
+
x = x + (x < 0 ? -1 : 1);
|
|
231
|
+
return line.getPointWithX(new numberNode_1.NumberNode(x), names[index]);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const points = names.map((n, i) => i % 3 === 0 ? intersections[Math.floor(i / 3)] : buildAnglesPoints(i));
|
|
235
|
+
const apex = (0, random_1.random)([0, 3, 6, 9]);
|
|
236
|
+
//les angles 0 ne peuvent pas etre alterne-interne
|
|
237
|
+
let angleIndex = (0, randint_1.randint)(angleType !== "alterne-interne" ? 0 : 1, 4);
|
|
238
|
+
const identifiers = {
|
|
239
|
+
angleType,
|
|
240
|
+
apexIndex: apex,
|
|
241
|
+
angleIndex,
|
|
242
|
+
points: points.map((p) => p.toIdentifiers()),
|
|
243
|
+
};
|
|
244
|
+
const question = {
|
|
245
|
+
answer: getAnswer(identifiers),
|
|
246
|
+
instruction: getInstruction(identifiers),
|
|
247
|
+
keys: getKeys(identifiers),
|
|
248
|
+
answerFormat: "tex",
|
|
249
|
+
identifiers,
|
|
250
|
+
// hint: getHint(identifiers),
|
|
251
|
+
// correction: getCorrection(identifiers),
|
|
252
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
253
|
+
};
|
|
254
|
+
return question;
|
|
255
|
+
};
|
|
256
|
+
exports.recognizeAngleType = {
|
|
257
|
+
id: "recognizeAngleType",
|
|
258
|
+
label: "Reconnaître un angle alterne-interne, correspondant, opposé par le sommet",
|
|
259
|
+
isSingleStep: true,
|
|
260
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getRecognizeAngleTypeQuestion(opts), nb),
|
|
261
|
+
qcmTimer: 60,
|
|
262
|
+
freeTimer: 60,
|
|
263
|
+
getPropositions,
|
|
264
|
+
isAnswerValid,
|
|
265
|
+
subject: "Mathématiques",
|
|
266
|
+
// getHint,
|
|
267
|
+
// getCorrection,
|
|
268
|
+
getInstruction,
|
|
269
|
+
getAnswer,
|
|
270
|
+
getGGBOptions,
|
|
271
|
+
hasGeogebra: true,
|
|
272
|
+
};
|
|
@@ -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"}
|