math-exercises 1.3.36 → 1.3.38
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/derivation/derivativeNumberReading.d.ts +4 -0
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -0
- package/lib/exercises/derivation/derivativeNumberReading.js +51 -0
- package/lib/exercises/exercises.js +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficient.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS9D,eAAO,MAAM,uBAAuB,EAAE,QASrC,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,QAAQ,CAoCrD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDerivativeNumberReading = exports.derivativeNumberReading = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const droite_1 = require("../../math/geometry/droite");
|
|
6
|
+
const point_1 = require("../../math/geometry/point");
|
|
7
|
+
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
8
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
9
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const mathjs_1 = require("mathjs");
|
|
11
|
+
exports.derivativeNumberReading = {
|
|
12
|
+
id: 'derivativeNumberReading',
|
|
13
|
+
connector: '=',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: 'Lecture de nombre dérivé',
|
|
16
|
+
levels: ['3', '2', '1'],
|
|
17
|
+
isSingleStep: false,
|
|
18
|
+
section: 'Dérivation',
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDerivativeNumberReading, nb),
|
|
20
|
+
};
|
|
21
|
+
function getDerivativeNumberReading() {
|
|
22
|
+
let xA, yA, xB, yB;
|
|
23
|
+
let pointA, pointB;
|
|
24
|
+
do {
|
|
25
|
+
[xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-5, 6));
|
|
26
|
+
xB = xA > 0 ? (0, randint_1.randint)(xA - 4, 6) : (0, randint_1.randint)(-4, xA + 5); // l'écart entre les deux points ne soit pas grand
|
|
27
|
+
yB = yA > 0 ? (0, randint_1.randint)(yA - 4, 6) : (0, randint_1.randint)(-4, yA + 5);
|
|
28
|
+
pointA = new point_1.Point('A', new numberNode_1.NumberNode(xA), new numberNode_1.NumberNode(yA));
|
|
29
|
+
pointB = new point_1.Point('B', new numberNode_1.NumberNode(xB), new numberNode_1.NumberNode(yB));
|
|
30
|
+
} while (xB - xA === 0);
|
|
31
|
+
const droite = droite_1.DroiteConstructor.fromTwoPoints(pointA, pointB, 'D');
|
|
32
|
+
const [a, b] = [(3 * (0, randint_1.randint)(-100, 100, [0])) / 100, (2 * (0, randint_1.randint)(-4, 5)) / 100];
|
|
33
|
+
const c = (0, mathjs_1.evaluate)(droite.a.toMathString()) - a * Math.pow(xA, 2) - b * xA;
|
|
34
|
+
const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
|
|
35
|
+
const polynome = new polynomial_1.Polynomial([d, c, b / 2, a / 3]);
|
|
36
|
+
const instruction = `Ci-dessous sont tracées la courbe de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer le coefficient directeur de la tangente qui passe par ce point.`;
|
|
37
|
+
const commands = [
|
|
38
|
+
polynome.toString(),
|
|
39
|
+
`g(x) = (${droite.a.toMathString()}) * x + (${droite.b.toMathString()})`,
|
|
40
|
+
`(${xA},${yA})`,
|
|
41
|
+
];
|
|
42
|
+
const question = {
|
|
43
|
+
instruction,
|
|
44
|
+
startStatement: 'a',
|
|
45
|
+
answer: droite.getLeadingCoefficient(),
|
|
46
|
+
commands,
|
|
47
|
+
coords: [xA - 5, xA + 5, yA - 5, yA + 5],
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
}
|
|
51
|
+
exports.getDerivativeNumberReading = getDerivativeNumberReading;
|
|
@@ -51,7 +51,7 @@ const rootFunctionDerivative_1 = require("./derivation/derivative/rootFunctionDe
|
|
|
51
51
|
const secondDegreeDerivative_1 = require("./derivation/derivative/secondDegreeDerivative");
|
|
52
52
|
const thirdDegreeDerivative_1 = require("./derivation/derivative/thirdDegreeDerivative");
|
|
53
53
|
const usualderivative_1 = require("./derivation/derivative/usualderivative");
|
|
54
|
-
const derivativeNumberReading_1 = require("./
|
|
54
|
+
const derivativeNumberReading_1 = require("./derivation/derivativeNumberReading");
|
|
55
55
|
const leadingCoefficient_1 = require("./geometry/cartesian/leadingCoefficient");
|
|
56
56
|
const leadingCoefficientCalculV1_1 = require("./geometry/cartesian/leadingCoefficientCalculV1");
|
|
57
57
|
const leadingCoefficientCalculV2_1 = require("./geometry/cartesian/leadingCoefficientCalculV2");
|
|
@@ -14,7 +14,7 @@ exports.leadingCoefficient = {
|
|
|
14
14
|
label: 'Déterminer le coefficient directeur',
|
|
15
15
|
levels: ['3', '2', '1'],
|
|
16
16
|
isSingleStep: false,
|
|
17
|
-
section: '
|
|
17
|
+
section: 'Droites',
|
|
18
18
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientQuestion, nb),
|
|
19
19
|
};
|
|
20
20
|
function getLeadingCoefficientQuestion() {
|