math-exercises 2.2.44 → 2.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +11 -11
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +11 -11
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +12 -0
- package/lib/exercises/math/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/argumentFromAlgebraicComplex.js +4 -5
- package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.js +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +3 -3
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +3 -3
- package/lib/exercises/math/geometry/euclidian/choseMethodToCalculateLength.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidian/choseMethodToCalculateLength.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/choseMethodToCalculateLength.js +79 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/index.js +1 -0
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/pythagore/index.d.ts +1 -0
- package/lib/exercises/math/geometry/pythagore/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/index.js +1 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts +11 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +108 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +3 -3
- package/lib/exercises/math/matrices/matrixInversibilityDomain.js +4 -4
- package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.js +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +1 -1
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts +2 -0
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts.map +1 -0
- package/lib/math/utils/geometry/pythagoricianTriplets.js +21 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +4 -5
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.js +3 -0
- package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +3 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +2 -0
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +6 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +3 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +3 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +3 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +3 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +3 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +3 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +3 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +3 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +3 -0
- package/lib/tree/parsers/affineParser.js +1 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts +3 -0
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -0
- package/lib/tree/parsers/equationSolutionParser.js +29 -0
- package/lib/tree/parsers/latexParser.d.ts +4 -1
- package/lib/tree/parsers/latexParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +54 -6
- package/package.json +1 -1
|
@@ -5,19 +5,19 @@ export declare const addWrongProp: (props: Proposition[], statement: string, for
|
|
|
5
5
|
export declare const tryToAddWrongProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
6
6
|
export declare const shuffleProps: (props: Proposition[], n: number) => Proposition[];
|
|
7
7
|
export declare enum GeneratorOptionTarget {
|
|
8
|
-
generation =
|
|
9
|
-
vea =
|
|
10
|
-
ggb =
|
|
11
|
-
instruction =
|
|
12
|
-
hint =
|
|
13
|
-
correction =
|
|
14
|
-
answer =
|
|
15
|
-
qcm =
|
|
16
|
-
keys =
|
|
8
|
+
generation = "generation",
|
|
9
|
+
vea = "vea",
|
|
10
|
+
ggb = "ggb",
|
|
11
|
+
instruction = "instruction",
|
|
12
|
+
hint = "hint",
|
|
13
|
+
correction = "correction",
|
|
14
|
+
answer = "answer",
|
|
15
|
+
qcm = "qcm",
|
|
16
|
+
keys = "keys"
|
|
17
17
|
}
|
|
18
18
|
export declare enum GeneratorOptionType {
|
|
19
|
-
checkbox =
|
|
20
|
-
select =
|
|
19
|
+
checkbox = "checkbox",
|
|
20
|
+
select = "select"
|
|
21
21
|
}
|
|
22
22
|
export type GeneratorOption = {
|
|
23
23
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;A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,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -38,18 +38,18 @@ const shuffleProps = (props, n) => {
|
|
|
38
38
|
exports.shuffleProps = shuffleProps;
|
|
39
39
|
var GeneratorOptionTarget;
|
|
40
40
|
(function (GeneratorOptionTarget) {
|
|
41
|
-
GeneratorOptionTarget[
|
|
42
|
-
GeneratorOptionTarget[
|
|
43
|
-
GeneratorOptionTarget[
|
|
44
|
-
GeneratorOptionTarget[
|
|
45
|
-
GeneratorOptionTarget[
|
|
46
|
-
GeneratorOptionTarget[
|
|
47
|
-
GeneratorOptionTarget[
|
|
48
|
-
GeneratorOptionTarget[
|
|
49
|
-
GeneratorOptionTarget[
|
|
41
|
+
GeneratorOptionTarget["generation"] = "generation";
|
|
42
|
+
GeneratorOptionTarget["vea"] = "vea";
|
|
43
|
+
GeneratorOptionTarget["ggb"] = "ggb";
|
|
44
|
+
GeneratorOptionTarget["instruction"] = "instruction";
|
|
45
|
+
GeneratorOptionTarget["hint"] = "hint";
|
|
46
|
+
GeneratorOptionTarget["correction"] = "correction";
|
|
47
|
+
GeneratorOptionTarget["answer"] = "answer";
|
|
48
|
+
GeneratorOptionTarget["qcm"] = "qcm";
|
|
49
|
+
GeneratorOptionTarget["keys"] = "keys";
|
|
50
50
|
})(GeneratorOptionTarget || (exports.GeneratorOptionTarget = GeneratorOptionTarget = {}));
|
|
51
51
|
var GeneratorOptionType;
|
|
52
52
|
(function (GeneratorOptionType) {
|
|
53
|
-
GeneratorOptionType[
|
|
54
|
-
GeneratorOptionType[
|
|
53
|
+
GeneratorOptionType["checkbox"] = "checkbox";
|
|
54
|
+
GeneratorOptionType["select"] = "select";
|
|
55
55
|
})(GeneratorOptionType || (exports.GeneratorOptionType = GeneratorOptionType = {}));
|
|
@@ -47,7 +47,7 @@ const isAnswerValid = (ans, { rational, rational2 }, opts) => {
|
|
|
47
47
|
const texs = answerTree.toAllValidTexs();
|
|
48
48
|
if (allow)
|
|
49
49
|
try {
|
|
50
|
-
const parsed = (0, latexParser_1.
|
|
50
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans).simplify().toTex();
|
|
51
51
|
return texs.includes(parsed);
|
|
52
52
|
}
|
|
53
53
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -62,6 +62,18 @@ const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
|
62
62
|
return (0, shuffle_1.shuffle)(propositions);
|
|
63
63
|
};
|
|
64
64
|
const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
65
|
+
// try {
|
|
66
|
+
// const parsed = equationSolutionParser(ans);
|
|
67
|
+
// if (!parsed) return false;
|
|
68
|
+
// console.log("parsed", parsed.toTex());
|
|
69
|
+
// const solution = new Rational(d - b, a - c).simplify().toTree();
|
|
70
|
+
// const solutionTex = solution.toTex();
|
|
71
|
+
// const decimal = round(solution.evaluate({}), 12).frenchify();
|
|
72
|
+
// const parsedSolution = parsed.simplify().toTex();
|
|
73
|
+
// return solutionTex === parsedSolution || decimal === parsedSolution;
|
|
74
|
+
// } catch (err) {
|
|
75
|
+
// return false;
|
|
76
|
+
// }
|
|
65
77
|
const solution = new rational_1.Rational(d - b, a - c).simplify().toTree();
|
|
66
78
|
const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([solution]), {
|
|
67
79
|
opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA8CF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -5,7 +5,6 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
7
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
8
|
-
const remarkableValue_1 = require("../../../math/trigonometry/remarkableValue");
|
|
9
8
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
10
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
10
|
const complexNode_1 = require("../../../tree/nodes/complex/complexNode");
|
|
@@ -14,9 +13,9 @@ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
|
14
13
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
15
14
|
const random_1 = require("../../../utils/alea/random");
|
|
16
15
|
const getArgumentFromAlgebraicComplexQuestion = () => {
|
|
17
|
-
const arg =
|
|
16
|
+
const arg = (0, random_1.random)(remarkableValues_1.mainTrigoValues);
|
|
18
17
|
const factor = (0, random_1.random)([
|
|
19
|
-
new integer_1.Integer((0, randint_1.randint)(
|
|
18
|
+
new integer_1.Integer((0, randint_1.randint)(2, 6)).toTree(),
|
|
20
19
|
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
21
20
|
(0, random_1.random)([new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(2)), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(3))]),
|
|
22
21
|
]);
|
|
@@ -38,13 +37,13 @@ const getPropositions = (n, { answer }) => {
|
|
|
38
37
|
const propositions = [];
|
|
39
38
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
40
39
|
while (propositions.length < n) {
|
|
41
|
-
const randomPoint =
|
|
40
|
+
const randomPoint = (0, random_1.random)(remarkableValues_1.mainTrigoValues);
|
|
42
41
|
(0, exercise_1.tryToAddWrongProp)(propositions, randomPoint.angle.toTex());
|
|
43
42
|
}
|
|
44
43
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
45
44
|
};
|
|
46
45
|
const isAnswerValid = (ans, { arg }) => {
|
|
47
|
-
const point = remarkableValues_1.
|
|
46
|
+
const point = remarkableValues_1.mainTrigoValues.find((point) => point.angle.evaluate({}) === arg);
|
|
48
47
|
const texs = point.angle.toAllValidTexs();
|
|
49
48
|
return texs.includes(ans);
|
|
50
49
|
};
|
|
@@ -39,7 +39,7 @@ const getPropositions = (n, { answer, affineA, affineB }) => {
|
|
|
39
39
|
};
|
|
40
40
|
const isAnswerValid = (ans, { answer, affineA, affineB }) => {
|
|
41
41
|
try {
|
|
42
|
-
const parsed = (0, latexParser_1.
|
|
42
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
43
43
|
const simplified = parsed.simplify();
|
|
44
44
|
return simplified.toTex() === answer;
|
|
45
45
|
}
|
|
@@ -16,7 +16,7 @@ const random_1 = require("../../../../utils/alea/random");
|
|
|
16
16
|
const getPropositions = (n, { answer, absciss, abscissTex, abscissType, axisUnit, oneUnitTex }) => {
|
|
17
17
|
const propositions = [];
|
|
18
18
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
-
const unitNode = (0, latexParser_1.
|
|
19
|
+
const unitNode = (0, latexParser_1.parseAlgebraic)(oneUnitTex);
|
|
20
20
|
while (propositions.length < n) {
|
|
21
21
|
const coeff = (0, randint_1.randint)(-6, 7, [0, 1]);
|
|
22
22
|
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(unitNode, coeff.toTree()).simplify().toTex());
|
|
@@ -61,8 +61,8 @@ const getKeys = (identifiers) => {
|
|
|
61
61
|
};
|
|
62
62
|
const isAnswerValid = (ans, { answer, abscissTex }) => {
|
|
63
63
|
try {
|
|
64
|
-
const answerNode = (0, latexParser_1.
|
|
65
|
-
const node = (0, latexParser_1.
|
|
64
|
+
const answerNode = (0, latexParser_1.parseAlgebraic)(ans);
|
|
65
|
+
const node = (0, latexParser_1.parseAlgebraic)(abscissTex);
|
|
66
66
|
return Math.abs(node.evaluate({}) - answerNode.evaluate({})) < 0.00001;
|
|
67
67
|
}
|
|
68
68
|
catch (err) {
|
|
@@ -16,7 +16,7 @@ const random_1 = require("../../../../utils/alea/random");
|
|
|
16
16
|
const getPropositions = (n, { answer, absciss, abscissTex, abscissType, axisUnit, oneUnitTex }) => {
|
|
17
17
|
const propositions = [];
|
|
18
18
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
-
const unitNode = (0, latexParser_1.
|
|
19
|
+
const unitNode = (0, latexParser_1.parseAlgebraic)(oneUnitTex);
|
|
20
20
|
while (propositions.length < n) {
|
|
21
21
|
const coeff = (0, randint_1.randint)(2, 10);
|
|
22
22
|
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(unitNode, coeff.toTree()).simplify().toTex());
|
|
@@ -62,8 +62,8 @@ const getKeys = (identifiers) => {
|
|
|
62
62
|
};
|
|
63
63
|
const isAnswerValid = (ans, { answer, abscissTex }) => {
|
|
64
64
|
try {
|
|
65
|
-
const answerNode = (0, latexParser_1.
|
|
66
|
-
const node = (0, latexParser_1.
|
|
65
|
+
const answerNode = (0, latexParser_1.parseAlgebraic)(ans);
|
|
66
|
+
const node = (0, latexParser_1.parseAlgebraic)(abscissTex);
|
|
67
67
|
return Math.abs(node.evaluate({}) - answerNode.evaluate({})) < 0.00001;
|
|
68
68
|
}
|
|
69
69
|
catch (err) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=choseMethodToCalculateLength.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choseMethodToCalculateLength.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/choseMethodToCalculateLength.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {
|
|
3
|
+
// Exercise,
|
|
4
|
+
// Proposition,
|
|
5
|
+
// QCMGenerator,
|
|
6
|
+
// Question,
|
|
7
|
+
// QuestionGenerator,
|
|
8
|
+
// VEA,
|
|
9
|
+
// addValidProp,
|
|
10
|
+
// shuffleProps,
|
|
11
|
+
// GetAnswer,
|
|
12
|
+
// GetHint,
|
|
13
|
+
// GetCorrection,
|
|
14
|
+
// GetInstruction,
|
|
15
|
+
// GetKeys,
|
|
16
|
+
// tryToAddWrongProp,
|
|
17
|
+
// } from "../../../../exercises/exercise";
|
|
18
|
+
// import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions";
|
|
19
|
+
// type Identifiers = {
|
|
20
|
+
// type: "pythagore" | "thalès" | "trigo";
|
|
21
|
+
// };
|
|
22
|
+
// const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
|
|
23
|
+
// const propositions: Proposition[] = [];
|
|
24
|
+
// addValidProp(propositions, answer, "raw");
|
|
25
|
+
// tryToAddWrongProp(propositions, "Le théorème de Pythagore", "raw");
|
|
26
|
+
// tryToAddWrongProp(propositions, "Le théorème de Thalès", "raw");
|
|
27
|
+
// tryToAddWrongProp(propositions, "La trigonométrie", "raw");
|
|
28
|
+
// return shuffleProps(propositions, n);
|
|
29
|
+
// };
|
|
30
|
+
// const getAnswer: GetAnswer<Identifiers> = (identifiers) => {
|
|
31
|
+
// switch (identifiers.type) {
|
|
32
|
+
// case "pythagore":
|
|
33
|
+
// return "Le théorème de Pythagore";
|
|
34
|
+
// case "thalès":
|
|
35
|
+
// return "Le théorème de Thalès";
|
|
36
|
+
// case "trigo":
|
|
37
|
+
// return "La trigonométrie";
|
|
38
|
+
// }
|
|
39
|
+
// };
|
|
40
|
+
// const getInstruction: GetInstruction<Identifiers> = (identifiers) => {};
|
|
41
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
42
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
43
|
+
// const getKeys: GetKeys<Identifiers> = (identifiers) => {
|
|
44
|
+
// return [];
|
|
45
|
+
// };
|
|
46
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, { answer }) => {
|
|
47
|
+
// throw Error("VEA not implemented");
|
|
48
|
+
// };
|
|
49
|
+
// const getChoseMethodToCalculateLengthQuestion: QuestionGenerator<
|
|
50
|
+
// Identifiers
|
|
51
|
+
// > = () => {
|
|
52
|
+
// const identifiers: Identifiers = {};
|
|
53
|
+
// const question: Question<Identifiers> = {
|
|
54
|
+
// answer: getAnswer(identifiers),
|
|
55
|
+
// instruction: getInstruction(identifiers),
|
|
56
|
+
// keys: getKeys(identifiers),
|
|
57
|
+
// answerFormat: "tex",
|
|
58
|
+
// identifiers,
|
|
59
|
+
// hint: getHint(identifiers),
|
|
60
|
+
// correction: getCorrection(identifiers),
|
|
61
|
+
// };
|
|
62
|
+
// return question;
|
|
63
|
+
// };
|
|
64
|
+
// export const choseMethodToCalculateLength: Exercise<Identifiers> = {
|
|
65
|
+
// id: "choseMethodToCalculateLength",
|
|
66
|
+
// connector: "",
|
|
67
|
+
// label: undefined,
|
|
68
|
+
// isSingleStep: true,
|
|
69
|
+
// generator: (nb: number) =>
|
|
70
|
+
// getDistinctQuestions(getChoseMethodToCalculateLengthQuestion, nb),
|
|
71
|
+
// qcmTimer: 60,
|
|
72
|
+
// freeTimer: 60,
|
|
73
|
+
// getPropositions,
|
|
74
|
+
// isAnswerValid,
|
|
75
|
+
// subject: "Mathématiques",
|
|
76
|
+
// getHint,
|
|
77
|
+
// getCorrection,
|
|
78
|
+
// getAnswer,
|
|
79
|
+
// };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./pythagore"), exports);
|
|
18
18
|
__exportStar(require("./pythagoreCalcul"), exports);
|
|
19
|
+
__exportStar(require("./isTriangleRight"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
isRight: boolean;
|
|
4
|
+
a: number;
|
|
5
|
+
b: number;
|
|
6
|
+
c: number;
|
|
7
|
+
vertices: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const isTriangleRight: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=isTriangleRight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTriangleRight = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const pythagoricianTriplets_1 = require("../../../../math/utils/geometry/pythagoricianTriplets");
|
|
7
|
+
const round_1 = require("../../../../math/utils/round");
|
|
8
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
11
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
12
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
15
|
+
const getPropositions = (n, { answer }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
19
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
21
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
22
|
+
};
|
|
23
|
+
const getAnswer = (identifiers) => {
|
|
24
|
+
return identifiers.isRight ? "Oui" : "Non";
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
const triangleName = identifiers.vertices.join("");
|
|
28
|
+
const sides = identifiers.vertices.map((vertex, index) => vertex + identifiers.vertices[(index + 1) % 3]);
|
|
29
|
+
return `Soit $${triangleName}$ un triangle avec $${sides[0]} = ${identifiers.a.frenchify()}$, $${sides[1]} = ${identifiers.b.frenchify()}$ et $${sides[2]} = ${identifiers.c.frenchify()}$. Le triangle $${triangleName}$ est-il rectangle ?`;
|
|
30
|
+
};
|
|
31
|
+
const getHint = (identifiers) => {
|
|
32
|
+
return `Si la somme des carrés des côtés est égale au carré de l'hypoténuse, alors le triangle est rectangle, d'après la réciproque du théorème de Pythagore. Si ce n'est pas le cas, alors le triangle n'est pas rectangle, d'après le théorème de Pythagore. L'hypoténuse est toujours le côté le plus grand dans un triangle.`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const hypo = Math.max(identifiers.a, identifiers.b, identifiers.c);
|
|
36
|
+
const sides = [identifiers.a, identifiers.b, identifiers.c].filter((e) => e !== hypo);
|
|
37
|
+
return `La somme des carrés des côtés est égale à :
|
|
38
|
+
|
|
39
|
+
${(0, alignTex_1.alignTex)([
|
|
40
|
+
[
|
|
41
|
+
new addNode_1.AddNode(new powerNode_1.SquareNode(sides[0].toTree()), new powerNode_1.SquareNode(sides[1].toTree())).toTex(),
|
|
42
|
+
"=",
|
|
43
|
+
(0, round_1.round)(sides[0] ** 2, 6).frenchify() +
|
|
44
|
+
"+" +
|
|
45
|
+
(0, round_1.round)(sides[1] ** 2, 6).frenchify(),
|
|
46
|
+
],
|
|
47
|
+
["", "=", (0, round_1.round)(sides[0] ** 2 + sides[1] ** 2, 6).frenchify()],
|
|
48
|
+
])}
|
|
49
|
+
|
|
50
|
+
Le carré de l'hypoténuse vaut :
|
|
51
|
+
|
|
52
|
+
$$
|
|
53
|
+
${new powerNode_1.SquareNode(hypo.toTree()).toTex()} = ${(0, round_1.round)(hypo ** 2, 6).frenchify()}
|
|
54
|
+
$$
|
|
55
|
+
|
|
56
|
+
${identifiers.isRight
|
|
57
|
+
? "La somme des carrés des côtés est donc égale au carré de l'hypoténuse. D'après la réciproque du théorème de Pythagore, le triangle est donc rectangle."
|
|
58
|
+
: "La somme des carrés des côtés n'est donc pas égale au carré de l'hypoténuse. D'après le théorème de Pythagore, le triangle n'est donc pas rectangle."}`;
|
|
59
|
+
};
|
|
60
|
+
const getKeys = (identifiers) => {
|
|
61
|
+
return [];
|
|
62
|
+
};
|
|
63
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
64
|
+
throw Error("VEA not implemented");
|
|
65
|
+
};
|
|
66
|
+
const getIsTriangleRightQuestion = () => {
|
|
67
|
+
const isRight = (0, coinFlip_1.coinFlip)();
|
|
68
|
+
const startVertix = (0, randomLetter_1.randomLetter)(true, ["Y", "Z"]);
|
|
69
|
+
const vertices = [
|
|
70
|
+
startVertix,
|
|
71
|
+
String.fromCharCode(startVertix.charCodeAt(0) + 1),
|
|
72
|
+
String.fromCharCode(startVertix.charCodeAt(0) + 2),
|
|
73
|
+
];
|
|
74
|
+
const triplet = (0, random_1.random)(pythagoricianTriplets_1.pythagoricianTriplets);
|
|
75
|
+
const coeff = (0, random_1.random)([1, 2, 3, 4, 0.1, 0.2, 0.4, 0.5]);
|
|
76
|
+
let [a, b, c] = triplet.map((e) => (0, round_1.round)(e * coeff, 4));
|
|
77
|
+
if (!isRight) {
|
|
78
|
+
c = (0, doWhile_1.doWhile)(() => (0, round_1.round)(coeff * (triplet[2] + (0, random_1.random)([-1, 1])), 4), (x) => x === a || x === b);
|
|
79
|
+
}
|
|
80
|
+
const identifiers = { isRight, vertices, a, b, c };
|
|
81
|
+
const question = {
|
|
82
|
+
answer: getAnswer(identifiers),
|
|
83
|
+
instruction: getInstruction(identifiers),
|
|
84
|
+
keys: getKeys(identifiers),
|
|
85
|
+
answerFormat: "tex",
|
|
86
|
+
identifiers,
|
|
87
|
+
hint: getHint(identifiers),
|
|
88
|
+
correction: getCorrection(identifiers),
|
|
89
|
+
};
|
|
90
|
+
return question;
|
|
91
|
+
};
|
|
92
|
+
exports.isTriangleRight = {
|
|
93
|
+
id: "isTriangleRight",
|
|
94
|
+
connector: "\\iff",
|
|
95
|
+
label: "Déterminer si un triangle est rectangle via Pythagore",
|
|
96
|
+
isSingleStep: true,
|
|
97
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIsTriangleRightQuestion, nb),
|
|
98
|
+
qcmTimer: 60,
|
|
99
|
+
freeTimer: 60,
|
|
100
|
+
getPropositions,
|
|
101
|
+
isAnswerValid,
|
|
102
|
+
subject: "Mathématiques",
|
|
103
|
+
getHint,
|
|
104
|
+
getCorrection,
|
|
105
|
+
getAnswer,
|
|
106
|
+
hasHintAndCorrection: true,
|
|
107
|
+
answerType: "QCU",
|
|
108
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductViaCos.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"scalarProductViaCos.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyDF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.scalarProductViaCos = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const remarkableValue_1 = require("../../../../../math/trigonometry/remarkableValue");
|
|
7
6
|
const remarkableValues_1 = require("../../../../../math/trigonometry/remarkableValues");
|
|
8
7
|
const randint_1 = require("../../../../../math/utils/random/randint");
|
|
9
8
|
const numberNode_1 = require("../../../../../tree/nodes/numbers/numberNode");
|
|
10
9
|
const multiplyNode_1 = require("../../../../../tree/nodes/operators/multiplyNode");
|
|
11
10
|
const randomLetter_1 = require("../../../../../utils/strings/randomLetter");
|
|
12
11
|
const shuffle_1 = require("../../../../../utils/alea/shuffle");
|
|
12
|
+
const random_1 = require("../../../../../utils/alea/random");
|
|
13
13
|
//|u| |v| cos(u,v)
|
|
14
14
|
const getScalarProductViaCosQuestion = () => {
|
|
15
15
|
const AB = (0, randint_1.randint)(1, 10);
|
|
16
16
|
const AC = (0, randint_1.randint)(1, 10);
|
|
17
|
-
const trigo =
|
|
17
|
+
const trigo = (0, random_1.random)(remarkableValues_1.mainTrigoValues);
|
|
18
18
|
const answer = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(AB * AC), trigo.cos)
|
|
19
19
|
.simplify()
|
|
20
20
|
.toTex();
|
|
@@ -40,7 +40,7 @@ const getPropositions = (n, { answer, AB, AC, trigoPoint }) => {
|
|
|
40
40
|
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(AB * AC), trigo.sin).simplify().toTex());
|
|
41
41
|
const coeff = new numberNode_1.NumberNode(AB * AC);
|
|
42
42
|
while (propositions.length < n) {
|
|
43
|
-
const trigoValue =
|
|
43
|
+
const trigoValue = (0, random_1.random)(remarkableValues_1.mainTrigoValues);
|
|
44
44
|
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(coeff, trigoValue.sin).simplify().toTex());
|
|
45
45
|
}
|
|
46
46
|
return (0, shuffle_1.shuffle)(propositions);
|
|
@@ -66,10 +66,10 @@ const getMatrixInversibilityDomainQuestion = () => {
|
|
|
66
66
|
const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
67
67
|
const propositions = [];
|
|
68
68
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
69
|
-
const aTree = (0, latexParser_1.
|
|
70
|
-
const bTree = (0, latexParser_1.
|
|
71
|
-
const cTree = (0, latexParser_1.
|
|
72
|
-
const dTree = (0, latexParser_1.
|
|
69
|
+
const aTree = (0, latexParser_1.parseAlgebraic)(a);
|
|
70
|
+
const bTree = (0, latexParser_1.parseAlgebraic)(b);
|
|
71
|
+
const cTree = (0, latexParser_1.parseAlgebraic)(c);
|
|
72
|
+
const dTree = (0, latexParser_1.parseAlgebraic)(d);
|
|
73
73
|
const det = new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(aTree, dTree), new multiplyNode_1.MultiplyNode(bTree, cTree)).simplify();
|
|
74
74
|
(0, exercise_1.tryToAddWrongProp)(propositions, unionIntervalNode_1.UnionIntervalNodeBuilder.realMinus(det).toTex());
|
|
75
75
|
while (propositions.length < n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AA6HF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAgB7D,CAAC"}
|
|
@@ -56,7 +56,7 @@ const getKeys = (identifiers) => {
|
|
|
56
56
|
const isAnswerValid = (ans, { answer, degree }) => {
|
|
57
57
|
const value = remarkableValues_1.mainTrigoValues.find((e) => e.degree === degree);
|
|
58
58
|
try {
|
|
59
|
-
const parsed = (0, latexParser_1.
|
|
59
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
60
60
|
const simplified = parsed.simplify().toTex();
|
|
61
61
|
return simplified === answer;
|
|
62
62
|
// return value.angle.toAllValidTexs().includes(ans);
|
package/lib/index.d.ts
CHANGED
|
@@ -915,6 +915,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
915
915
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
916
916
|
square: number;
|
|
917
917
|
sideLengths: number[];
|
|
918
|
+
}, {}> | import("./exercises/exercise").Exercise<{
|
|
919
|
+
isRight: boolean;
|
|
920
|
+
a: number;
|
|
921
|
+
b: number;
|
|
922
|
+
c: number;
|
|
923
|
+
vertices: string[];
|
|
918
924
|
}, {}> | import("./exercises/exercise").Exercise<{
|
|
919
925
|
vertices: string[];
|
|
920
926
|
}, {}> | import("./exercises/exercise").Exercise<{
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -26,7 +26,7 @@ export declare class Interval implements MathSetInterface {
|
|
|
26
26
|
constructor(min: AlgebraicNode, max: AlgebraicNode, closure: ClosureType);
|
|
27
27
|
equals(interval: Interval): boolean;
|
|
28
28
|
union(interval: Interval): MathSet;
|
|
29
|
-
intersection(interval: Interval):
|
|
29
|
+
intersection(interval: Interval): IntervalNode | DiscreteSetNode;
|
|
30
30
|
insideToTex(): string;
|
|
31
31
|
toTex(): string;
|
|
32
32
|
toInequality(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythagoricianTriplets.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/geometry/pythagoricianTriplets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,YAiBjC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pythagoricianTriplets = void 0;
|
|
4
|
+
exports.pythagoricianTriplets = [
|
|
5
|
+
[3, 4, 5],
|
|
6
|
+
[5, 12, 13],
|
|
7
|
+
[7, 24, 25],
|
|
8
|
+
[8, 15, 17],
|
|
9
|
+
[9, 40, 41],
|
|
10
|
+
[11, 60, 61],
|
|
11
|
+
[12, 35, 37],
|
|
12
|
+
[13, 84, 85],
|
|
13
|
+
[16, 63, 65],
|
|
14
|
+
[20, 21, 29],
|
|
15
|
+
[28, 45, 53],
|
|
16
|
+
[33, 56, 65],
|
|
17
|
+
[36, 77, 85],
|
|
18
|
+
[39, 80, 89],
|
|
19
|
+
[48, 55, 73],
|
|
20
|
+
[65, 72, 97],
|
|
21
|
+
];
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,UAAU,YAMtB,CAAC"}
|