math-exercises 2.2.67 → 2.2.68
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/fractions/fractionsOperations.d.ts +8 -0
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +85 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +11 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +9 -16
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -4
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts +1 -0
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +7 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +3 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +3 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +3 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +2 -0
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +9 -1
- package/lib/tree/nodes/functions/expNode.d.ts +2 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +10 -1
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +3 -0
- package/lib/tree/nodes/functions/logNode.d.ts +1 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +3 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +3 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +11 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +3 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +2 -0
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +9 -1
- package/lib/tree/nodes/geometry/degree.d.ts +1 -0
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +3 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.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/constantNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +10 -1
- package/lib/tree/nodes/numbers/infiniteNode.d.ts +0 -2
- package/lib/tree/nodes/numbers/infiniteNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/infiniteNode.js +1 -6
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +3 -0
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +3 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +1 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +3 -0
- package/lib/tree/nodes/operators/divideNode.d.ts +4 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +17 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +3 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +3 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +10 -2
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +6 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +4 -2
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +9 -2
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +8 -8
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
statementIdentifiers: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const fractionsOperations: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=fractionsOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA6EF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fractionsOperations = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
8
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
10
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
11
|
+
const divideNode_1 = require("../../../../tree/nodes/operators/divideNode");
|
|
12
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
13
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
14
|
+
const getPropositions = (n, { answer }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
17
|
+
while (propositions.length < n) {
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, rational_1.RationalConstructor.randomIrreductible(100).toTree().toTex());
|
|
19
|
+
}
|
|
20
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const statement = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers);
|
|
24
|
+
return statement.simplify().toTex();
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
const statement = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers);
|
|
28
|
+
return `Calculer :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
${statement.toTex({ forceTimesSign: true })}
|
|
32
|
+
$$`;
|
|
33
|
+
};
|
|
34
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
35
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
36
|
+
const getKeys = (identifiers) => {
|
|
37
|
+
return [];
|
|
38
|
+
};
|
|
39
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
40
|
+
return (0, rationalVEA_1.rationalVEA)(ans, answer);
|
|
41
|
+
};
|
|
42
|
+
const getFractionsOperationsQuestion = (ops) => {
|
|
43
|
+
const operations = [addNode_1.add, substractNode_1.substract, multiplyNode_1.multiply, divideNode_1.divide];
|
|
44
|
+
const firstOpIndex = (0, randint_1.randint)(0, operations.length);
|
|
45
|
+
const secondOpIndex = (0, randint_1.randint)(0, operations.length, [firstOpIndex]);
|
|
46
|
+
const firstOp = operations[firstOpIndex];
|
|
47
|
+
const secondOp = operations[secondOpIndex];
|
|
48
|
+
const rationals = [
|
|
49
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
50
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
51
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
52
|
+
];
|
|
53
|
+
const statement = firstOp(secondOp(rationals[0], rationals[1]), rationals[2]);
|
|
54
|
+
statement.shuffle();
|
|
55
|
+
const ids = statement.toIdentifiers();
|
|
56
|
+
const identifiers = {
|
|
57
|
+
statementIdentifiers: ids,
|
|
58
|
+
};
|
|
59
|
+
const question = {
|
|
60
|
+
answer: getAnswer(identifiers),
|
|
61
|
+
instruction: getInstruction(identifiers),
|
|
62
|
+
keys: getKeys(identifiers),
|
|
63
|
+
answerFormat: "tex",
|
|
64
|
+
identifiers,
|
|
65
|
+
// hint: getHint(identifiers),
|
|
66
|
+
// correction: getCorrection(identifiers),
|
|
67
|
+
};
|
|
68
|
+
return question;
|
|
69
|
+
};
|
|
70
|
+
exports.fractionsOperations = {
|
|
71
|
+
id: "fractionsOperations",
|
|
72
|
+
connector: "=",
|
|
73
|
+
label: "Calculs avec des fractions : mélange d'opérations",
|
|
74
|
+
isSingleStep: true,
|
|
75
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsOperationsQuestion(opts), nb),
|
|
76
|
+
qcmTimer: 60,
|
|
77
|
+
freeTimer: 60,
|
|
78
|
+
getPropositions,
|
|
79
|
+
isAnswerValid,
|
|
80
|
+
subject: "Mathématiques",
|
|
81
|
+
getInstruction,
|
|
82
|
+
// getHint,
|
|
83
|
+
// getCorrection,
|
|
84
|
+
getAnswer,
|
|
85
|
+
};
|
|
@@ -10,4 +10,5 @@ export * from "./periodicWritingToFraction";
|
|
|
10
10
|
export * from "./fractionsSumsSameDenominators";
|
|
11
11
|
export * from "./fractionsSumsMultiplesDenominators";
|
|
12
12
|
export * from "./fractionsSumsPrimeDenominators";
|
|
13
|
+
export * from "./fractionsOperations";
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
|
@@ -26,3 +26,4 @@ __exportStar(require("./periodicWritingToFraction"), exports);
|
|
|
26
26
|
__exportStar(require("./fractionsSumsSameDenominators"), exports);
|
|
27
27
|
__exportStar(require("./fractionsSumsMultiplesDenominators"), exports);
|
|
28
28
|
__exportStar(require("./fractionsSumsPrimeDenominators"), exports);
|
|
29
|
+
__exportStar(require("./fractionsOperations"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2EF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -11,6 +11,16 @@ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
|
11
11
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
12
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
13
13
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
14
|
+
const getStatementNode = (identifiers) => {
|
|
15
|
+
return (0, multiplyNode_1.multiply)(identifiers.a, (0, sqrtNode_1.sqrt)("x"));
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
19
|
+
|
|
20
|
+
$$
|
|
21
|
+
f(x) = ${getStatementNode(identifiers).toTex()}
|
|
22
|
+
$$ `;
|
|
23
|
+
};
|
|
14
24
|
const getRootFunctionDerivative = () => {
|
|
15
25
|
const a = (0, randint_1.randint)(-19, 20, [0]);
|
|
16
26
|
let instruction = `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =$ `;
|
|
@@ -65,7 +75,7 @@ const isAnswerValid = (ans, { a }) => {
|
|
|
65
75
|
exports.rootFunctionDerivative = {
|
|
66
76
|
id: "rootFunctionDerivative",
|
|
67
77
|
connector: "=",
|
|
68
|
-
label: "Dérivée d'une fonction racine",
|
|
78
|
+
label: "Dérivée d'une fonction racine carrée",
|
|
69
79
|
levels: ["1reESM", "1reSpé", "1reTech", "MathComp"],
|
|
70
80
|
sections: ["Dérivation", "Racines carrées"],
|
|
71
81
|
isSingleStep: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -3,36 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.leadingCoefficient = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
6
7
|
const colors_1 = require("../../../../geogebra/colors");
|
|
7
8
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
8
|
-
const integer_1 = require("../../../../math/numbers/integer/integer");
|
|
9
9
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
10
10
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
11
11
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
12
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
12
13
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
13
14
|
const getLeadingCoefficientQuestion = () => {
|
|
14
15
|
let xA, yA, xB, yB;
|
|
15
16
|
[xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-5, 6));
|
|
16
17
|
xB = xA > 0 ? (0, randint_1.randint)(xA - 4, 6, [xA]) : (0, randint_1.randint)(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
|
|
17
18
|
yB = yA > 0 ? (0, randint_1.randint)(yA - 4, 6) : (0, randint_1.randint)(-4, yA + 5);
|
|
18
|
-
const a =
|
|
19
|
-
const
|
|
20
|
-
const aTree = a.toTree();
|
|
21
|
-
const bTree = b.toTree();
|
|
22
|
-
const aString = aTree.toMathString();
|
|
23
|
-
const bString = bTree.toMathString();
|
|
19
|
+
const a = (0, fractionNode_1.frac)(yB - yA, xB - xA).simplify();
|
|
20
|
+
const answer = a.toTex();
|
|
24
21
|
const xMin = Math.min(xA, xB);
|
|
25
22
|
const xMax = Math.max(xA, xB);
|
|
26
23
|
const yMin = Math.min(yA, yB);
|
|
27
24
|
const yMax = Math.max(yA, yB);
|
|
28
25
|
const commands = [
|
|
29
|
-
`
|
|
30
|
-
|
|
26
|
+
`L = Line((${xA}, ${yA}), (${xB}, ${yB}))`,
|
|
27
|
+
"SetFixed(L, true)",
|
|
28
|
+
`SetColor(L, "${(0, colors_1.randomColor)()}")`,
|
|
31
29
|
];
|
|
32
30
|
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
33
31
|
commands,
|
|
34
32
|
});
|
|
35
|
-
const answer = aTree.toTex();
|
|
36
33
|
const question = {
|
|
37
34
|
instruction: "Déterminer le coefficient directeur de la droite représentée ci-dessous : ",
|
|
38
35
|
answer,
|
|
@@ -56,12 +53,8 @@ const getPropositions = (n, { answer, xA, xB, yA, yB }) => {
|
|
|
56
53
|
}
|
|
57
54
|
return (0, shuffle_1.shuffle)(propositions);
|
|
58
55
|
};
|
|
59
|
-
const isAnswerValid = (ans, { xA, xB, yA, yB }) => {
|
|
60
|
-
|
|
61
|
-
.simplify()
|
|
62
|
-
.toTree({ allowFractionToDecimal: true });
|
|
63
|
-
const texs = leadingCoeff.toAllValidTexs();
|
|
64
|
-
return texs.includes(ans);
|
|
56
|
+
const isAnswerValid = (ans, { answer, xA, xB, yA, yB }) => {
|
|
57
|
+
return (0, rationalVEA_1.rationalVEA)(ans, answer);
|
|
65
58
|
};
|
|
66
59
|
exports.leadingCoefficient = {
|
|
67
60
|
id: "leadingCoefficient",
|
|
@@ -55,7 +55,7 @@ const isGGBAnswerValid = (ans, { ggbAnswer, absciss, abscissTex, abscissType, ax
|
|
|
55
55
|
const points = (0, parseGGBPoints_1.parseGGBPoints)(ans).map((p) => (0, ggbPointToCoords_1.ggbPointToCoords)(p));
|
|
56
56
|
return (points.length === 1 &&
|
|
57
57
|
points[0].y === 0 &&
|
|
58
|
-
Math.abs(points[0].x - coeff) < 0.
|
|
58
|
+
Math.abs(points[0].x - coeff) < 0.2);
|
|
59
59
|
};
|
|
60
60
|
const getPlaceAbscissOnLineQuestion = () => {
|
|
61
61
|
const abscissType = (0, random_1.random)([
|
package/lib/index.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ declare const mathExercises: (Exercise<{
|
|
|
78
78
|
num2: number;
|
|
79
79
|
denom1: number;
|
|
80
80
|
denom2: number;
|
|
81
|
+
}, {}> | Exercise<{
|
|
82
|
+
statementIdentifiers: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
|
|
81
83
|
}, {}> | Exercise<{
|
|
82
84
|
numbers: number[];
|
|
83
85
|
}, {}> | Exercise<{
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
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":"AA8CA,eAAO,MAAM,UAAU,YAAW,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.playground = void 0;
|
|
4
4
|
const nodeConstructor_1 = require("./tree/nodes/nodeConstructor");
|
|
5
|
-
const
|
|
6
|
-
const playground = () => {
|
|
7
|
-
console.log((0, affineParser_1.affineParser)("8"));
|
|
8
|
-
};
|
|
5
|
+
const playground = () => { };
|
|
9
6
|
exports.playground = playground;
|
|
10
7
|
const logIdentifiers = () => {
|
|
11
8
|
const ids = '{"xA":-3,"yA":-2,"yPrimeA":{"id":31,"child":{"id":3,"leftChild":{"id":7,"value":3},"rightChild":{"id":7,"value":2}}},"trinomCoeffs":[0.3888888888888889,0.833333333333333,-3]}';
|
|
@@ -14,6 +14,7 @@ export interface AlgebraicNode extends Node {
|
|
|
14
14
|
simplify: (opts?: SimplifyOptions) => AlgebraicNode;
|
|
15
15
|
equals: (node: AlgebraicNode) => boolean;
|
|
16
16
|
isNumeric: boolean;
|
|
17
|
+
derivative: (varName?: string) => AlgebraicNode;
|
|
17
18
|
}
|
|
18
19
|
export declare const isAlgebraicNode: (node: Node) => node is AlgebraicNode;
|
|
19
20
|
//# sourceMappingURL=algebraicNode.d.ts.map
|
|
@@ -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,QAAQ,CAAC;AAE3C,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;CAC7B,CAAC;AACF,MAAM,WAAW,aAAc,SAAQ,IAAI;IACzC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;IACpD,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,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;
|
|
1
|
+
{"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE3C,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;CAC7B,CAAC;AACF,MAAM,WAAW,aAAc,SAAQ,IAAI;IACzC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;IACpD,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,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;AAED,eAAO,MAAM,eAAe,SAAU,IAAI,0BACA,CAAC"}
|
|
@@ -22,5 +22,6 @@ export declare class AbsNode implements FunctionNode {
|
|
|
22
22
|
evaluate(vars?: Record<string, number>): number;
|
|
23
23
|
equals(node: AlgebraicNode): boolean;
|
|
24
24
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AbsNode;
|
|
25
|
+
derivative(varName?: string | undefined): import("../operators/multiplyNode").MultiplyNode;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=absNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/absNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"absNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/absNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa;IAMhC,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAOf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ;IAUR,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,MAAM,CAAC,IAAI,EAAE,aAAa;IAI1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAKxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;CAIxC"}
|
|
@@ -6,6 +6,8 @@ const node_1 = require("../node");
|
|
|
6
6
|
const functionNode_1 = require("./functionNode");
|
|
7
7
|
const numberNode_1 = require("../numbers/numberNode");
|
|
8
8
|
const oppositeNode_1 = require("./oppositeNode");
|
|
9
|
+
const fractionNode_1 = require("../operators/fractionNode");
|
|
10
|
+
const multiplyNode_1 = require("../operators/multiplyNode");
|
|
9
11
|
function isAbsNode(a) {
|
|
10
12
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.abs;
|
|
11
13
|
}
|
|
@@ -61,5 +63,10 @@ class AbsNode {
|
|
|
61
63
|
toDetailedEvaluation(vars) {
|
|
62
64
|
return new AbsNode(this.child.toDetailedEvaluation(vars));
|
|
63
65
|
}
|
|
66
|
+
//|u|' = (u/|u|)*u'
|
|
67
|
+
derivative(varName) {
|
|
68
|
+
const variable = varName ?? "x";
|
|
69
|
+
return (0, multiplyNode_1.multiply)((0, fractionNode_1.frac)(this.child, this), this.child.derivative(variable));
|
|
70
|
+
}
|
|
64
71
|
}
|
|
65
72
|
exports.AbsNode = AbsNode;
|
|
@@ -22,5 +22,6 @@ export declare class ArcsinNode implements FunctionNode {
|
|
|
22
22
|
evaluate(vars?: Record<string, number>): number;
|
|
23
23
|
equals(node: AlgebraicNode): boolean;
|
|
24
24
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): ArcsinNode;
|
|
25
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=arcSinNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcSinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arcSinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OA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E,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,IAAI,aAAa;IAiBzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAIxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -22,5 +22,6 @@ export declare class ArccosNode implements FunctionNode {
|
|
|
22
22
|
evaluate(vars?: Record<string, number>): number;
|
|
23
23
|
equals(node: AlgebraicNode): boolean;
|
|
24
24
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): ArccosNode;
|
|
25
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=arccosNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arccosNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arccosNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,YAAY;IAC7C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAA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M,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAIxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -22,5 +22,6 @@ export declare class ArctanNode implements FunctionNode {
|
|
|
22
22
|
evaluate(vars?: Record<string, number>): number;
|
|
23
23
|
equals(node: AlgebraicNode): boolean;
|
|
24
24
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): ArctanNode;
|
|
25
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=arctanNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arctanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arctanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,YAAY;IAC7C,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,IAAI,aAAa;IAkBzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"arctanNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/arctanNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,qBAAa,UAAW,YAAW,YAAY;IAC7C,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,IAAI,aAAa;IAkBzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAItC,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"}
|
|
@@ -2,6 +2,7 @@ import { Node, NodeIds, NodeType } from "../node";
|
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isCosNode(a: Node): a is CosNode;
|
|
5
|
+
export declare const cos: (a: AlgebraicNode | number | string) => CosNode;
|
|
5
6
|
export declare class CosNode implements FunctionNode {
|
|
6
7
|
id: FunctionsIds;
|
|
7
8
|
child: AlgebraicNode;
|
|
@@ -22,5 +23,6 @@ export declare class CosNode implements FunctionNode {
|
|
|
22
23
|
evaluate(vars?: Record<string, number>): number;
|
|
23
24
|
equals(node: AlgebraicNode): boolean;
|
|
24
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): CosNode;
|
|
26
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=cosNode.d.ts.map
|
|
@@ -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,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIlE,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,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;IAsBnD,QAAQ,C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,GAAG,aAAa;CAGxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CosNode = exports.isCosNode = void 0;
|
|
3
|
+
exports.CosNode = exports.cos = exports.isCosNode = void 0;
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const functionNode_1 = require("./functionNode");
|
|
6
6
|
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
@@ -9,6 +9,11 @@ function isCosNode(a) {
|
|
|
9
9
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.cos;
|
|
10
10
|
}
|
|
11
11
|
exports.isCosNode = isCosNode;
|
|
12
|
+
const cos = (a) => {
|
|
13
|
+
const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
|
|
14
|
+
return new CosNode(nodeA);
|
|
15
|
+
};
|
|
16
|
+
exports.cos = cos;
|
|
12
17
|
class CosNode {
|
|
13
18
|
constructor(child) {
|
|
14
19
|
this.id = functionNode_1.FunctionsIds.cos;
|
|
@@ -70,5 +75,8 @@ class CosNode {
|
|
|
70
75
|
toDetailedEvaluation(vars) {
|
|
71
76
|
return new CosNode(this.child.toDetailedEvaluation(vars));
|
|
72
77
|
}
|
|
78
|
+
derivative(varName) {
|
|
79
|
+
throw new Error("unimplemented derivative");
|
|
80
|
+
}
|
|
73
81
|
}
|
|
74
82
|
exports.CosNode = CosNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
|
+
export declare const exp: (a: AlgebraicNode | number | string) => ExpNode;
|
|
4
5
|
export declare function isExpNode(a: Node): a is ExpNode;
|
|
5
6
|
export declare class ExpNode implements FunctionNode {
|
|
6
7
|
opts?: NodeOptions;
|
|
@@ -23,5 +24,6 @@ export declare class ExpNode implements FunctionNode {
|
|
|
23
24
|
evaluate(vars?: Record<string, number>): number;
|
|
24
25
|
equals(node: AlgebraicNode): boolean;
|
|
25
26
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): ExpNode;
|
|
27
|
+
derivative(varName?: string | undefined): import("../operators/multiplyNode").MultiplyNode;
|
|
26
28
|
}
|
|
27
29
|
//# sourceMappingURL=expNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,eAAO,MAAM,GAAG,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,YAIrD,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAmBf,iBAAiB,IAAI,aAAa,EAAE;IAUpC,cAAc,IAAI,MAAM,EAAE;IAI1B,QAAQ,IAAI,aAAa;IAOzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,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;CAGxC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExpNode = exports.isExpNode = void 0;
|
|
3
|
+
exports.ExpNode = exports.isExpNode = exports.exp = void 0;
|
|
4
4
|
// import { exp } from "mathjs";
|
|
5
5
|
const node_1 = require("../node");
|
|
6
6
|
const functionNode_1 = require("./functionNode");
|
|
7
7
|
const numberNode_1 = require("../numbers/numberNode");
|
|
8
8
|
const logNode_1 = require("./logNode");
|
|
9
|
+
const multiplyNode_1 = require("../operators/multiplyNode");
|
|
10
|
+
const exp = (a) => {
|
|
11
|
+
const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
|
|
12
|
+
return new ExpNode(nodeA);
|
|
13
|
+
};
|
|
14
|
+
exports.exp = exp;
|
|
9
15
|
function isExpNode(a) {
|
|
10
16
|
return (0, functionNode_1.isFunctionNode)(a) && a.id === functionNode_1.FunctionsIds.exp;
|
|
11
17
|
}
|
|
@@ -75,5 +81,8 @@ class ExpNode {
|
|
|
75
81
|
toDetailedEvaluation(vars) {
|
|
76
82
|
return new ExpNode(this.child.toDetailedEvaluation(vars));
|
|
77
83
|
}
|
|
84
|
+
derivative(varName) {
|
|
85
|
+
return (0, multiplyNode_1.multiply)(this.child.derivative(varName), this);
|
|
86
|
+
}
|
|
78
87
|
}
|
|
79
88
|
exports.ExpNode = ExpNode;
|
|
@@ -23,5 +23,6 @@ export declare class Log10Node implements FunctionNode {
|
|
|
23
23
|
evaluate(vars?: Record<string, number>): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): Log10Node;
|
|
26
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
26
27
|
}
|
|
27
28
|
//# sourceMappingURL=log10Node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10Node.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/log10Node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,SAAS,CAEnD;AACD,qBAAa,SAAU,YAAW,YAAY;IAC5C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAgCzB,QAAQ,CAAC,IAAI,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@@ export declare class LogNode implements FunctionNode {
|
|
|
23
23
|
evaluate(vars?: Record<string, number>): number;
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): LogNode;
|
|
26
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
26
27
|
}
|
|
27
28
|
//# sourceMappingURL=logNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAmCzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AACD,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IASpC,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAmCzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,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"}
|
|
@@ -30,5 +30,6 @@ export declare class OppositeNode implements FunctionNode {
|
|
|
30
30
|
simplify(opts?: SimplifyOptions): AlgebraicNode | NumberNode;
|
|
31
31
|
equals(node: AlgebraicNode): boolean;
|
|
32
32
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): OppositeNode;
|
|
33
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
33
34
|
}
|
|
34
35
|
//# sourceMappingURL=oppositeNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oppositeNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/oppositeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAM/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AAED,eAAO,MAAM,QAAQ,MAAO,aAAa,GAAG,MAAM,GAAG,MAAM,iBAI1D,CAAC;AAGF,qBAAa,YAAa,YAAW,YAAY;IAC/C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAef,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAgCtD;;;;OAIG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAQ5C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAI/B,MAAM,CAAC,I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AO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAGxD"}
|
|
@@ -92,5 +92,8 @@ class OppositeNode {
|
|
|
92
92
|
toDetailedEvaluation(vars) {
|
|
93
93
|
return new OppositeNode(this.child.toDetailedEvaluation(vars));
|
|
94
94
|
}
|
|
95
|
+
derivative(varName) {
|
|
96
|
+
return (0, exports.opposite)(this.child.derivative(varName));
|
|
97
|
+
}
|
|
95
98
|
}
|
|
96
99
|
exports.OppositeNode = OppositeNode;
|
|
@@ -2,6 +2,7 @@ import { Node, NodeIds, NodeType } from "../node";
|
|
|
2
2
|
import { FunctionNode, FunctionsIds } from "./functionNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isSinNode(a: Node): a is SinNode;
|
|
5
|
+
export declare const sin: (a: AlgebraicNode | number | string) => SinNode;
|
|
5
6
|
export declare class SinNode implements FunctionNode {
|
|
6
7
|
id: FunctionsIds;
|
|
7
8
|
child: AlgebraicNode;
|
|
@@ -22,5 +23,6 @@ export declare class SinNode implements FunctionNode {
|
|
|
22
23
|
evaluate(vars?: Record<string, number>): number;
|
|
23
24
|
equals(node: AlgebraicNode): boolean;
|
|
24
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): SinNode;
|
|
26
|
+
derivative(varName?: string | undefined): AlgebraicNode;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=sinNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,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