math-exercises 2.2.70 → 2.2.71
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.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +6 -2
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts +12 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.js +128 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -0
- package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/index.js +17 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts +11 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +272 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +1 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +0 -1
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts +22 -1
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +138 -1
- package/lib/math/geometry/line.d.ts +2 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +16 -0
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -0
- package/lib/math/geometry/vector.d.ts +3 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +9 -0
- package/lib/math/polynomials/generalAffine.d.ts +3 -0
- package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
- package/lib/math/polynomials/generalAffine.js +4 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +4 -2
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +2 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +123 -90
- package/lib/tree/nodes/polynomials/monomNode.d.ts +47 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -0
- package/lib/tree/nodes/polynomials/monomNode.js +214 -0
- package/lib/tree/parsers/affineParser.js +1 -1
- package/lib/tree/parsers/monomParser.d.ts +2 -2
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +59 -6
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/trinomParser.js +1 -1
- package/package.json +1 -1
|
@@ -1 +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;
|
|
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;AAqFF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -20,7 +20,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
20
20
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
21
|
};
|
|
22
22
|
const getAnswer = (identifiers) => {
|
|
23
|
-
console.log(identifiers);
|
|
24
23
|
const statement = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers);
|
|
25
24
|
return statement.simplify().toTex();
|
|
26
25
|
};
|
|
@@ -52,7 +51,12 @@ const getFractionsOperationsQuestion = (ops) => {
|
|
|
52
51
|
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
53
52
|
];
|
|
54
53
|
const statement = firstOp(secondOp(rationals[0], rationals[1]), rationals[2]);
|
|
55
|
-
|
|
54
|
+
//éviter division par une soustraction qui donne 0
|
|
55
|
+
if (firstOpIndex !== 3 ||
|
|
56
|
+
secondOpIndex !== 1 ||
|
|
57
|
+
rationals[0].evaluate() - rationals[1].evaluate() !== 0) {
|
|
58
|
+
statement.shuffle();
|
|
59
|
+
}
|
|
56
60
|
const ids = statement.toIdentifiers();
|
|
57
61
|
const identifiers = {
|
|
58
62
|
statementIdentifiers: ids,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { GeneralAffineIdentifiers } from "../../../../math/polynomials/generalAffine";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
type: number;
|
|
5
|
+
affine1: GeneralAffineIdentifiers;
|
|
6
|
+
affine2: GeneralAffineIdentifiers;
|
|
7
|
+
affine3: GeneralAffineIdentifiers;
|
|
8
|
+
affine4?: GeneralAffineIdentifiers;
|
|
9
|
+
};
|
|
10
|
+
export declare const doubleDistributivitySubstract: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=doubleDistributivitySubstract.d.ts.map
|
package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doubleDistributivitySubstract.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAU9C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAiIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doubleDistributivitySubstract = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const generalAffine_1 = require("../../../../math/polynomials/generalAffine");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
13
|
+
//(ax+b)(cx+d)-ex(gx+h)
|
|
14
|
+
//(ax+b)(cx+d)-(ex+f)(gx+h)
|
|
15
|
+
//(ax+b)(cx+d)-(ex+-f)^2
|
|
16
|
+
const getPropositions = (n, { answer, affine1, affine2, affine3, type, affine4 }) => {
|
|
17
|
+
const propositions = [];
|
|
18
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
+
let affs = [
|
|
20
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine1),
|
|
21
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine2),
|
|
22
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine3),
|
|
23
|
+
].map((e) => e.toTree());
|
|
24
|
+
if (affine4) {
|
|
25
|
+
affs.push(generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine4).toTree());
|
|
26
|
+
}
|
|
27
|
+
if (type === 3)
|
|
28
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, addNode_1.add)((0, multiplyNode_1.multiply)(affs[0], affs[1]), (0, powerNode_1.square)(affs[2]))
|
|
29
|
+
.simplify({
|
|
30
|
+
forbidFactorize: true,
|
|
31
|
+
towardsDistribute: true,
|
|
32
|
+
})
|
|
33
|
+
.toTex());
|
|
34
|
+
else
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, addNode_1.add)((0, multiplyNode_1.multiply)(affs[0], affs[1]), (0, multiplyNode_1.multiply)(affs[2], affs[3]))
|
|
36
|
+
.simplify({
|
|
37
|
+
forbidFactorize: true,
|
|
38
|
+
towardsDistribute: true,
|
|
39
|
+
})
|
|
40
|
+
.toTex());
|
|
41
|
+
while (propositions.length < n) {
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, trinomNode_1.TrinomNodeConstructor.random().toTex());
|
|
43
|
+
}
|
|
44
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
45
|
+
};
|
|
46
|
+
const getAnswerNode = (identifiers) => {
|
|
47
|
+
return getStatementNode(identifiers).simplify({
|
|
48
|
+
forbidFactorize: true,
|
|
49
|
+
towardsDistribute: true,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const getAnswer = (identifiers) => {
|
|
53
|
+
return getAnswerNode(identifiers).toTex();
|
|
54
|
+
};
|
|
55
|
+
const getStatementNode = (identifiers) => {
|
|
56
|
+
let affs = [
|
|
57
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(identifiers.affine1),
|
|
58
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(identifiers.affine2),
|
|
59
|
+
generalAffine_1.GeneralAffineConstructor.fromIdentifiers(identifiers.affine3),
|
|
60
|
+
].map((e) => e.toTree());
|
|
61
|
+
if (identifiers.affine4) {
|
|
62
|
+
affs.push(generalAffine_1.GeneralAffineConstructor.fromIdentifiers(identifiers.affine4).toTree());
|
|
63
|
+
}
|
|
64
|
+
if (identifiers.affine4)
|
|
65
|
+
return (0, substractNode_1.substract)((0, multiplyNode_1.multiply)(affs[0], affs[1]), (0, multiplyNode_1.multiply)(affs[2], affs[3]));
|
|
66
|
+
return (0, substractNode_1.substract)((0, multiplyNode_1.multiply)(affs[0], affs[1]), (0, powerNode_1.square)(affs[2]));
|
|
67
|
+
};
|
|
68
|
+
const getInstruction = (identifiers) => {
|
|
69
|
+
return `Développer et réduire :
|
|
70
|
+
|
|
71
|
+
$$
|
|
72
|
+
${getStatementNode(identifiers).toTex()}
|
|
73
|
+
$$
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
77
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
78
|
+
const getKeys = (identifiers) => {
|
|
79
|
+
return ["x"];
|
|
80
|
+
};
|
|
81
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
82
|
+
const texs = getAnswerNode(identifiers).toAllValidTexs({});
|
|
83
|
+
return texs.includes(ans);
|
|
84
|
+
};
|
|
85
|
+
const getDoubleDistributivitySubstractQuestion = (ops) => {
|
|
86
|
+
const type = (0, randint_1.randint)(1, 4);
|
|
87
|
+
const affine1 = generalAffine_1.GeneralAffineConstructor.randomInts({ allowBNull: false });
|
|
88
|
+
const affine2 = generalAffine_1.GeneralAffineConstructor.randomInts({ allowBNull: false });
|
|
89
|
+
const affine3 = type === 1
|
|
90
|
+
? new generalAffine_1.GeneralAffine((0, randint_1.randint)(-10, 11, [0]), 0)
|
|
91
|
+
: generalAffine_1.GeneralAffineConstructor.randomInts({ allowBNull: false });
|
|
92
|
+
const affine4 = type === 3
|
|
93
|
+
? undefined
|
|
94
|
+
: generalAffine_1.GeneralAffineConstructor.randomInts({ allowBNull: false });
|
|
95
|
+
const identifiers = {
|
|
96
|
+
type,
|
|
97
|
+
affine1: affine1.toIdentifiers(),
|
|
98
|
+
affine2: affine2.toIdentifiers(),
|
|
99
|
+
affine3: affine3.toIdentifiers(),
|
|
100
|
+
affine4: affine4?.toIdentifiers(),
|
|
101
|
+
};
|
|
102
|
+
const question = {
|
|
103
|
+
answer: getAnswer(identifiers),
|
|
104
|
+
instruction: getInstruction(identifiers),
|
|
105
|
+
keys: getKeys(identifiers),
|
|
106
|
+
answerFormat: "tex",
|
|
107
|
+
identifiers,
|
|
108
|
+
// hint: getHint(identifiers),
|
|
109
|
+
// correction: getCorrection(identifiers),
|
|
110
|
+
};
|
|
111
|
+
return question;
|
|
112
|
+
};
|
|
113
|
+
exports.doubleDistributivitySubstract = {
|
|
114
|
+
id: "doubleDistributivitySubstract",
|
|
115
|
+
connector: "=",
|
|
116
|
+
label: "Double distributivité : soustraction de deux produits",
|
|
117
|
+
isSingleStep: false,
|
|
118
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getDoubleDistributivitySubstractQuestion(opts), nb),
|
|
119
|
+
qcmTimer: 60,
|
|
120
|
+
freeTimer: 60,
|
|
121
|
+
getPropositions,
|
|
122
|
+
isAnswerValid,
|
|
123
|
+
subject: "Mathématiques",
|
|
124
|
+
getInstruction,
|
|
125
|
+
// getHint,
|
|
126
|
+
// getCorrection,
|
|
127
|
+
getAnswer,
|
|
128
|
+
};
|
|
@@ -7,4 +7,5 @@ export { thirdIdentity } from "./thirdIdentity";
|
|
|
7
7
|
export * from "./doubleDistributivityWithCoeff";
|
|
8
8
|
export * from "./canonicalFormDevelopment";
|
|
9
9
|
export * from "./simpleDistriXCoeff";
|
|
10
|
+
export * from "./doubleDistributivitySubstract";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC"}
|
|
@@ -27,3 +27,4 @@ Object.defineProperty(exports, "thirdIdentity", { enumerable: true, get: functio
|
|
|
27
27
|
__exportStar(require("./doubleDistributivityWithCoeff"), exports);
|
|
28
28
|
__exportStar(require("./canonicalFormDevelopment"), exports);
|
|
29
29
|
__exportStar(require("./simpleDistriXCoeff"), exports);
|
|
30
|
+
__exportStar(require("./doubleDistributivitySubstract"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./recognizeAngleType"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
points: PointIdentifiers[];
|
|
5
|
+
angleType: string;
|
|
6
|
+
angleIndex: number;
|
|
7
|
+
apexIndex: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const recognizeAngleType: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=recognizeAngleType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAWnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8TF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recognizeAngleType = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
+
const angle_1 = require("../../../../math/geometry/angle");
|
|
8
|
+
const line_1 = require("../../../../math/geometry/line");
|
|
9
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
10
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
11
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
12
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
13
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
14
|
+
const isLetter_1 = require("../../../../utils/strings/isLetter");
|
|
15
|
+
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
16
|
+
const getAngle = (identifiers) => {
|
|
17
|
+
const indexes = getAnglePointsIndexes(identifiers.angleIndex, identifiers.apexIndex);
|
|
18
|
+
return new angle_1.Angle(indexes.map((i) => point_1.PointConstructor.fromIdentifiers(identifiers.points[i])));
|
|
19
|
+
};
|
|
20
|
+
const getAnglePointsIndexes = (angleIndex, apexIndex) => {
|
|
21
|
+
const angles = [
|
|
22
|
+
[apexIndex + 2, apexIndex, apexIndex + 1],
|
|
23
|
+
[(apexIndex + 3 + 12) % 12, apexIndex, apexIndex + 2],
|
|
24
|
+
[(apexIndex - 3 + 12) % 12, apexIndex, (apexIndex + 3 + 12) % 12],
|
|
25
|
+
[apexIndex + 1, apexIndex, (apexIndex - 3 + 12) % 12],
|
|
26
|
+
];
|
|
27
|
+
//les angles 0 ne peuvent pas etre alterne-interne
|
|
28
|
+
return angles[angleIndex];
|
|
29
|
+
};
|
|
30
|
+
const getPropositions = (n, { answer, angleIndex, angleType, apexIndex, points }) => {
|
|
31
|
+
const propositions = [];
|
|
32
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
33
|
+
let anglesPointsIndexes = [];
|
|
34
|
+
switch (angleType) {
|
|
35
|
+
case "alterne-interne":
|
|
36
|
+
//angles 0 exclus
|
|
37
|
+
if (angleIndex === 1) {
|
|
38
|
+
//angle+1 de l'apex supérieur
|
|
39
|
+
//angles 1: une solution :
|
|
40
|
+
anglesPointsIndexes = [
|
|
41
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3) % 12),
|
|
42
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3) % 12),
|
|
43
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, (apexIndex + 3) % 12),
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
if (angleIndex === 2) {
|
|
47
|
+
//angles 2 ont deux solution :
|
|
48
|
+
//-- apex inférieur : angle -1
|
|
49
|
+
//-- apex supérieur : angle +1
|
|
50
|
+
//on choisit l'apex supérieur arbitrairement
|
|
51
|
+
anglesPointsIndexes = [
|
|
52
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3 + 12) % 12),
|
|
53
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3 + 12) % 12),
|
|
54
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, (apexIndex + 3 + 12) % 12),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
//angles 3 : une solution :
|
|
58
|
+
//-- angle-1 de l'apex inférieur
|
|
59
|
+
if (angleIndex === 3) {
|
|
60
|
+
anglesPointsIndexes = [
|
|
61
|
+
getAnglePointsIndexes(angleIndex, (apexIndex - 3 + 12) % 12),
|
|
62
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex - 3 + 12) % 12),
|
|
63
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, (apexIndex - 3 + 12) % 12),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "correspondant":
|
|
68
|
+
//deux solutions :
|
|
69
|
+
//-- apex supérieur: angle-1
|
|
70
|
+
//-- apex inférieur : angle +1
|
|
71
|
+
//on choisit l'apex supérieur arbitrairement
|
|
72
|
+
anglesPointsIndexes = [
|
|
73
|
+
getAnglePointsIndexes(angleIndex, (apexIndex + 3 + 12) % 12),
|
|
74
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, (apexIndex + 3 + 12) % 12),
|
|
75
|
+
getAnglePointsIndexes((angleIndex + 2) % 4, (apexIndex + 3 + 12) % 12),
|
|
76
|
+
];
|
|
77
|
+
break;
|
|
78
|
+
case "opposé par le sommet":
|
|
79
|
+
default:
|
|
80
|
+
//sol == angle +2 du meme apex
|
|
81
|
+
anglesPointsIndexes = [
|
|
82
|
+
getAnglePointsIndexes(angleIndex, apexIndex),
|
|
83
|
+
getAnglePointsIndexes((angleIndex + 1) % 4, apexIndex),
|
|
84
|
+
getAnglePointsIndexes((angleIndex + 3) % 4, apexIndex),
|
|
85
|
+
];
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
anglesPointsIndexes.forEach((indexes) => {
|
|
89
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new angle_1.Angle(indexes.map((i) => point_1.PointConstructor.fromIdentifiers(points[i]))).toTex());
|
|
90
|
+
});
|
|
91
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
92
|
+
};
|
|
93
|
+
const getAnswerAngle = (identifiers) => {
|
|
94
|
+
const { angleIndex, angleType, apexIndex, points } = identifiers;
|
|
95
|
+
let anglePointsIndexes = [];
|
|
96
|
+
switch (angleType) {
|
|
97
|
+
case "alterne-interne":
|
|
98
|
+
//angles 0 exclus
|
|
99
|
+
if (angleIndex === 1) {
|
|
100
|
+
//angles 1: une solution :
|
|
101
|
+
//angle+1 de l'apex supérieur
|
|
102
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 1) % 4, (identifiers.apexIndex + 3) % 12);
|
|
103
|
+
}
|
|
104
|
+
if (angleIndex === 2) {
|
|
105
|
+
//angles 2 ont deux solution :
|
|
106
|
+
//-- apex inférieur : angle -1
|
|
107
|
+
//-- apex supérieur : angle +1
|
|
108
|
+
//on choisit l'apex supérieur arbitrairement
|
|
109
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 1) % 4, (identifiers.apexIndex + 3 + 12) % 12);
|
|
110
|
+
}
|
|
111
|
+
//angles 3 : une solution :
|
|
112
|
+
//-- angle-1 de l'apex inférieur
|
|
113
|
+
if (angleIndex === 3) {
|
|
114
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex - 1 + 4) % 4, (identifiers.apexIndex - 3 + 12) % 12);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "correspondant":
|
|
118
|
+
//deux solutions :
|
|
119
|
+
//-- apex supérieur: angle-1
|
|
120
|
+
//-- apex inférieur : angle +1
|
|
121
|
+
//on choisit l'apex supérieur arbitrairement
|
|
122
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex - 1 + 4) % 4, (identifiers.apexIndex + 3 + 12) % 12);
|
|
123
|
+
break;
|
|
124
|
+
case "opposé par le sommet":
|
|
125
|
+
default:
|
|
126
|
+
//angle +2 du meme apex
|
|
127
|
+
anglePointsIndexes = getAnglePointsIndexes((angleIndex + 2) % 4, identifiers.apexIndex);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
const angle = new angle_1.Angle(anglePointsIndexes.map((i) => point_1.PointConstructor.fromIdentifiers(points[i])));
|
|
131
|
+
return angle;
|
|
132
|
+
};
|
|
133
|
+
const getAnswer = (identifiers) => {
|
|
134
|
+
return getAnswerAngle(identifiers).toTex();
|
|
135
|
+
};
|
|
136
|
+
const getInstruction = (identifiers) => {
|
|
137
|
+
const angleTex = getAngle(identifiers).toTex();
|
|
138
|
+
return `Donner un angle ${identifiers.angleType} à l'angle $${angleTex}$.`;
|
|
139
|
+
};
|
|
140
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
141
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
142
|
+
const getGGBOptions = (identifiers) => {
|
|
143
|
+
const points = identifiers.points.map(point_1.PointConstructor.fromIdentifiers);
|
|
144
|
+
const lines = [
|
|
145
|
+
new line_1.Line(points[0], points[3]),
|
|
146
|
+
new line_1.Line(points[3], points[6]),
|
|
147
|
+
new line_1.Line(points[6], points[9]),
|
|
148
|
+
new line_1.Line(points[9], points[0]),
|
|
149
|
+
];
|
|
150
|
+
const angle = getAngle(identifiers);
|
|
151
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
152
|
+
commands: [
|
|
153
|
+
...points.flatMap((p) => p.toGGBCommand()),
|
|
154
|
+
...lines.flatMap((l) => l.toGGBCommands(false)),
|
|
155
|
+
...angle.toCommands({ color: "red" }),
|
|
156
|
+
],
|
|
157
|
+
hideAxes: true,
|
|
158
|
+
hideGrid: true,
|
|
159
|
+
});
|
|
160
|
+
return ggb.getOptions({
|
|
161
|
+
coords: [-5, 5, -5, 5],
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
const getKeys = (identifiers) => {
|
|
165
|
+
const points = identifiers.points.map(point_1.PointConstructor.fromIdentifiers);
|
|
166
|
+
//! devrait on mettre widehat
|
|
167
|
+
return points.map((p) => p.name);
|
|
168
|
+
};
|
|
169
|
+
const isAnswerValid = (ans, { answer, angleIndex, angleType, apexIndex, points }) => {
|
|
170
|
+
let formated = ans;
|
|
171
|
+
if (ans.includes("widehat")) {
|
|
172
|
+
formated = formated.replaceAll("\\widehat{", "").replaceAll("}", "");
|
|
173
|
+
}
|
|
174
|
+
const pointsNames = Array.from(new Set(formated.split("")));
|
|
175
|
+
if (pointsNames.length !== 3 || pointsNames.some((char) => !(0, isLetter_1.isLetter)(char)))
|
|
176
|
+
return false;
|
|
177
|
+
const studentPoints = pointsNames.map((char) => point_1.PointConstructor.fromIdentifiers(points.find((p) => p.name === char)));
|
|
178
|
+
const answerAngle = getAngle({ angleIndex, apexIndex, points });
|
|
179
|
+
const studentAngle = new angle_1.Angle(studentPoints);
|
|
180
|
+
//? on va accpter aussi des angles correspondants ou alternes-internes qui ne sont pas définis par les sécantes tracées
|
|
181
|
+
//? c'est chelou mais dans le fond ça fait sens (c'est vrai mathémtiquement)
|
|
182
|
+
switch (angleType) {
|
|
183
|
+
case "opposé par le sommet":
|
|
184
|
+
return studentAngle.isSummitOpposite(answerAngle);
|
|
185
|
+
case "alterne-interne":
|
|
186
|
+
return studentAngle.isAlterneInterne(answerAngle);
|
|
187
|
+
break;
|
|
188
|
+
case "correspondant":
|
|
189
|
+
default:
|
|
190
|
+
return studentAngle.isCorrespondant(answerAngle);
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
};
|
|
195
|
+
//deux paires de sécantes
|
|
196
|
+
const getRecognizeAngleTypeQuestion = (opts) => {
|
|
197
|
+
const angleType = (0, random_1.random)([
|
|
198
|
+
"alterne-interne",
|
|
199
|
+
"correspondant",
|
|
200
|
+
"opposé par le sommet",
|
|
201
|
+
]);
|
|
202
|
+
const names = [];
|
|
203
|
+
for (let i = 0; i < 12; i++) {
|
|
204
|
+
names.push((0, randomLetter_1.randomLetter)(true, names));
|
|
205
|
+
}
|
|
206
|
+
const buildIntersectionsPoints = (index) => {
|
|
207
|
+
//les 4 intersections sont (+-2, +-2)
|
|
208
|
+
let [x, y] = [index < 3 || index > 8 ? -2 : 2, index < 6 ? 2 : -2];
|
|
209
|
+
//bruit
|
|
210
|
+
x += (0, randfloat_1.randfloat)(-1, 1, 1);
|
|
211
|
+
y += (0, randfloat_1.randfloat)(-1, 1, 1);
|
|
212
|
+
return new point_1.Point(names[index], x.toTree(), y.toTree());
|
|
213
|
+
};
|
|
214
|
+
const intersections = [0, 3, 6, 9].map(buildIntersectionsPoints);
|
|
215
|
+
const buildAnglesPoints = (index) => {
|
|
216
|
+
const intersectionIndex = Math.floor(index / 3);
|
|
217
|
+
const apex = intersections[intersectionIndex];
|
|
218
|
+
const next = intersections[(intersectionIndex + 1) % 4];
|
|
219
|
+
const prev = intersections[(intersectionIndex - 1 + 4) % 4];
|
|
220
|
+
let [x, y] = [apex.x.evaluate(), apex.y.evaluate()];
|
|
221
|
+
if (index % 2 === 0) {
|
|
222
|
+
const line = new line_1.Line(apex, intersectionIndex % 2 === 0 ? prev : next);
|
|
223
|
+
//lignes verticales (ordonnées +-1)
|
|
224
|
+
y = y + (y < 0 ? -1 : 1);
|
|
225
|
+
return line.getPointWithY(new numberNode_1.NumberNode(y), names[index]);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
//lignes horizontales (abscisse +-1)
|
|
229
|
+
const line = new line_1.Line(apex, intersectionIndex % 2 === 0 ? next : prev);
|
|
230
|
+
x = x + (x < 0 ? -1 : 1);
|
|
231
|
+
return line.getPointWithX(new numberNode_1.NumberNode(x), names[index]);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const points = names.map((n, i) => i % 3 === 0 ? intersections[Math.floor(i / 3)] : buildAnglesPoints(i));
|
|
235
|
+
const apex = (0, random_1.random)([0, 3, 6, 9]);
|
|
236
|
+
//les angles 0 ne peuvent pas etre alterne-interne
|
|
237
|
+
let angleIndex = (0, randint_1.randint)(angleType !== "alterne-interne" ? 0 : 1, 4);
|
|
238
|
+
const identifiers = {
|
|
239
|
+
angleType,
|
|
240
|
+
apexIndex: apex,
|
|
241
|
+
angleIndex,
|
|
242
|
+
points: points.map((p) => p.toIdentifiers()),
|
|
243
|
+
};
|
|
244
|
+
const question = {
|
|
245
|
+
answer: getAnswer(identifiers),
|
|
246
|
+
instruction: getInstruction(identifiers),
|
|
247
|
+
keys: getKeys(identifiers),
|
|
248
|
+
answerFormat: "tex",
|
|
249
|
+
identifiers,
|
|
250
|
+
// hint: getHint(identifiers),
|
|
251
|
+
// correction: getCorrection(identifiers),
|
|
252
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
253
|
+
};
|
|
254
|
+
return question;
|
|
255
|
+
};
|
|
256
|
+
exports.recognizeAngleType = {
|
|
257
|
+
id: "recognizeAngleType",
|
|
258
|
+
label: "Reconnaître un angle alterne-interne, correspondant, opposé par le sommet",
|
|
259
|
+
isSingleStep: true,
|
|
260
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getRecognizeAngleTypeQuestion(opts), nb),
|
|
261
|
+
qcmTimer: 60,
|
|
262
|
+
freeTimer: 60,
|
|
263
|
+
getPropositions,
|
|
264
|
+
isAnswerValid,
|
|
265
|
+
subject: "Mathématiques",
|
|
266
|
+
// getHint,
|
|
267
|
+
// getCorrection,
|
|
268
|
+
getInstruction,
|
|
269
|
+
getAnswer,
|
|
270
|
+
getGGBOptions,
|
|
271
|
+
hasGeogebra: true,
|
|
272
|
+
};
|
|
@@ -23,7 +23,7 @@ const getEndPoint = (identifiers) => {
|
|
|
23
23
|
];
|
|
24
24
|
const vector = vector_1.VectorConstructor.fromPoints(translationPoints[0], translationPoints[1]);
|
|
25
25
|
const startPoint = point_1.PointConstructor.fromIdentifiers(identifiers.points.find((p) => p.name === identifiers.startPoint));
|
|
26
|
-
const end = vector.getEndPoint(startPoint, "
|
|
26
|
+
const end = vector.getEndPoint(startPoint, identifiers.startPoint + "'");
|
|
27
27
|
return end;
|
|
28
28
|
};
|
|
29
29
|
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallelepipedVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/parallelepipedVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"parallelepipedVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/parallelepipedVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAmIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -102,7 +102,6 @@ const getPropositions = (n, { answer, length, width, height }) => {
|
|
|
102
102
|
const wrongLength = length + (0, randint_1.randint)(1, 5);
|
|
103
103
|
const wrongWidth = width + (0, randint_1.randint)(1, 5);
|
|
104
104
|
const wrongHeight = height + (0, randint_1.randint)(1, 5);
|
|
105
|
-
console.log(wrongLength, wrongWidth, wrongHeight);
|
|
106
105
|
const wrongVolume = (0, round_1.round)(wrongLength * wrongWidth * wrongHeight, 2)
|
|
107
106
|
.toTree()
|
|
108
107
|
.toTex();
|
package/lib/index.d.ts
CHANGED
|
@@ -230,6 +230,12 @@ declare const mathExercises: (Exercise<{
|
|
|
230
230
|
a: number;
|
|
231
231
|
b: number;
|
|
232
232
|
c: number;
|
|
233
|
+
}, {}> | Exercise<{
|
|
234
|
+
type: number;
|
|
235
|
+
affine1: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers;
|
|
236
|
+
affine2: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers;
|
|
237
|
+
affine3: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers;
|
|
238
|
+
affine4?: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers | undefined;
|
|
233
239
|
}, {}> | Exercise<{
|
|
234
240
|
randNbr: number;
|
|
235
241
|
}, {}> | Exercise<{
|
|
@@ -1175,6 +1181,11 @@ declare const mathExercises: (Exercise<{
|
|
|
1175
1181
|
showDiagonals: boolean;
|
|
1176
1182
|
drawAngles: boolean;
|
|
1177
1183
|
shapeIdentifiers: import("./math/geometry/parallelogram").ParallelogramIdentifiers | import("./math/geometry/rhombus").RhombusIdentifiers | import("./math/geometry/rectangle").RectangleIdentifiers | import("./math/geometry/square").SquareIdentifiers;
|
|
1184
|
+
}, {}> | Exercise<{
|
|
1185
|
+
points: import("./math/geometry/point").PointIdentifiers[];
|
|
1186
|
+
angleType: string;
|
|
1187
|
+
angleIndex: number;
|
|
1188
|
+
apexIndex: number;
|
|
1178
1189
|
}, {}> | Exercise<{
|
|
1179
1190
|
coeffs: number[];
|
|
1180
1191
|
to: string;
|
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,sBAAsB,CAAC;AAG1D,OAAO,yBAAyB,CAAC;AAEjC,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,sBAAsB,CAAC;AAG1D,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
|
|
2
|
-
import { Point } from "./point";
|
|
2
|
+
import { Point, PointIdentifiers } from "./point";
|
|
3
|
+
import { NodeIdentifiers } from "../../tree/nodes/nodeConstructor";
|
|
4
|
+
export declare abstract class AngleConstructor {
|
|
5
|
+
static fromIdentifiers(identifiers: AngleIdentifiers): Angle;
|
|
6
|
+
}
|
|
3
7
|
type AngleProps = {
|
|
4
8
|
radianValueNode?: AlgebraicNode;
|
|
5
9
|
degreeValueNode?: AlgebraicNode;
|
|
6
10
|
};
|
|
11
|
+
type AnglePropsIdentifiers = {
|
|
12
|
+
radianValueNode?: NodeIdentifiers;
|
|
13
|
+
degreeValueNode?: NodeIdentifiers;
|
|
14
|
+
};
|
|
15
|
+
export type AngleIdentifiers = {
|
|
16
|
+
points: PointIdentifiers[];
|
|
17
|
+
props?: AnglePropsIdentifiers;
|
|
18
|
+
};
|
|
7
19
|
export declare class Angle {
|
|
8
20
|
points: Point[];
|
|
9
21
|
radianValueNode?: AlgebraicNode;
|
|
10
22
|
degreeValueNode?: AlgebraicNode;
|
|
23
|
+
props?: AngleProps;
|
|
11
24
|
/**
|
|
12
25
|
*
|
|
13
26
|
* @param points [pointA, pointB, pointC] with apex = B
|
|
14
27
|
*/
|
|
15
28
|
constructor(points: Point[], props?: AngleProps);
|
|
29
|
+
toIdentifiers(): AngleIdentifiers;
|
|
30
|
+
hasSameApex(a: Angle): boolean;
|
|
31
|
+
equals(a: Angle): boolean;
|
|
32
|
+
isAlterne(a: Angle): boolean;
|
|
33
|
+
isAlterneInterne(a: Angle): boolean;
|
|
34
|
+
isFlat(): boolean;
|
|
35
|
+
isCorrespondant(a: Angle): boolean;
|
|
36
|
+
isSummitOpposite(a: Angle): boolean;
|
|
16
37
|
evaluate(inRadian?: boolean): number;
|
|
17
38
|
getValueNode(inDegree?: boolean): AlgebraicNode | import("../../tree/nodes/numbers/constantNode").ConstantNode | import("../../tree/nodes/numbers/numberNode").NumberNode;
|
|
18
39
|
isRight(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/angle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/angle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAI1C,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,gBAAgB;CAUrD;AACD,KAAK,UAAU,GAAG;IAChB,eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,qBAAqB,CAAC;CAC/B,CAAC;AACF,qBAAa,KAAK;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE,aAA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