math-exercises 3.0.22 → 3.0.23
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 +2 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +60 -28
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +5 -3
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +5 -3
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +5 -2
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +47 -16
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -3
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +141 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +1 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +38 -26
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +6 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.d.ts +2 -1
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +16 -2
- package/lib/math/spaceGeometry/prism.d.ts +4 -0
- package/lib/math/spaceGeometry/prism.d.ts.map +1 -0
- package/lib/math/spaceGeometry/prism.js +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts +4 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +2 -2
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +4 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +4 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +2 -2
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +4 -1
- package/package.json +1 -1
|
@@ -57,6 +57,8 @@ export type GeogebraOptions = {
|
|
|
57
57
|
lockedAxesRatio?: number | false;
|
|
58
58
|
xAxis?: GeogebraAxisOptions;
|
|
59
59
|
yAxis?: GeogebraAxisOptions;
|
|
60
|
+
zAxis?: GeogebraAxisOptions;
|
|
61
|
+
viewDirectionVector?: number[];
|
|
60
62
|
};
|
|
61
63
|
export type KeyboardOptions = {
|
|
62
64
|
parenthesisShouldNotProduceLeftRight?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MA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AAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3E;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,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;AAwHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -8,6 +8,55 @@ import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
8
8
|
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
9
9
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
10
10
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
11
|
+
const getStatementNode = (identifiers) => {
|
|
12
|
+
const { a, b, c, d } = identifiers;
|
|
13
|
+
const polynome1 = new Polynomial([b, a]);
|
|
14
|
+
const polynome2 = new Polynomial([d, c]);
|
|
15
|
+
const statement = new MultiplyNode(polynome1.toTree(), polynome2.toTree());
|
|
16
|
+
return statement;
|
|
17
|
+
};
|
|
18
|
+
const getStartStatement = (identifiers) => {
|
|
19
|
+
return `${getStatementNode(identifiers).toTex()} = 0`;
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = (identifiers) => {
|
|
22
|
+
return `Résoudre :
|
|
23
|
+
|
|
24
|
+
$$
|
|
25
|
+
${getStartStatement(identifiers)}
|
|
26
|
+
$$`;
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const { a, b, c, d } = identifiers;
|
|
30
|
+
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
31
|
+
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
32
|
+
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
33
|
+
const answer = new EquationSolutionNode(new DiscreteSetNode(sortedSols)).toTex();
|
|
34
|
+
return answer;
|
|
35
|
+
};
|
|
36
|
+
const getHint = (identifiers) => {
|
|
37
|
+
return "Un produit est nul si et seulement si un des deux facteurs est nul. Donc, il faut trouver les valeurs de $x$ qui rendent un des deux facteurs nuls.";
|
|
38
|
+
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
const { a, b, c, d } = identifiers;
|
|
41
|
+
const polynome1 = new Polynomial([b, a]);
|
|
42
|
+
const polynome2 = new Polynomial([d, c]);
|
|
43
|
+
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
44
|
+
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
45
|
+
return `Un produit est nul si et seulement si un des deux facteurs est nul. On résout donc deux équations :
|
|
46
|
+
|
|
47
|
+
${alignTex([
|
|
48
|
+
["", getStartStatement(identifiers)],
|
|
49
|
+
[
|
|
50
|
+
"\\iff",
|
|
51
|
+
`${polynome1.toTree().toTex()} = 0 \\text{ ou } ${polynome2
|
|
52
|
+
.toTree()
|
|
53
|
+
.toTex()} = 0`,
|
|
54
|
+
],
|
|
55
|
+
["\\iff", `x=${sol1.toTex()} \\text{ ou } x=${sol2.toTex()}`],
|
|
56
|
+
])}
|
|
57
|
+
|
|
58
|
+
Ainsi, $${getAnswer(identifiers)}$`;
|
|
59
|
+
};
|
|
11
60
|
const getMultiplicationEquation = () => {
|
|
12
61
|
// (ax + b)(cx + d) = 0
|
|
13
62
|
let a, b, c, d;
|
|
@@ -17,35 +66,16 @@ const getMultiplicationEquation = () => {
|
|
|
17
66
|
c = randint(-9, 10, [0]);
|
|
18
67
|
d = randint(-9, 10, [0]);
|
|
19
68
|
} while (a / c === b / d);
|
|
20
|
-
const
|
|
21
|
-
const polynome2 = new Polynomial([d, c]);
|
|
22
|
-
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
23
|
-
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
24
|
-
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
25
|
-
const answer = new EquationSolutionNode(new DiscreteSetNode(sortedSols)).toTex();
|
|
26
|
-
const statementTex = new MultiplyNode(polynome1.toTree(), polynome2.toTree()).toTex();
|
|
69
|
+
const identifiers = { a, b, c, d };
|
|
27
70
|
const question = {
|
|
28
|
-
instruction:
|
|
29
|
-
startStatement:
|
|
30
|
-
answer,
|
|
71
|
+
instruction: getInstruction(identifiers),
|
|
72
|
+
startStatement: getStartStatement(identifiers),
|
|
73
|
+
answer: getAnswer(identifiers),
|
|
31
74
|
keys: ["x", "S", "equal", "lbrace", "rbrace", "semicolon", "ou"],
|
|
32
75
|
answerFormat: "tex",
|
|
33
|
-
identifiers
|
|
34
|
-
hint:
|
|
35
|
-
correction:
|
|
36
|
-
|
|
37
|
-
${alignTex([
|
|
38
|
-
["", `${statementTex} = 0`],
|
|
39
|
-
[
|
|
40
|
-
"\\iff",
|
|
41
|
-
`${polynome1.toTree().toTex()} = 0 \\text{ ou } ${polynome2
|
|
42
|
-
.toTree()
|
|
43
|
-
.toTex()} = 0`,
|
|
44
|
-
],
|
|
45
|
-
["\\iff", `x=${sol1.toTex()} \\text{ ou } x=${sol2.toTex()}`],
|
|
46
|
-
])}
|
|
47
|
-
|
|
48
|
-
Ainsi, $${answer}$`,
|
|
76
|
+
identifiers,
|
|
77
|
+
hint: getHint(identifiers),
|
|
78
|
+
correction: getCorrection(identifiers),
|
|
49
79
|
};
|
|
50
80
|
return question;
|
|
51
81
|
};
|
|
@@ -82,8 +112,6 @@ export const multiplicationEquation = {
|
|
|
82
112
|
id: "multiplicationEquation",
|
|
83
113
|
connector: "\\iff",
|
|
84
114
|
label: "Résoudre une équation produit nul",
|
|
85
|
-
levels: ["2nde", "1reESM", "1reSpé", "1reTech"],
|
|
86
|
-
sections: ["Équations"],
|
|
87
115
|
isSingleStep: false,
|
|
88
116
|
generator: (nb) => getDistinctQuestions(getMultiplicationEquation, nb),
|
|
89
117
|
qcmTimer: 60,
|
|
@@ -92,4 +120,8 @@ export const multiplicationEquation = {
|
|
|
92
120
|
isAnswerValid,
|
|
93
121
|
subject: "Mathématiques",
|
|
94
122
|
hasHintAndCorrection: true,
|
|
123
|
+
getInstruction,
|
|
124
|
+
getAnswer,
|
|
125
|
+
getCorrection,
|
|
126
|
+
getHint,
|
|
95
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA8CF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAgBpE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,YAAY,CAC9D,WAAW,CA+BZ,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,GAAG,CAAC,WAAW,CAQhE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAyBxD,CAAC"}
|
|
@@ -40,9 +40,11 @@ $$
|
|
|
40
40
|
};
|
|
41
41
|
const getInstruction = (identifiers) => {
|
|
42
42
|
const polynomial = new Polynomial(identifiers.coefficients);
|
|
43
|
-
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
f(x) = ${polynomial.toTree().toTex()}
|
|
47
|
+
$$`;
|
|
46
48
|
};
|
|
47
49
|
export const getSecondDegreeDerivative = () => {
|
|
48
50
|
const coefficients = [randint(-9, 10), randint(-9, 10), randint(-9, 10, [0])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA8CF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAmBnE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAwC1E,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAe/D,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CA0BvD,CAAC"}
|
|
@@ -36,9 +36,11 @@ $$
|
|
|
36
36
|
};
|
|
37
37
|
const getInstruction = (identifiers) => {
|
|
38
38
|
const polynomial = new Polynomial(identifiers.coefficients);
|
|
39
|
-
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
40
|
+
|
|
41
|
+
$$
|
|
42
|
+
f(x) = ${polynomial.toTree().toTex()}
|
|
43
|
+
$$`;
|
|
42
44
|
};
|
|
43
45
|
const getAnswer = (identifiers) => {
|
|
44
46
|
const polynomial = new Polynomial(identifiers.coefficients);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expFactorization.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/expFactorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"expFactorization.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponential/expFactorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA6JF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -3,12 +3,13 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
|
|
|
3
3
|
// import { expressionVEA } from "#root/exercises/vea/expressionVEA.js";
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
5
|
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
-
import { exp } from "../../../../tree/nodes/functions/expNode.js";
|
|
6
|
+
import { exp, isExpNode } from "../../../../tree/nodes/functions/expNode.js";
|
|
7
7
|
import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
8
|
// import { variable } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
9
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
10
|
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
11
|
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
12
|
+
import { isOppositeNode } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
12
13
|
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
13
14
|
const propositions = [];
|
|
14
15
|
const { uA } = identifiers;
|
|
@@ -82,7 +83,9 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
|
82
83
|
const parsed = parseAlgebraic(ans);
|
|
83
84
|
if (!parsed)
|
|
84
85
|
return false;
|
|
85
|
-
if (!isMultiplyNode(parsed)
|
|
86
|
+
if (!isMultiplyNode(parsed) &&
|
|
87
|
+
!isExpNode(parsed) &&
|
|
88
|
+
!(isOppositeNode(parsed) && isExpNode(parsed.child)))
|
|
86
89
|
return false;
|
|
87
90
|
const simp = parsed.simplify({
|
|
88
91
|
forbidFactorize: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CA8B7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAWrD,CAAC"}
|
|
@@ -2,19 +2,34 @@ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
|
|
4
4
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
5
6
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
7
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
8
|
+
const getInstruction = (identifiers) => {
|
|
9
|
+
const polynomial = new Polynomial(identifiers.coeffs);
|
|
10
|
+
return `Déterminer la forme générale des primitives de la fonction polynomiale $f$ définie par :
|
|
11
|
+
|
|
12
|
+
$$
|
|
13
|
+
f(x) = ${polynomial.toTex()}
|
|
14
|
+
$$`;
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const polynomial = new Polynomial(identifiers.coeffs);
|
|
18
|
+
const integralPolynomial = polynomial.integrateToNode();
|
|
19
|
+
const answer = `${integralPolynomial.toTex()}`;
|
|
20
|
+
return answer;
|
|
21
|
+
};
|
|
6
22
|
export const getPolynomialPrimitive = () => {
|
|
7
23
|
const degree = randint(1, 4);
|
|
8
24
|
const polynomial = PolynomialConstructor.randomWithOrder(degree);
|
|
9
|
-
const
|
|
10
|
-
const answer = `${integralPolynomial.toTex()}`;
|
|
25
|
+
const identifiers = { coeffs: polynomial.coefficients };
|
|
11
26
|
const question = {
|
|
12
|
-
instruction:
|
|
27
|
+
instruction: getInstruction(identifiers),
|
|
13
28
|
startStatement: `F(x)`,
|
|
14
|
-
answer,
|
|
29
|
+
answer: getAnswer(identifiers),
|
|
15
30
|
keys: ["x", "C"],
|
|
16
31
|
answerFormat: "tex",
|
|
17
|
-
identifiers
|
|
32
|
+
identifiers,
|
|
18
33
|
};
|
|
19
34
|
return question;
|
|
20
35
|
};
|
|
@@ -28,22 +43,38 @@ export const getPolynomialPrimitivePropositions = (n, { answer, coeffs }) => {
|
|
|
28
43
|
}
|
|
29
44
|
return shuffle(propositions);
|
|
30
45
|
};
|
|
31
|
-
export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs }) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs, answer }) => {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = parseAlgebraic(ans);
|
|
49
|
+
if (!parsed)
|
|
50
|
+
return false;
|
|
51
|
+
// console.log(
|
|
52
|
+
// parsed
|
|
53
|
+
// .simplify({
|
|
54
|
+
// towardsDistribute: true,
|
|
55
|
+
// forbidFactorize: true,
|
|
56
|
+
// decimalToFractions: true,
|
|
57
|
+
// forceDistributeFractions: true,
|
|
58
|
+
// forceIsolateMonomCoeffs: true,
|
|
59
|
+
// })
|
|
60
|
+
// .toTex(),
|
|
61
|
+
// );
|
|
62
|
+
return (parsed
|
|
63
|
+
.simplify({
|
|
64
|
+
towardsDistribute: true,
|
|
65
|
+
forbidFactorize: true,
|
|
66
|
+
forceDistributeFractions: true,
|
|
67
|
+
})
|
|
68
|
+
.toTex() === answer);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
return handleVEAError(err);
|
|
72
|
+
}
|
|
40
73
|
};
|
|
41
74
|
export const polynomialPrimitive = {
|
|
42
75
|
id: "polynomialPrimitive",
|
|
43
76
|
connector: "=",
|
|
44
77
|
label: "Primitive d'une fonction polynomiale",
|
|
45
|
-
levels: ["TermSpé", "MathComp"],
|
|
46
|
-
sections: ["Primitives"],
|
|
47
78
|
isSingleStep: false,
|
|
48
79
|
generator: (nb) => getDistinctQuestions(getPolynomialPrimitive, nb),
|
|
49
80
|
qcmTimer: 60,
|
|
@@ -46,9 +46,9 @@ const getAnswer = (identifiers) => {
|
|
|
46
46
|
};
|
|
47
47
|
const getProbaFromTableWithContextQuestion = () => {
|
|
48
48
|
const aCapB = randint(1, 20);
|
|
49
|
-
const aCapBBarre = randint(1, 20);
|
|
50
|
-
const aBarreCapB = randint(1, 20);
|
|
51
|
-
const aBarreCapBBarre = randint(1, 20);
|
|
49
|
+
const aCapBBarre = randint(1, 20, [aCapB]);
|
|
50
|
+
const aBarreCapB = randint(1, 20, [aCapB, aCapBBarre]);
|
|
51
|
+
const aBarreCapBBarre = randint(1, 20, [aCapB, aCapBBarre, aBarreCapB]);
|
|
52
52
|
const total = aBarreCapB + aBarreCapBBarre + aCapB + aCapBBarre;
|
|
53
53
|
const aTotal = aCapB + aCapBBarre;
|
|
54
54
|
const bTotal = aCapB + aBarreCapB;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./spaceCoordinatesInPrism.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
l: number;
|
|
4
|
+
L: number;
|
|
5
|
+
h: number;
|
|
6
|
+
askedPoint: string;
|
|
7
|
+
givenPoints: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const spaceCoordinatesInPrism: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=spaceCoordinatesInPrism.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA0IF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { SpacePoint } from "../../../../math/geometry/spacePoint.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
7
|
+
const getPoints = (identifiers) => {
|
|
8
|
+
const { l, L, h } = identifiers;
|
|
9
|
+
const zeroTree = (0).toTree();
|
|
10
|
+
const lTree = l.toTree();
|
|
11
|
+
const LTree = L.toTree();
|
|
12
|
+
const hTree = h.toTree();
|
|
13
|
+
return [
|
|
14
|
+
new SpacePoint("A", zeroTree, zeroTree, zeroTree),
|
|
15
|
+
new SpacePoint("B", zeroTree, lTree, zeroTree),
|
|
16
|
+
new SpacePoint("C", LTree, lTree, zeroTree),
|
|
17
|
+
new SpacePoint("D", LTree, zeroTree, zeroTree),
|
|
18
|
+
new SpacePoint("E", zeroTree, zeroTree, hTree),
|
|
19
|
+
new SpacePoint("F", zeroTree, lTree, hTree),
|
|
20
|
+
new SpacePoint("G", LTree, lTree, hTree),
|
|
21
|
+
new SpacePoint("H", LTree, zeroTree, hTree),
|
|
22
|
+
];
|
|
23
|
+
};
|
|
24
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
25
|
+
const propositions = [];
|
|
26
|
+
const points = getPoints(identifiers);
|
|
27
|
+
addValidProp(propositions, answer);
|
|
28
|
+
while (propositions.length < n) {
|
|
29
|
+
tryToAddWrongProp(propositions, random(points).toCoords());
|
|
30
|
+
}
|
|
31
|
+
return shuffleProps(propositions, n);
|
|
32
|
+
};
|
|
33
|
+
const getAnswer = (identifiers) => {
|
|
34
|
+
const points = getPoints(identifiers);
|
|
35
|
+
return points.find((p) => p.name === identifiers.askedPoint).toCoords();
|
|
36
|
+
};
|
|
37
|
+
const getInstruction = (identifiers) => {
|
|
38
|
+
const { askedPoint, givenPoints } = identifiers;
|
|
39
|
+
const points = getPoints(identifiers);
|
|
40
|
+
return `On donne ci-dessous un parallélépipède rectangle dans l'espace rapporté à un repère.
|
|
41
|
+
|
|
42
|
+
Les coordonnées du point $${givenPoints[0]}$ sont $${points
|
|
43
|
+
.find((p) => p.name === givenPoints[0])
|
|
44
|
+
.toCoords()}$.
|
|
45
|
+
|
|
46
|
+
Les coordonnées du point $${givenPoints[1]}$ sont $${points
|
|
47
|
+
.find((p) => p.name === givenPoints[1])
|
|
48
|
+
.toCoords()}$.
|
|
49
|
+
|
|
50
|
+
Quelles sont les coordonnées du point $${askedPoint}$ ?`;
|
|
51
|
+
};
|
|
52
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
53
|
+
// }
|
|
54
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
55
|
+
// }
|
|
56
|
+
const getGGBOptions = (identifiers) => {
|
|
57
|
+
const { askedPoint, givenPoints, L, l, h } = identifiers;
|
|
58
|
+
const points = getPoints(identifiers);
|
|
59
|
+
const commands = [
|
|
60
|
+
...points.flatMap((p) => p.toGGBCommand({ color: "black", size: 2 })),
|
|
61
|
+
`P = Prism(${points
|
|
62
|
+
.slice(0, 5)
|
|
63
|
+
.map((p) => p.name)
|
|
64
|
+
.join(",")})`,
|
|
65
|
+
`SetVisibleInView(J, -1, false)`,
|
|
66
|
+
`SetVisibleInView(K, -1, false)`,
|
|
67
|
+
`SetVisibleInView(I, -1, false)`,
|
|
68
|
+
`SetColor(P, "#20000000")`,
|
|
69
|
+
`SetLineThickness(P, 1)`,
|
|
70
|
+
];
|
|
71
|
+
const ggb = new GeogebraConstructor({
|
|
72
|
+
commands,
|
|
73
|
+
is3D: true,
|
|
74
|
+
xAxis: {
|
|
75
|
+
hideNumbers: true,
|
|
76
|
+
showPositive: true,
|
|
77
|
+
},
|
|
78
|
+
yAxis: {
|
|
79
|
+
hideNumbers: true,
|
|
80
|
+
showPositive: true,
|
|
81
|
+
},
|
|
82
|
+
zAxis: {
|
|
83
|
+
hideNumbers: true,
|
|
84
|
+
showPositive: true,
|
|
85
|
+
},
|
|
86
|
+
viewDirectionVector: [-1, -1, -1],
|
|
87
|
+
});
|
|
88
|
+
return ggb.getOptions({
|
|
89
|
+
coords: [0, L + 3, 0, l + 3, 0, h + 3],
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const getKeys = (identifiers) => {
|
|
93
|
+
return ["semicolon"];
|
|
94
|
+
};
|
|
95
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
96
|
+
return ans === answer;
|
|
97
|
+
};
|
|
98
|
+
const getSpaceCoordinatesInPrismQuestion = (opts) => {
|
|
99
|
+
const l = randint(2, 10);
|
|
100
|
+
const L = randint(2, 10);
|
|
101
|
+
const h = randint(2, 10);
|
|
102
|
+
const letters = ["A", "B", "C", "D", "E", "F", "G", "H"];
|
|
103
|
+
const askedPoint = random(letters, ["A"]);
|
|
104
|
+
const givenPointOne = random(letters, ["A", askedPoint]);
|
|
105
|
+
const givenPointTwo = random(letters, ["A", askedPoint, givenPointOne]);
|
|
106
|
+
const identifiers = {
|
|
107
|
+
askedPoint,
|
|
108
|
+
givenPoints: [givenPointOne, givenPointTwo],
|
|
109
|
+
l,
|
|
110
|
+
L,
|
|
111
|
+
h,
|
|
112
|
+
};
|
|
113
|
+
const question = {
|
|
114
|
+
answer: getAnswer(identifiers),
|
|
115
|
+
instruction: getInstruction(identifiers),
|
|
116
|
+
keys: getKeys(identifiers),
|
|
117
|
+
answerFormat: "tex",
|
|
118
|
+
identifiers,
|
|
119
|
+
// hint: getHint(identifiers),
|
|
120
|
+
// correction: getCorrection(identifiers),
|
|
121
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
122
|
+
};
|
|
123
|
+
return question;
|
|
124
|
+
};
|
|
125
|
+
export const spaceCoordinatesInPrism = {
|
|
126
|
+
id: "spaceCoordinatesInPrism",
|
|
127
|
+
label: "Lire les coordonnées d'un point dans un parallélépipède",
|
|
128
|
+
isSingleStep: true,
|
|
129
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSpaceCoordinatesInPrismQuestion(opts), nb),
|
|
130
|
+
qcmTimer: 60,
|
|
131
|
+
freeTimer: 60,
|
|
132
|
+
getPropositions,
|
|
133
|
+
isAnswerValid,
|
|
134
|
+
subject: "Mathématiques",
|
|
135
|
+
// getHint,
|
|
136
|
+
// getCorrection,
|
|
137
|
+
getInstruction,
|
|
138
|
+
getAnswer,
|
|
139
|
+
getGGBOptions,
|
|
140
|
+
hasGeogebra: true,
|
|
141
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/spaceGeometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/spaceGeometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAsEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAWvD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
3
4
|
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
4
5
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
6
|
import { CosNode } from "../../../tree/nodes/functions/cosNode.js";
|
|
@@ -7,16 +8,48 @@ import { SinNode } from "../../../tree/nodes/functions/sinNode.js";
|
|
|
7
8
|
import { TanNode } from "../../../tree/nodes/functions/tanNode.js";
|
|
8
9
|
import { DegreeNode } from "../../../tree/nodes/geometry/degree.js";
|
|
9
10
|
import { random } from "../../../utils/alea/random.js";
|
|
10
|
-
const
|
|
11
|
+
const getInstruction = (identifiers) => {
|
|
12
|
+
const { degree, trigoFunct } = identifiers;
|
|
13
|
+
const node = trigoFunct === "tan" ? TanNode : trigoFunct === "sin" ? SinNode : CosNode;
|
|
14
|
+
return `Calculer :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
${new node(new DegreeNode(degree)).toTex()}
|
|
18
|
+
$$
|
|
19
|
+
|
|
20
|
+
Arrondir le résultat au centième.`;
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
let ans;
|
|
24
|
+
const { degree, trigoFunct } = identifiers;
|
|
25
|
+
switch (trigoFunct) {
|
|
26
|
+
case "cos":
|
|
27
|
+
const cos = new CosNode(degree.toTree());
|
|
28
|
+
ans = +cos.evaluate({}, { degreeMode: true }).toFixed(2);
|
|
29
|
+
return ans.toTree().toTex();
|
|
30
|
+
case "sin":
|
|
31
|
+
const sin = new SinNode(degree.toTree());
|
|
32
|
+
ans = +sin.evaluate({}, { degreeMode: true }).toFixed(2);
|
|
33
|
+
return ans.toTree().toTex();
|
|
34
|
+
case "tan":
|
|
35
|
+
const tan = new TanNode(degree.toTree());
|
|
36
|
+
ans = +tan.evaluate({}, { degreeMode: true }).toFixed(2);
|
|
37
|
+
return ans.toTree().toTex();
|
|
38
|
+
default:
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
11
42
|
const getCalculateCosSinAndTanQuestion = () => {
|
|
43
|
+
const trigo = ["sin", "tan", "cos"];
|
|
12
44
|
const trigoFunct = random(trigo);
|
|
13
45
|
const degree = randint(1, 180);
|
|
46
|
+
const identifiers = { degree, trigoFunct };
|
|
14
47
|
const question = {
|
|
15
|
-
answer:
|
|
16
|
-
instruction:
|
|
48
|
+
answer: getAnswer(identifiers),
|
|
49
|
+
instruction: getInstruction(identifiers),
|
|
17
50
|
keys: [],
|
|
18
51
|
answerFormat: "tex",
|
|
19
|
-
identifiers
|
|
52
|
+
identifiers,
|
|
20
53
|
};
|
|
21
54
|
return question;
|
|
22
55
|
};
|
|
@@ -32,33 +65,12 @@ const getPropositions = (n, { answer, degree }) => {
|
|
|
32
65
|
return shuffleProps(propositions, n);
|
|
33
66
|
};
|
|
34
67
|
const isAnswerValid = (ans, { answer }) => {
|
|
35
|
-
return ans
|
|
36
|
-
};
|
|
37
|
-
const getCorrectAnswer = (degree, trigoFunct) => {
|
|
38
|
-
let ans;
|
|
39
|
-
switch (trigoFunct) {
|
|
40
|
-
case "cos":
|
|
41
|
-
const cos = new CosNode(degree.toTree());
|
|
42
|
-
ans = +cos.evaluate({}).toFixed(2);
|
|
43
|
-
return ans.toTree().toTex();
|
|
44
|
-
case "sin":
|
|
45
|
-
const sin = new SinNode(degree.toTree());
|
|
46
|
-
ans = +sin.evaluate({}).toFixed(2);
|
|
47
|
-
return ans.toTree().toTex();
|
|
48
|
-
case "tan":
|
|
49
|
-
const tan = new TanNode(degree.toTree());
|
|
50
|
-
ans = +tan.evaluate({}).toFixed(2);
|
|
51
|
-
return ans.toTree().toTex();
|
|
52
|
-
default:
|
|
53
|
-
return "";
|
|
54
|
-
}
|
|
68
|
+
return numberVEA(ans, answer);
|
|
55
69
|
};
|
|
56
70
|
export const calculateCosSinAndTan = {
|
|
57
71
|
id: "calculateCosSinAndTan",
|
|
58
72
|
label: "Calculer le cosinus/sinus/tangente d'un angle en degrés",
|
|
59
|
-
levels: ["3ème"],
|
|
60
73
|
isSingleStep: true,
|
|
61
|
-
sections: ["Trigonométrie"],
|
|
62
74
|
generator: (nb) => getDistinctQuestions(getCalculateCosSinAndTanQuestion, nb),
|
|
63
75
|
qcmTimer: 60,
|
|
64
76
|
freeTimer: 60,
|
|
@@ -25,6 +25,8 @@ export declare class GeogebraConstructor {
|
|
|
25
25
|
lockedAxesRatio?: number | false;
|
|
26
26
|
xAxis?: GeogebraAxisOptions;
|
|
27
27
|
yAxis?: GeogebraAxisOptions;
|
|
28
|
+
zAxis?: GeogebraAxisOptions;
|
|
29
|
+
viewDirectionVector?: number[];
|
|
28
30
|
constructor(options: Omit<GeogebraOptions, "coords">);
|
|
29
31
|
getCoordsForPoints(points: Point[]): number[];
|
|
30
32
|
getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }: GetAdaptedCoords): number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geogebraConstructor.d.ts","sourceRoot":"","sources":["../../src/geogebra/geogebraConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,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;
|
|
1
|
+
{"version":3,"file":"geogebraConstructor.d.ts","sourceRoot":"","sources":["../../src/geogebra/geog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,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,aAAa,GACd,EAAE,gBAAgB;IAiDnB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,eAAe;CAmBzD"}
|
|
@@ -12,6 +12,8 @@ export class GeogebraConstructor {
|
|
|
12
12
|
lockedAxesRatio;
|
|
13
13
|
xAxis;
|
|
14
14
|
yAxis;
|
|
15
|
+
zAxis;
|
|
16
|
+
viewDirectionVector;
|
|
15
17
|
constructor(options) {
|
|
16
18
|
this.customToolBar = options?.customToolBar ?? toolBarConstructor({});
|
|
17
19
|
this.forbidShiftDragZoom = options?.forbidShiftDragZoom ?? false;
|
|
@@ -25,6 +27,8 @@ export class GeogebraConstructor {
|
|
|
25
27
|
this.lockedAxesRatio = options?.lockedAxesRatio ?? 1;
|
|
26
28
|
this.xAxis = options?.xAxis;
|
|
27
29
|
this.yAxis = options?.yAxis;
|
|
30
|
+
this.zAxis = options?.zAxis;
|
|
31
|
+
this.viewDirectionVector = options?.viewDirectionVector;
|
|
28
32
|
}
|
|
29
33
|
getCoordsForPoints(points) {
|
|
30
34
|
const xMin = Math.min(...points.map((p) => p.x.evaluate()));
|
|
@@ -97,6 +101,8 @@ export class GeogebraConstructor {
|
|
|
97
101
|
lockedAxesRatio: this.lockedAxesRatio,
|
|
98
102
|
xAxis: this.xAxis,
|
|
99
103
|
yAxis: this.yAxis,
|
|
104
|
+
zAxis: this.zAxis,
|
|
105
|
+
viewDirectionVector: this.viewDirectionVector,
|
|
100
106
|
};
|
|
101
107
|
}
|
|
102
108
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1725,6 +1725,12 @@ declare const mathExercises: (Exercise<{
|
|
|
1725
1725
|
y: number;
|
|
1726
1726
|
z: number;
|
|
1727
1727
|
}, {}> | Exercise<{}, {}> | Exercise<{}, {}> | Exercise<{
|
|
1728
|
+
l: number;
|
|
1729
|
+
L: number;
|
|
1730
|
+
h: number;
|
|
1731
|
+
askedPoint: string;
|
|
1732
|
+
givenPoints: string[];
|
|
1733
|
+
}, {}> | Exercise<{
|
|
1728
1734
|
sqrtOperand: number;
|
|
1729
1735
|
}, {}> | Exercise<{
|
|
1730
1736
|
k: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BCommandsProps } from "../../exercises/utils/geogebra/toGGBCommandsProps.js";
|
|
2
3
|
type AleaBound = {
|
|
3
4
|
min?: number;
|
|
4
5
|
max?: number;
|
|
@@ -24,7 +25,7 @@ export declare class SpacePoint {
|
|
|
24
25
|
distanceTo(B: SpacePoint): number;
|
|
25
26
|
equals(B: SpacePoint): boolean;
|
|
26
27
|
isAligned(B: SpacePoint, C: SpacePoint): void;
|
|
27
|
-
toGGBCommand(): string;
|
|
28
|
+
toGGBCommand({ isFixed, showLabel, style, size, color, }?: ToGGBCommandsProps): string[];
|
|
28
29
|
}
|
|
29
30
|
export {};
|
|
30
31
|
//# sourceMappingURL=spacePoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacePoint.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spacePoint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"spacePoint.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spacePoint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAE1F,KAAK,SAAS,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AACrE,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,SAAS,GAChB,UAAU;IAyBb,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IA4BtC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,MAAY;CAWrD;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBAEf,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa;IAQlB,SAAS;IAGT,kBAAkB;IAIlB,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAKzB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,SAAM,GAAG,UAAU;IAkB/C,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM;IAIjC,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU;IAOtC,YAAY,CAAC,EACX,OAAc,EACd,SAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,GACN,GAAE,kBAAuB;CAmB3B"}
|
|
@@ -85,7 +85,21 @@ export class SpacePoint {
|
|
|
85
85
|
// return AB.isColinear(AC);
|
|
86
86
|
throw Error("unimplemented");
|
|
87
87
|
}
|
|
88
|
-
toGGBCommand() {
|
|
89
|
-
|
|
88
|
+
toGGBCommand({ isFixed = true, showLabel = true, style, size, color, } = {}) {
|
|
89
|
+
const commands = [
|
|
90
|
+
`${this.name} = (${this.x.toMathString()}, ${this.y.toMathString()}, ${this.z.toMathString()})`,
|
|
91
|
+
`SetFixed(${this.name},${isFixed ? "true" : "false"})`,
|
|
92
|
+
`ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
|
|
93
|
+
];
|
|
94
|
+
if (style !== undefined) {
|
|
95
|
+
commands.push(`SetPointStyle(${this.name}, ${style})`);
|
|
96
|
+
}
|
|
97
|
+
if (size) {
|
|
98
|
+
commands.push(`SetPointSize(${this.name}, ${size})`);
|
|
99
|
+
}
|
|
100
|
+
if (color) {
|
|
101
|
+
commands.push(`SetColor(${this.name}, "${color}")`);
|
|
102
|
+
}
|
|
103
|
+
return commands;
|
|
90
104
|
}
|
|
91
105
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prism.d.ts","sourceRoot":"","sources":["../../../src/math/spaceGeometry/prism.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;;CAEjB"}
|
|
@@ -12,8 +12,11 @@ export type SimplifyOptions = {
|
|
|
12
12
|
forbidAdditions?: boolean;
|
|
13
13
|
forbidTrigo?: boolean;
|
|
14
14
|
};
|
|
15
|
+
export type EvaluateOptions = {
|
|
16
|
+
degreeMode?: boolean;
|
|
17
|
+
};
|
|
15
18
|
export interface AlgebraicNode extends Node {
|
|
16
|
-
evaluate: (vars?: Record<string, number
|
|
19
|
+
evaluate: (vars?: Record<string, number>, opts?: EvaluateOptions) => number;
|
|
17
20
|
toDetailedEvaluation: (vars: Record<string, AlgebraicNode>) => AlgebraicNode;
|
|
18
21
|
toEquivalentNodes: (opts?: NodeOptions) => AlgebraicNode[];
|
|
19
22
|
simplify: (opts?: SimplifyOptions) => AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,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,aAAa,CAAC;IAC7E,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,aAAa,EAAE,CAAC;IAC3D,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,aAAa,CAAC;IACpD,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;CACjD;AACD,8BAAsB,cAAc;;IAElC,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB;AACD,eAAO,MAAM,eAAe,SAAU,IAAI,KAAG,IAAI,IAAI,aACX,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeType } from "../node.js";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
|
-
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
|
+
import { AlgebraicNode, EvaluateOptions, SimplifyOptions } from "../algebraicNode.js";
|
|
4
4
|
export declare function isCosNode(a: Node): a is CosNode;
|
|
5
5
|
export declare const cos: (a: AlgebraicNode | number | string) => CosNode;
|
|
6
6
|
export declare class CosNode implements FunctionNode {
|
|
@@ -20,7 +20,7 @@ export declare class CosNode implements FunctionNode {
|
|
|
20
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
21
21
|
toAllValidTexs(): string[];
|
|
22
22
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
23
|
-
evaluate(vars?: Record<string, number
|
|
23
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): CosNode;
|
|
26
26
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"cosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/cosNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAI7B,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,eAAO,MAAM,GAAG,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,YAIrD,CAAC;AAEF,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,KAAK,EAAE,aAAa;IAMhC,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,aAAa;IAyBnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,eAAe;IAO9D,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -68,7 +68,10 @@ export class CosNode {
|
|
|
68
68
|
}
|
|
69
69
|
return new CosNode(simplifiedChild);
|
|
70
70
|
}
|
|
71
|
-
evaluate(vars) {
|
|
71
|
+
evaluate(vars, opts) {
|
|
72
|
+
if (opts?.degreeMode) {
|
|
73
|
+
return Math.cos((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
74
|
+
}
|
|
72
75
|
return Math.cos(this.child.evaluate(vars));
|
|
73
76
|
}
|
|
74
77
|
equals(node) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeType } from "../node.js";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
|
-
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
|
+
import { AlgebraicNode, EvaluateOptions, SimplifyOptions } from "../algebraicNode.js";
|
|
4
4
|
export declare function isSinNode(a: Node): a is SinNode;
|
|
5
5
|
export declare const sin: (a: AlgebraicNode | number | string) => SinNode;
|
|
6
6
|
export declare class SinNode implements FunctionNode {
|
|
@@ -20,7 +20,7 @@ export declare class SinNode implements FunctionNode {
|
|
|
20
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
21
21
|
toAllValidTexs(): string[];
|
|
22
22
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
23
|
-
evaluate(vars?: Record<string, number
|
|
23
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): SinNode;
|
|
26
26
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts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CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -70,7 +70,10 @@ export class SinNode {
|
|
|
70
70
|
}
|
|
71
71
|
return new SinNode(simplifiedChild);
|
|
72
72
|
}
|
|
73
|
-
evaluate(vars) {
|
|
73
|
+
evaluate(vars, opts) {
|
|
74
|
+
if (opts?.degreeMode) {
|
|
75
|
+
return Math.sin((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
76
|
+
}
|
|
74
77
|
return Math.sin(this.child.evaluate(vars));
|
|
75
78
|
}
|
|
76
79
|
equals(node) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeType } from "../node.js";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode.js";
|
|
3
|
-
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
|
+
import { AlgebraicNode, EvaluateOptions, SimplifyOptions } from "../algebraicNode.js";
|
|
4
4
|
export declare const tan: (a: AlgebraicNode | number | string) => TanNode;
|
|
5
5
|
export declare function isTanNode(a: Node): a is TanNode;
|
|
6
6
|
export declare class TanNode implements FunctionNode {
|
|
@@ -20,7 +20,7 @@ export declare class TanNode implements FunctionNode {
|
|
|
20
20
|
toEquivalentNodes(): AlgebraicNode[];
|
|
21
21
|
toAllValidTexs(): string[];
|
|
22
22
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
23
|
-
evaluate(vars?: Record<string, number
|
|
23
|
+
evaluate(vars?: Record<string, number>, opts?: EvaluateOptions): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): TanNode;
|
|
26
26
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/tanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EA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CAGxD"}
|
|
@@ -65,7 +65,10 @@ export class TanNode {
|
|
|
65
65
|
}
|
|
66
66
|
return new TanNode(simplifiedChild);
|
|
67
67
|
}
|
|
68
|
-
evaluate(vars) {
|
|
68
|
+
evaluate(vars, opts) {
|
|
69
|
+
if (opts?.degreeMode) {
|
|
70
|
+
return Math.tan((this.child.evaluate(vars, opts) * Math.PI) / 180);
|
|
71
|
+
}
|
|
69
72
|
return Math.tan(this.child.evaluate(vars));
|
|
70
73
|
}
|
|
71
74
|
equals(node) {
|