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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallelepipedVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/parallelepipedVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"parallelepipedVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/parallelepipedVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -99,9 +99,10 @@ const getPropositions = (n, { answer, length, width, height }) => {
|
|
|
99
99
|
.toTex();
|
|
100
100
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume3);
|
|
101
101
|
while (propositions.length < n) {
|
|
102
|
-
const wrongLength = length + 1;
|
|
103
|
-
const wrongWidth = width + 1;
|
|
104
|
-
const wrongHeight = height + 1;
|
|
102
|
+
const wrongLength = length + (0, randint_1.randint)(1, 5);
|
|
103
|
+
const wrongWidth = width + (0, randint_1.randint)(1, 5);
|
|
104
|
+
const wrongHeight = height + (0, randint_1.randint)(1, 5);
|
|
105
|
+
console.log(wrongLength, wrongWidth, wrongHeight);
|
|
105
106
|
const wrongVolume = (0, round_1.round)(wrongLength * wrongWidth * wrongHeight, 2)
|
|
106
107
|
.toTree()
|
|
107
108
|
.toTex();
|
|
@@ -58,7 +58,7 @@ const getPropositions = (n, { answer, radius }) => {
|
|
|
58
58
|
.toTex();
|
|
59
59
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume3);
|
|
60
60
|
while (propositions.length < n) {
|
|
61
|
-
const wrongRadius = radius + 1;
|
|
61
|
+
const wrongRadius = radius + (0, randint_1.randint)(1, 5);
|
|
62
62
|
const wrongVolume = (0, round_1.round)((4 / 3) * Math.PI * Math.pow(wrongRadius, 3), 2)
|
|
63
63
|
.toTree()
|
|
64
64
|
.toTex();
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
sideA: string;
|
|
4
|
-
sideB: string;
|
|
5
|
-
sideC: string;
|
|
6
4
|
randAngle: number;
|
|
7
5
|
randTrigo: number;
|
|
6
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
8
7
|
};
|
|
9
8
|
export declare const trigonometry: Exercise<Identifiers>;
|
|
10
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAStC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAsHF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAe9C,CAAC"}
|
|
@@ -4,68 +4,67 @@ exports.trigonometry = 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 randint_1 = require("../../../math/utils/random/randint");
|
|
9
9
|
const lengthNode_1 = require("../../../tree/nodes/geometry/lengthNode");
|
|
10
10
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
11
|
+
const random_1 = require("../../../utils/alea/random");
|
|
11
12
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
12
13
|
const getTrigonometry = () => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
for (let i = 0; i < 3; i++)
|
|
16
|
-
vertices.push(String.fromCharCode(code + i));
|
|
17
|
-
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
18
|
-
minRapport: 0.7,
|
|
19
|
-
maxRapport: 1.3,
|
|
20
|
-
names: vertices,
|
|
14
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
|
|
15
|
+
randomName: true,
|
|
21
16
|
});
|
|
22
|
-
const sideA = triangle.getSideAName();
|
|
23
|
-
const sideB = triangle.getSideBName();
|
|
24
|
-
const sideC = triangle.getSideCName();
|
|
25
17
|
const trigo = ["le cosinus", "le sinus", "la tangente"];
|
|
26
18
|
const randTrigo = (0, randint_1.randint)(0, 3);
|
|
27
|
-
const
|
|
28
|
-
|
|
19
|
+
const randAngle = (0, random_1.random)([1, 2]);
|
|
20
|
+
triangle.highlightAngle(randAngle, { color: "red" });
|
|
21
|
+
const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
|
|
22
|
+
const angleSummit = triangle.points[randAngle].name;
|
|
29
23
|
let quotient;
|
|
30
24
|
switch (randAngle) {
|
|
31
|
-
case
|
|
25
|
+
case 1: //angle B
|
|
32
26
|
quotient = [
|
|
33
|
-
`\\frac{${sideC}}{${sideA}}`,
|
|
34
|
-
`\\frac{${sideB}}{${sideA}}`,
|
|
35
|
-
`\\frac{${sideB}}{${sideC}}`,
|
|
27
|
+
`\\frac{${sideC}}{${sideA}}`, //cos
|
|
28
|
+
`\\frac{${sideB}}{${sideA}}`, //sin
|
|
29
|
+
`\\frac{${sideB}}{${sideC}}`, //tan
|
|
36
30
|
];
|
|
37
31
|
break;
|
|
38
|
-
case
|
|
32
|
+
case 2: //angle C
|
|
33
|
+
default:
|
|
39
34
|
quotient = [
|
|
40
|
-
`\\frac{${sideB}}{${sideA}}`,
|
|
41
|
-
`\\frac{${sideC}}{${sideA}}`,
|
|
42
|
-
`\\frac{${sideC}}{${sideB}}`,
|
|
35
|
+
`\\frac{${sideB}}{${sideA}}`, //cos
|
|
36
|
+
`\\frac{${sideC}}{${sideA}}`, //sin
|
|
37
|
+
`\\frac{${sideC}}{${sideB}}`, //tan
|
|
43
38
|
];
|
|
44
39
|
break;
|
|
45
|
-
default:
|
|
46
|
-
quotient = [""];
|
|
47
40
|
}
|
|
48
41
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
49
|
-
commands: triangle.
|
|
42
|
+
commands: triangle.commands,
|
|
50
43
|
hideAxes: true,
|
|
51
44
|
hideGrid: true,
|
|
52
45
|
});
|
|
53
46
|
const answer = quotient[randTrigo];
|
|
54
47
|
const question = {
|
|
55
|
-
instruction: `À quel quotient est égal ${trigo[randTrigo]} de l'angle $\\widehat{${
|
|
48
|
+
instruction: `À quel quotient est égal ${trigo[randTrigo]} de l'angle $\\widehat{${angleSummit}}$ ?`,
|
|
56
49
|
answer,
|
|
57
|
-
keys: [...
|
|
50
|
+
keys: [...triangle.points.map((p) => p.name), "equal"],
|
|
58
51
|
ggbOptions: ggb.getOptions({
|
|
59
52
|
coords: triangle.generateCoords(),
|
|
60
53
|
}),
|
|
61
54
|
answerFormat: "tex",
|
|
62
|
-
identifiers: {
|
|
55
|
+
identifiers: {
|
|
56
|
+
triangleIdentifiers: triangle.toIdentifiers(),
|
|
57
|
+
randAngle,
|
|
58
|
+
randTrigo,
|
|
59
|
+
},
|
|
63
60
|
};
|
|
64
61
|
return question;
|
|
65
62
|
};
|
|
66
|
-
const getPropositions = (n, { answer,
|
|
63
|
+
const getPropositions = (n, { answer, triangleIdentifiers }) => {
|
|
67
64
|
const propositions = [];
|
|
68
65
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
66
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
67
|
+
const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
|
|
69
68
|
const wrongQuotients = [
|
|
70
69
|
`\\frac{${sideC}}{${sideA}}`,
|
|
71
70
|
`\\frac{${sideB}}{${sideA}}`,
|
|
@@ -85,9 +84,11 @@ const getPropositions = (n, { answer, sideA, sideB, sideC }) => {
|
|
|
85
84
|
}
|
|
86
85
|
return (0, shuffle_1.shuffle)(propositions);
|
|
87
86
|
};
|
|
88
|
-
const isAnswerValid = (ans, { randAngle, randTrigo,
|
|
87
|
+
const isAnswerValid = (ans, { randAngle, randTrigo, triangleIdentifiers }) => {
|
|
88
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
89
|
+
const [sideA, sideB, sideC] = triangle.sides.map((s) => s.toInsideName());
|
|
89
90
|
let quotients = [];
|
|
90
|
-
if (randAngle ===
|
|
91
|
+
if (randAngle === 1)
|
|
91
92
|
quotients = [
|
|
92
93
|
[sideC, sideA],
|
|
93
94
|
[sideB, sideA],
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
sideLengths: number[];
|
|
4
4
|
randAngle: number;
|
|
5
|
-
|
|
5
|
+
hiddenSide: number;
|
|
6
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
6
7
|
};
|
|
7
8
|
export declare const trigonometryAngleCalcul: Exercise<Identifiers>;
|
|
8
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAyDF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -4,51 +4,41 @@ exports.trigonometryAngleCalcul = 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 randint_1 = require("../../../math/utils/random/randint");
|
|
9
9
|
const round_1 = require("../../../math/utils/round");
|
|
10
10
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
11
11
|
const getTrigonometryAngleCalcul = () => {
|
|
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.5,
|
|
18
|
-
maxRapport: 1.5,
|
|
19
|
-
names: vertices,
|
|
12
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceSides({
|
|
13
|
+
randomName: true,
|
|
20
14
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
triangle.getSideCnumber(),
|
|
28
|
-
triangle.getSideBnumber(),
|
|
29
|
-
triangle.getSideAnumber(),
|
|
30
|
-
].map((el) => (0, round_1.round)(el / 2, 2));
|
|
31
|
-
const angle = [triangle.vertexB.name, triangle.vertexC.name];
|
|
32
|
-
const randAngle = (0, randint_1.randint)(0, 2);
|
|
33
|
-
const randSides = (0, shuffle_1.shuffle)([0, 1, 2]);
|
|
34
|
-
const answer = randAngle === 0
|
|
35
|
-
? Math.round((Math.acos(sideLengths[0] / sideLengths[2]) * 180) / Math.PI)
|
|
36
|
-
: Math.round((Math.acos(sideLengths[1] / sideLengths[2]) * 180) / Math.PI);
|
|
15
|
+
const randAngle = (0, randint_1.randint)(1, 3);
|
|
16
|
+
const hiddenSide = (0, randint_1.randint)(0, 3);
|
|
17
|
+
const givenSides = triangle.sides.filter((s, i) => i !== hiddenSide);
|
|
18
|
+
triangle.showSidesLength([hiddenSide]);
|
|
19
|
+
triangle.highlightAngle(randAngle, { color: "red" });
|
|
20
|
+
const answer = (0, round_1.round)(triangle.angles[randAngle].evaluate(), 0);
|
|
37
21
|
const answerTex = answer + "^{\\circ}";
|
|
38
22
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
39
|
-
commands: triangle.
|
|
23
|
+
commands: triangle.commands,
|
|
40
24
|
hideAxes: true,
|
|
41
25
|
hideGrid: true,
|
|
42
26
|
});
|
|
43
27
|
const question = {
|
|
44
|
-
instruction: `Le triangle $${triangle.
|
|
28
|
+
instruction: `Le triangle $${triangle.name}$ rectangle en $${triangle.points[0].name}$ est tel que $${givenSides[0].toLengthTex()}$ cm et $${givenSides[1].toLengthTex()}$ cm.
|
|
29
|
+
|
|
30
|
+
Calculer $\\widehat{${triangle.points[randAngle].name}}$ à $1^\\circ$ près.`,
|
|
45
31
|
answer: answerTex,
|
|
46
32
|
keys: ["degree"],
|
|
47
33
|
ggbOptions: ggb.getOptions({
|
|
48
34
|
coords: triangle.generateCoords(),
|
|
49
35
|
}),
|
|
50
36
|
answerFormat: "tex",
|
|
51
|
-
identifiers: {
|
|
37
|
+
identifiers: {
|
|
38
|
+
randAngle,
|
|
39
|
+
hiddenSide,
|
|
40
|
+
triangleIdentifiers: triangle.toIdentifiers(),
|
|
41
|
+
},
|
|
52
42
|
};
|
|
53
43
|
return question;
|
|
54
44
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../math/geometry/triangle";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
sideAsked: number;
|
|
5
|
+
givenSide: number;
|
|
6
|
+
givenAngle: number;
|
|
7
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
7
8
|
};
|
|
8
9
|
export declare const trigonometrySideCalcul: Exercise<Identifiers>;
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA4KF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -3,66 +3,50 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.trigonometrySideCalcul = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../geogebra/colors");
|
|
6
7
|
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
8
|
+
const rightTriangle_1 = require("../../../math/geometry/rightTriangle");
|
|
8
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
10
|
const round_1 = require("../../../math/utils/round");
|
|
10
11
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
11
12
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
12
13
|
const getTrigonometrySideCalcul = () => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
maxRapport: 1.5,
|
|
20
|
-
names: vertices,
|
|
14
|
+
const givenAngle = (0, randint_1.randint)(1, 3);
|
|
15
|
+
const givenSide = (0, randint_1.randint)(0, 3);
|
|
16
|
+
const sideAsked = (0, randint_1.randint)(0, 3, [givenSide]);
|
|
17
|
+
const triangle = rightTriangle_1.RightTriangleConstructor.randomNiceAngles({
|
|
18
|
+
randomName: true,
|
|
19
|
+
niceSideIndex: givenSide,
|
|
21
20
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
];
|
|
27
|
-
const sideLengths = [
|
|
28
|
-
triangle.getSideCnumber(),
|
|
29
|
-
triangle.getSideBnumber(),
|
|
30
|
-
triangle.getSideAnumber(),
|
|
31
|
-
].map((el) => (0, round_1.round)(el / 2, 2));
|
|
32
|
-
const angle = [triangle.vertexB.name, triangle.vertexC.name];
|
|
33
|
-
const randAngle = (0, randint_1.randint)(0, 2);
|
|
34
|
-
const randSide = (0, randint_1.randint)(0, 3); // valeurs possible : 0 1 2
|
|
35
|
-
const randSideQuestion = (0, randint_1.randint)(0, 3, [randSide]); // si rand = 0, valeurs possible 1 2
|
|
36
|
-
const angleValue = [
|
|
37
|
-
(0, round_1.round)((Math.acos(sideLengths[0] / sideLengths[2]) * 180) / Math.PI, 1),
|
|
38
|
-
(0, round_1.round)((Math.acos(sideLengths[1] / sideLengths[2]) * 180) / Math.PI, 1),
|
|
39
|
-
];
|
|
40
|
-
const commands = [
|
|
41
|
-
...triangle.generateCommands({
|
|
42
|
-
highlightedAngle: angle[randAngle],
|
|
43
|
-
colorHighlightedAngle: "Black",
|
|
44
|
-
showLabels: [sides[randSideQuestion]],
|
|
45
|
-
setCaptions: ["?"],
|
|
46
|
-
highlightedSide: sides[randSideQuestion],
|
|
47
|
-
}),
|
|
48
|
-
];
|
|
21
|
+
triangle.showSidesLength([0, 1, 2].filter((i) => i !== givenSide));
|
|
22
|
+
triangle.highlightAngle(givenAngle, { color: colors_1.greenDark, showValue: true });
|
|
23
|
+
triangle.highlightSide(sideAsked, { color: "red", caption: "?" });
|
|
24
|
+
const angleValue = triangle.angles[givenAngle].evaluate().frenchify();
|
|
49
25
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
50
|
-
commands,
|
|
26
|
+
commands: triangle.commands,
|
|
51
27
|
hideAxes: true,
|
|
52
28
|
hideGrid: true,
|
|
53
29
|
});
|
|
54
|
-
const answer =
|
|
30
|
+
const answer = (0, round_1.round)(triangle.sides[sideAsked].getLength(), 1).frenchify();
|
|
31
|
+
const identifiers = {
|
|
32
|
+
givenAngle,
|
|
33
|
+
givenSide,
|
|
34
|
+
sideAsked,
|
|
35
|
+
triangleIdentifiers: triangle.toIdentifiers(),
|
|
36
|
+
};
|
|
55
37
|
const question = {
|
|
56
|
-
instruction: `Le triangle $${triangle.
|
|
38
|
+
instruction: `Le triangle $${triangle.name}$ rectangle en $${triangle.points[0].name}$ est tel que $${triangle.sides[givenSide].toLengthTex()}$ cm et $\\widehat{${triangle.points[givenAngle].name}} = ${angleValue}^\\circ$.
|
|
39
|
+
|
|
40
|
+
Calculer $${triangle.sides[sideAsked].toInsideName()}$ à $0,1$ cm près.`,
|
|
57
41
|
answer,
|
|
58
|
-
hint: getHint(),
|
|
59
|
-
correction: getCorrection(
|
|
42
|
+
// hint: getHint(identifiers),
|
|
43
|
+
// correction: getCorrection(identifiers),
|
|
60
44
|
keys: [],
|
|
61
45
|
ggbOptions: ggb.getOptions({
|
|
62
46
|
coords: triangle.generateCoords(),
|
|
63
47
|
}),
|
|
64
48
|
answerFormat: "tex",
|
|
65
|
-
identifiers
|
|
49
|
+
identifiers,
|
|
66
50
|
};
|
|
67
51
|
return question;
|
|
68
52
|
};
|
|
@@ -74,21 +58,42 @@ const getPropositions = (n, { answer }) => {
|
|
|
74
58
|
}
|
|
75
59
|
return (0, shuffle_1.shuffle)(propositions);
|
|
76
60
|
};
|
|
77
|
-
const getHint = () => {
|
|
61
|
+
const getHint = (identifiers) => {
|
|
78
62
|
return `Identifier le côté opposé, le côté adjacent et l'hypoténuse, puis utiliser la bonne formule de trigonométrie.`;
|
|
79
63
|
};
|
|
80
|
-
const getCorrection = (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
64
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
65
|
+
// const hypothenus = { name: sides[2], length: sideLengths[2] };
|
|
66
|
+
// const sidesWithLentgh = sides.map((value, index) => {
|
|
67
|
+
// return { name: value, length: sideLengths[index] };
|
|
68
|
+
// });
|
|
69
|
+
// const adjacent = sidesWithLentgh.filter(
|
|
70
|
+
// (value) =>
|
|
71
|
+
// value.name !== hypothenus.name &&
|
|
72
|
+
// [value.name.charAt(0), value.name.charAt(1)].includes(angle),
|
|
73
|
+
// )[0];
|
|
74
|
+
// const opposite = sidesWithLentgh.filter(
|
|
75
|
+
// (value) => value.name !== hypothenus.name && value.name !== adjacent.name,
|
|
76
|
+
// )[0];
|
|
77
|
+
// const correctEquations = getCorrectEquations(
|
|
78
|
+
// { name: sides[randSideQuestion], length: sideLengths[randSideQuestion] },
|
|
79
|
+
// { name: sides[randSide], length: sideLengths[randSide] },
|
|
80
|
+
// hypothenus,
|
|
81
|
+
// { name: angle, value: angleValue },
|
|
82
|
+
// adjacent,
|
|
83
|
+
// opposite,
|
|
84
|
+
// answer,
|
|
85
|
+
// );
|
|
86
|
+
// return `On utilise la relation :
|
|
87
|
+
// $$
|
|
88
|
+
// ${correctEquations[0]}
|
|
89
|
+
// $$
|
|
90
|
+
// On a donc :
|
|
91
|
+
// $$
|
|
92
|
+
// ${correctEquations[1]}
|
|
93
|
+
// $$
|
|
94
|
+
// donc
|
|
95
|
+
// $$${correctEquations[2]}$$. Ainsi $${correctEquations[3]}$ `;
|
|
96
|
+
// };
|
|
92
97
|
const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adjacent, opposite, answer) => {
|
|
93
98
|
let result;
|
|
94
99
|
switch (randSideQuestion.name) {
|
|
@@ -157,5 +162,4 @@ exports.trigonometrySideCalcul = {
|
|
|
157
162
|
isAnswerValid,
|
|
158
163
|
hasGeogebra: true,
|
|
159
164
|
subject: "Mathématiques",
|
|
160
|
-
hasHintAndCorrection: true,
|
|
161
165
|
};
|
|
@@ -47,8 +47,6 @@ export * from "../math/geometry/vectors/scalarProduct/scalarProductViaCoords";
|
|
|
47
47
|
export * from "../math/geometry/vectors/scalarProduct/scalarProductViaCos";
|
|
48
48
|
export * from "../math/geometry/vectors/coordinatesReading";
|
|
49
49
|
export * from "../math/functions/affines/affineExpressionReading";
|
|
50
|
-
export * from "../math/geometry/thales/thales";
|
|
51
|
-
export * from "../math/geometry/thales/thalesCalcul";
|
|
52
50
|
export * from "../math/equaDiff/equaDiffCheckSolutionFirstOrder";
|
|
53
51
|
export * from "../math/equaDiff/equaDiffGeneralForme";
|
|
54
52
|
export * from "../math/equaDiff/equaDiffGeneralFormeWithIC";
|
|
@@ -57,6 +55,4 @@ export * from "../math/derivation/derivative/usualderivative";
|
|
|
57
55
|
export { thirdDegreeDerivative } from "../math/derivation/derivative/thirdDegreeDerivative";
|
|
58
56
|
export { firstDegreeDerivative } from "../math/derivation/derivative/firstDegreeDerivative";
|
|
59
57
|
export { secondDegreeDerivative } from "../math/derivation/derivative/secondDegreeDerivative";
|
|
60
|
-
export * from "../math/trigonometry/trigonometrySideCalcul";
|
|
61
|
-
export * from "../math/trigonometry/trigonometryAngleCalcul";
|
|
62
58
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,MAAM,CAAC;AACrB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AAExB,yBAAyB;AACzB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qDAAqD,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,MAAM,CAAC;AACrB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AAExB,yBAAyB;AACzB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qDAAqD,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAIlE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC"}
|
|
@@ -68,8 +68,9 @@ __exportStar(require("../math/geometry/vectors/scalarProduct/scalarProductViaCoo
|
|
|
68
68
|
__exportStar(require("../math/geometry/vectors/scalarProduct/scalarProductViaCos"), exports);
|
|
69
69
|
__exportStar(require("../math/geometry/vectors/coordinatesReading"), exports);
|
|
70
70
|
__exportStar(require("../math/functions/affines/affineExpressionReading"), exports);
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
//!FIX TRIANGLE
|
|
72
|
+
// export * from "../math/geometry/thales/thales";
|
|
73
|
+
// export * from "../math/geometry/thales/thalesCalcul";
|
|
73
74
|
__exportStar(require("../math/equaDiff/equaDiffCheckSolutionFirstOrder"), exports);
|
|
74
75
|
__exportStar(require("../math/equaDiff/equaDiffGeneralForme"), exports);
|
|
75
76
|
__exportStar(require("../math/equaDiff/equaDiffGeneralFormeWithIC"), exports);
|
|
@@ -81,5 +82,6 @@ var firstDegreeDerivative_1 = require("../math/derivation/derivative/firstDegree
|
|
|
81
82
|
Object.defineProperty(exports, "firstDegreeDerivative", { enumerable: true, get: function () { return firstDegreeDerivative_1.firstDegreeDerivative; } });
|
|
82
83
|
var secondDegreeDerivative_1 = require("../math/derivation/derivative/secondDegreeDerivative");
|
|
83
84
|
Object.defineProperty(exports, "secondDegreeDerivative", { enumerable: true, get: function () { return secondDegreeDerivative_1.secondDegreeDerivative; } });
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
// export * from "../math/trigonometry/trigonometrySideCalcul";
|
|
86
|
+
// export * from "../math/trigonometry/trigonometryAngleCalcul";
|
|
87
|
+
//!FIX TRIANGLE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equationVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/equationVEA.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAAS,MAAM,eAAe,MAAM,YAa3D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.equationVEA = void 0;
|
|
4
|
+
const discreteSetParser_1 = require("../../tree/parsers/discreteSetParser");
|
|
5
|
+
const equationSolutionParser_1 = require("../../tree/parsers/equationSolutionParser");
|
|
6
|
+
const rationalVEA_1 = require("./rationalVEA");
|
|
7
|
+
const equationVEA = (ans, solutionTex) => {
|
|
8
|
+
try {
|
|
9
|
+
let parsed = (0, equationSolutionParser_1.equationSolutionParser)(ans);
|
|
10
|
+
if (parsed) {
|
|
11
|
+
return (0, rationalVEA_1.rationalVEA)(parsed.toTex(), solutionTex);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
const setParsed = (0, discreteSetParser_1.discreteSetParser)(ans);
|
|
15
|
+
if (!setParsed || setParsed.length !== 1)
|
|
16
|
+
return false;
|
|
17
|
+
return (0, rationalVEA_1.rationalVEA)(setParsed[0].toTex(), solutionTex);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.equationVEA = equationVEA;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rationalVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/rationalVEA.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,WAAW,eACV,MAAM,UACV,MAAM,6DAC4C,IAAI,
|
|
1
|
+
{"version":3,"file":"rationalVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/rationalVEA.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,WAAW,eACV,MAAM,UACV,MAAM,6DAC4C,IAAI,YAoC/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrtVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/sqrtVEA.ts"],"names":[],"mappings":"AAMA,KAAK,IAAI,GAAG;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AACF,eAAO,MAAM,OAAO,eACN,MAAM,UACV,MAAM,6BACY,IAAI,YAmB/B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sqrtVEA = void 0;
|
|
4
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
5
|
+
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
6
|
+
const sqrtParser_1 = require("../../tree/parsers/sqrtParser");
|
|
7
|
+
const sqrtVEA = (studentAns, answer, { allowNonIrreductible } = {
|
|
8
|
+
allowNonIrreductible: true,
|
|
9
|
+
}) => {
|
|
10
|
+
try {
|
|
11
|
+
allowNonIrreductible = allowNonIrreductible ?? true;
|
|
12
|
+
const parsed = (0, sqrtParser_1.sqrtParser)(studentAns);
|
|
13
|
+
if (!parsed)
|
|
14
|
+
return false;
|
|
15
|
+
const parsedAnswer = (0, latexParser_1.parseAlgebraic)(answer);
|
|
16
|
+
if ((0, numberNode_1.isNumberNode)(parsed)) {
|
|
17
|
+
return Math.abs(parsed.evaluate() - parsedAnswer.evaluate()) < 0.0000001;
|
|
18
|
+
}
|
|
19
|
+
else if (allowNonIrreductible) {
|
|
20
|
+
return Math.abs(parsed.evaluate() - parsedAnswer.evaluate()) < 0.0000001;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return parsed.equals(parsedAnswer);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.sqrtVEA = sqrtVEA;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GeogebraAxisOptions, GeogebraOptions } from "../exercises/exercise";
|
|
2
|
+
import { Point } from "../math/geometry/point";
|
|
2
3
|
type GetAdaptedCoords = {
|
|
3
4
|
xMin: number;
|
|
4
5
|
xMax: number;
|
|
@@ -25,6 +26,7 @@ export declare class GeogebraConstructor {
|
|
|
25
26
|
xAxis?: GeogebraAxisOptions;
|
|
26
27
|
yAxis?: GeogebraAxisOptions;
|
|
27
28
|
constructor(options: Omit<GeogebraOptions, "coords">);
|
|
29
|
+
getCoordsForPoints(points: Point[]): number[];
|
|
28
30
|
getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }: GetAdaptedCoords): number[];
|
|
29
31
|
getOptions({ coords }: GetOptionsProps): GeogebraOptions;
|
|
30
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geogebraConstructor.d.ts","sourceRoot":"","sources":["../../src/geogebra/geogebraConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"geogebraConstructor.d.ts","sourceRoot":"","sources":["../../src/geogebra/geogebraConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AACF,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AACF,qBAAa,mBAAmB;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;gBAEhB,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAcpD,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE;IAOlC,gBAAgB,CAAC,EACf,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,aAAa,GACd,EAAE,gBAAgB;IAyCnB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,eAAe;CAiBzD"}
|
|
@@ -17,6 +17,13 @@ class GeogebraConstructor {
|
|
|
17
17
|
this.xAxis = options?.xAxis;
|
|
18
18
|
this.yAxis = options?.yAxis;
|
|
19
19
|
}
|
|
20
|
+
getCoordsForPoints(points) {
|
|
21
|
+
const xMin = Math.min(...points.map((p) => p.x.evaluate()));
|
|
22
|
+
const xMax = Math.max(...points.map((p) => p.x.evaluate()));
|
|
23
|
+
const yMin = Math.min(...points.map((p) => p.y.evaluate()));
|
|
24
|
+
const yMax = Math.max(...points.map((p) => p.y.evaluate()));
|
|
25
|
+
return this.getAdaptedCoords({ xMin, xMax, yMin, yMax });
|
|
26
|
+
}
|
|
20
27
|
getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }) {
|
|
21
28
|
const showAxes = forceShowAxes ?? (this.hideAxes ? false : true);
|
|
22
29
|
const xDelta = xMax - xMin;
|