math-exercises 2.2.48 → 2.2.50

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.
Files changed (160) hide show
  1. package/lib/exercises/exercise.d.ts +11 -2
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/exercise.js +1 -0
  4. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSum.js +12 -4
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +33 -5
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +39 -5
  11. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -8
  13. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +2 -1
  15. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +2 -4
  17. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +8 -0
  19. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +8 -0
  21. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +10 -0
  23. package/lib/exercises/math/conversion/lengthConversion.d.ts +4 -1
  24. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/lengthConversion.js +60 -19
  26. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  27. package/lib/exercises/math/conversion/massConversion.js +5 -1
  28. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  29. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  30. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  31. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts +8 -0
  32. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -0
  33. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +114 -0
  34. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +1 -1
  35. package/lib/exercises/math/geometry/index.d.ts +1 -0
  36. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  37. package/lib/exercises/math/geometry/index.js +1 -0
  38. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts +8 -0
  39. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -0
  40. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +110 -0
  41. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts +8 -0
  42. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -0
  43. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +108 -0
  44. package/lib/exercises/math/geometry/parametric/index.d.ts +4 -0
  45. package/lib/exercises/math/geometry/parametric/index.d.ts.map +1 -0
  46. package/lib/exercises/math/geometry/parametric/index.js +19 -0
  47. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts +12 -0
  48. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -0
  49. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +95 -0
  50. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
  51. package/lib/exercises/math/geometry/volumes/coneVolume.js +5 -3
  52. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -2
  53. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  54. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +66 -24
  55. package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
  56. package/lib/exercises/vea/numberVEA.d.ts +2 -0
  57. package/lib/exercises/vea/numberVEA.d.ts.map +1 -0
  58. package/lib/exercises/vea/numberVEA.js +11 -0
  59. package/lib/index.d.ts +20 -2
  60. package/lib/index.d.ts.map +1 -1
  61. package/lib/math/geometry/parametricLine.d.ts +15 -0
  62. package/lib/math/geometry/parametricLine.d.ts.map +1 -0
  63. package/lib/math/geometry/parametricLine.js +46 -0
  64. package/lib/math/geometry/spacePoint.d.ts +3 -0
  65. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  66. package/lib/math/geometry/spacePoint.js +12 -0
  67. package/lib/math/geometry/spaceVector.d.ts +5 -0
  68. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  69. package/lib/math/geometry/spaceVector.js +20 -0
  70. package/lib/math/polynomials/affine.d.ts.map +1 -1
  71. package/lib/math/polynomials/affine.js +3 -1
  72. package/lib/math/polynomials/generalTrinom.d.ts +52 -0
  73. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -0
  74. package/lib/math/polynomials/generalTrinom.js +102 -0
  75. package/lib/math/polynomials/trinom.d.ts +5 -1
  76. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  77. package/lib/math/polynomials/trinom.js +9 -4
  78. package/lib/playground.js +5 -4
  79. package/lib/server.js +7 -3
  80. package/lib/tree/nodes/algebraicNode.d.ts +1 -1
  81. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  82. package/lib/tree/nodes/functions/absNode.d.ts +1 -1
  83. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  84. package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -1
  85. package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
  86. package/lib/tree/nodes/functions/arccosNode.d.ts +1 -1
  87. package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
  88. package/lib/tree/nodes/functions/arctanNode.d.ts +1 -1
  89. package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
  90. package/lib/tree/nodes/functions/cosNode.d.ts +1 -1
  91. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  92. package/lib/tree/nodes/functions/expNode.d.ts +1 -1
  93. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  94. package/lib/tree/nodes/functions/log10Node.d.ts +1 -1
  95. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  96. package/lib/tree/nodes/functions/logNode.d.ts +1 -1
  97. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  98. package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -1
  99. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  100. package/lib/tree/nodes/functions/oppositeNode.js +6 -1
  101. package/lib/tree/nodes/functions/sinNode.d.ts +1 -1
  102. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  103. package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
  104. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  105. package/lib/tree/nodes/functions/sqrtNode.js +6 -1
  106. package/lib/tree/nodes/functions/tanNode.d.ts +1 -1
  107. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  108. package/lib/tree/nodes/geometry/degree.d.ts +1 -1
  109. package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
  110. package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -1
  111. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  112. package/lib/tree/nodes/geometry/lengthNode.js +2 -2
  113. package/lib/tree/nodes/node.d.ts +2 -1
  114. package/lib/tree/nodes/node.d.ts.map +1 -1
  115. package/lib/tree/nodes/node.js +1 -0
  116. package/lib/tree/nodes/nodeSuperset.d.ts +1 -0
  117. package/lib/tree/nodes/nodeSuperset.d.ts.map +1 -0
  118. package/lib/tree/nodes/nodeSuperset.js +1 -0
  119. package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
  120. package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
  121. package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
  122. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  123. package/lib/tree/nodes/operators/addNode.d.ts +2 -1
  124. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  125. package/lib/tree/nodes/operators/addNode.js +7 -1
  126. package/lib/tree/nodes/operators/divideNode.d.ts +1 -1
  127. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  128. package/lib/tree/nodes/operators/fractionNode.d.ts +2 -1
  129. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  130. package/lib/tree/nodes/operators/fractionNode.js +14 -1
  131. package/lib/tree/nodes/operators/limitNode.d.ts +1 -1
  132. package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
  133. package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
  134. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  135. package/lib/tree/nodes/operators/multiplyNode.js +7 -1
  136. package/lib/tree/nodes/operators/powerNode.d.ts +2 -1
  137. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  138. package/lib/tree/nodes/operators/powerNode.js +6 -1
  139. package/lib/tree/nodes/operators/substractNode.d.ts +2 -1
  140. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  141. package/lib/tree/nodes/operators/substractNode.js +7 -1
  142. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  143. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  144. package/lib/tree/nodes/variables/variableNode.js +1 -1
  145. package/lib/tree/parsers/rationalParser.d.ts +2 -0
  146. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  147. package/lib/tree/parsers/rationalParser.js +33 -8
  148. package/lib/tree/parsers/spacePointParser.d.ts +3 -0
  149. package/lib/tree/parsers/spacePointParser.d.ts.map +1 -0
  150. package/lib/tree/parsers/spacePointParser.js +18 -0
  151. package/lib/tree/parsers/spaceVectorParser.d.ts +3 -0
  152. package/lib/tree/parsers/spaceVectorParser.d.ts.map +1 -0
  153. package/lib/tree/parsers/spaceVectorParser.js +18 -0
  154. package/lib/tree/parsers/valueParser.d.ts +2 -0
  155. package/lib/tree/parsers/valueParser.d.ts.map +1 -0
  156. package/lib/tree/parsers/valueParser.js +10 -0
  157. package/lib/utils/alea/random.d.ts +1 -1
  158. package/lib/utils/alea/random.d.ts.map +1 -1
  159. package/lib/utils/alea/random.js +5 -1
  160. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pointFromParametricLine = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const parametricLine_1 = require("../../../../math/geometry/parametricLine");
7
+ const spacePoint_1 = require("../../../../math/geometry/spacePoint");
8
+ const spaceVector_1 = require("../../../../math/geometry/spaceVector");
9
+ const randint_1 = require("../../../../math/utils/random/randint");
10
+ const coinFlip_1 = require("../../../../utils/alea/coinFlip");
11
+ const randomLetter_1 = require("../../../../utils/strings/randomLetter");
12
+ const getPropositions = (n, { answer }) => {
13
+ const propositions = [];
14
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
15
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
16
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
17
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
18
+ return (0, exercise_1.shuffleProps)(propositions, n);
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ return identifiers.isOnLine ? "Oui" : "Non";
22
+ };
23
+ const getInstruction = (identifiers) => {
24
+ const askedPoint = spacePoint_1.SpacePointConstructor.fromScalars(identifiers.askedPointCoords, identifiers.askedPointName);
25
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
26
+ return `Soit $d$ la droite d'équation paramétrique :
27
+
28
+ $$
29
+ ${line.toTex()}
30
+ $$
31
+
32
+ où $t\\in \\mathbb{R}$.
33
+
34
+ Le point $${askedPoint.toTexWithCoords()}$ appartient-il à $d$ ?
35
+ `;
36
+ };
37
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
38
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
39
+ const getKeys = (identifiers) => {
40
+ return [];
41
+ };
42
+ const isAnswerValid = (ans, { answer }) => {
43
+ throw Error("VEA not implemented");
44
+ };
45
+ const getPointFromParametricLineQuestion = () => {
46
+ const startPoint = spacePoint_1.SpacePointConstructor.random("A");
47
+ const vector = spaceVector_1.SpaceVectorConstructor.random("B");
48
+ const isOnLine = (0, coinFlip_1.coinFlip)();
49
+ const askedPointName = (0, randomLetter_1.randomLetter)(true, ["O"]);
50
+ let askedPoint;
51
+ let coeff;
52
+ if (isOnLine) {
53
+ coeff = (0, randint_1.randint)(-10, 10);
54
+ const res = vector.times(coeff.toTree());
55
+ askedPoint = res.getEndPoint(startPoint);
56
+ }
57
+ else {
58
+ askedPoint = spacePoint_1.SpacePointConstructor.random(askedPointName);
59
+ }
60
+ // const askedPoint = SpacePointConstructor.random(askedPointName);
61
+ const identifiers = {
62
+ startPoint: startPoint.getEvaluatedCoords(),
63
+ vector: vector.getEvaluatedCoords(),
64
+ askedPointCoords: askedPoint.getEvaluatedCoords(),
65
+ askedPointName,
66
+ isOnLine,
67
+ };
68
+ const question = {
69
+ answer: getAnswer(identifiers),
70
+ instruction: getInstruction(identifiers),
71
+ keys: getKeys(identifiers),
72
+ answerFormat: "tex",
73
+ identifiers,
74
+ // hint: getHint(identifiers),
75
+ // correction: getCorrection(identifiers),
76
+ };
77
+ return question;
78
+ };
79
+ exports.pointFromParametricLine = {
80
+ id: "pointFromParametricLine",
81
+ connector: "=",
82
+ label: "Vérifier si un point appartient à une droite d'équation paramétrique donnée",
83
+ isSingleStep: true,
84
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPointFromParametricLineQuestion, nb),
85
+ qcmTimer: 60,
86
+ freeTimer: 60,
87
+ getPropositions,
88
+ isAnswerValid,
89
+ subject: "Mathématiques",
90
+ // getHint,
91
+ // getCorrection,
92
+ getAnswer,
93
+ getKeys,
94
+ answerType: "QCU",
95
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"coneVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/coneVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
1
+ {"version":3,"file":"coneVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/coneVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const randint_1 = require("../../../../math/utils/random/randint");
7
7
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
8
8
  const round_1 = require("../../../../math/utils/round");
9
+ const numberParser_1 = require("../../../../tree/parsers/numberParser");
9
10
  const getConeVolumeQuestion = () => {
10
11
  let radius, height;
11
12
  do {
@@ -77,9 +78,10 @@ const getPropositions = (n, { answer, radius, height }) => {
77
78
  return (0, exercise_1.shuffleProps)(propositions, n);
78
79
  };
79
80
  const isAnswerValid = (ans, { answer, radius, height }) => {
80
- const validanswer = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2).toTree();
81
- const latexs = validanswer.toAllValidTexs();
82
- return latexs.includes(ans);
81
+ const parsed = (0, numberParser_1.numberParser)(ans);
82
+ if (!parsed)
83
+ return false;
84
+ return parsed === answer;
83
85
  };
84
86
  exports.coneVolume = {
85
87
  id: "coneVolume",
@@ -42,9 +42,9 @@ const getProbaFromTableWithContextQuestion = () => {
42
42
  case "singleEvent":
43
43
  [event, proba] = (0, random_1.random)([
44
44
  ["une fille", [aTotal, total]],
45
- ["une élève qui porte des lunettes", [bTotal, total]],
45
+ ["un élève qui porte des lunettes", [bTotal, total]],
46
46
  ["un garçon", [aBarreTotal, total]],
47
- ["une élève qui ne porte pas de lunettes", [bBarreTotal, total]],
47
+ ["un élève qui ne porte pas de lunettes", [bBarreTotal, total]],
48
48
  ]);
49
49
  break;
50
50
  case "intersection":
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAiIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
@@ -8,34 +8,61 @@ const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
9
9
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
10
10
  const shuffle_1 = require("../../../../utils/alea/shuffle");
11
- const getArithmeticFindExplicitFormula = () => {
12
- const firstRank = 0;
13
- const firstValue = (0, randint_1.randint)(-10, 10);
14
- const reason = (0, randint_1.randint)(-10, 10, [0]);
15
- const formula = new polynomial_1.Polynomial([firstValue, reason], "n");
16
- const answer = "u_n=" + formula.toTex();
17
- const question = {
18
- instruction: `$(u_n)$ est une suite arithmétique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $r = ${reason}$. $\\\\$ Donner l'expression de $u_n$ en fonction de $n$.`,
19
- answer,
20
- keys: ["un", "equal", "n"],
21
- answerFormat: "tex",
22
- identifiers: { firstValue, reason },
23
- hint: `Utilise la formule générale d'une suite arithmétique :
11
+ const getInstruction = (identifiers, opts) => {
12
+ const firstRank = opts?.firstTermRankOne ? 1 : 0;
13
+ return `$(u_n)$ est une suite arithmétique de premier terme $u_{${firstRank}} = ${identifiers.firstValue}$ et de raison $r = ${identifiers.reason}$.
14
+
15
+ Donner l'expression de $u_n$ en fonction de $n$.`;
16
+ };
17
+ const getHint = (identifiers, opts) => {
18
+ const firstRank = opts?.firstTermRankOne ? 1 : 0;
19
+ return `Utilise la formule générale d'une suite arithmétique :
24
20
 
25
- $u_n = u_0 + n \\times r $,
21
+ $$
22
+ ${firstRank === 0 ? "u_n = u_0 + n \\times r" : "u_n = u_1 + (n-1) \\times r"}
23
+ $$
26
24
 
27
- où $u_0$ est le premier terme et $r$ la raison.`,
28
- correction: `La formule générale d'une suite arithmétique est :
25
+ où $u_${firstRank}$ est le premier terme et $r$ la raison.`;
26
+ };
27
+ const getCorrection = (identifiers, opts) => {
28
+ const firstRank = opts?.firstTermRankOne ? 1 : 0;
29
+ const answer = getAnswer(identifiers, opts);
30
+ return `La formule générale d'une suite arithmétique est :
29
31
 
30
- $u_n = u_0 + n \\times r $,
32
+ $$
33
+ ${firstRank === 0 ? "u_n = u_0 + n \\times r " : "u_n = u_1 + (n-1) \\times r "}
34
+ $$
31
35
 
32
- où $u_0$ est le premier terme et $r$ la raison.
36
+ où $u_${firstRank}$ est le premier terme et $r$ la raison.
33
37
 
34
- Ici, puisque $u_0 = ${firstValue}$ et $r = ${reason}$, on a :
38
+ Ici, puisque $u_${firstRank} = ${identifiers.firstValue}$ et $r = ${identifiers.reason}$, on a :
35
39
 
36
- $${answer}$
40
+ $$
41
+ ${answer}
42
+ $$
37
43
 
38
- `,
44
+ `;
45
+ };
46
+ const getAnswer = (identifiers, opts) => {
47
+ const { firstValue, reason } = identifiers;
48
+ const formula = opts?.firstTermRankOne
49
+ ? new polynomial_1.Polynomial([firstValue - reason, reason], "n")
50
+ : new polynomial_1.Polynomial([firstValue, reason], "n");
51
+ const answer = "u_n=" + formula.toTex();
52
+ return answer;
53
+ };
54
+ const getArithmeticFindExplicitFormula = (opts) => {
55
+ const firstValue = (0, randint_1.randint)(-10, 10);
56
+ const reason = (0, randint_1.randint)(-10, 10, [0]);
57
+ const identifiers = { firstValue, reason };
58
+ const question = {
59
+ instruction: getInstruction(identifiers, opts),
60
+ answer: getAnswer(identifiers, opts),
61
+ keys: ["un", "equal", "n"],
62
+ answerFormat: "tex",
63
+ identifiers,
64
+ hint: getHint(identifiers, opts),
65
+ correction: getCorrection(identifiers, opts),
39
66
  };
40
67
  return question;
41
68
  };
@@ -50,14 +77,24 @@ const getPropositions = (n, { answer, firstValue, reason }) => {
50
77
  }
51
78
  return (0, shuffle_1.shuffle)(propositions);
52
79
  };
53
- const isAnswerValid = (ans, { reason, firstValue }) => {
54
- const formula = new polynomial_1.Polynomial([firstValue, reason], "n");
80
+ const isAnswerValid = (ans, { reason, firstValue }, opts) => {
81
+ const formula = opts?.firstTermRankOne
82
+ ? new polynomial_1.Polynomial([firstValue - reason, reason], "n")
83
+ : new polynomial_1.Polynomial([firstValue, reason], "n");
55
84
  const equal = new equalNode_1.EqualNode(new variableNode_1.VariableNode("u_n"), formula.toTree(), {
56
85
  allowRawRightChildAsSolution: true,
57
86
  });
58
87
  const texs = equal.toAllValidTexs();
59
88
  return texs.includes(ans);
60
89
  };
90
+ const options = [
91
+ {
92
+ id: "firstTermRankOne",
93
+ label: "Utiliser $u_1$ comme premier terme",
94
+ target: exercise_1.GeneratorOptionTarget.generation,
95
+ type: exercise_1.GeneratorOptionType.checkbox,
96
+ },
97
+ ];
61
98
  exports.arithmeticFindExplicitFormula = {
62
99
  id: "arithmeticFindExplicitFormula",
63
100
  connector: "=",
@@ -65,11 +102,16 @@ exports.arithmeticFindExplicitFormula = {
65
102
  levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
66
103
  sections: ["Suites"],
67
104
  isSingleStep: false,
68
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArithmeticFindExplicitFormula, nb),
105
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getArithmeticFindExplicitFormula(opts), nb),
69
106
  qcmTimer: 60,
70
107
  freeTimer: 60,
71
108
  getPropositions,
72
109
  isAnswerValid,
73
110
  subject: "Mathématiques",
74
111
  hasHintAndCorrection: true,
112
+ options,
113
+ getAnswer,
114
+ getCorrection,
115
+ getHint,
116
+ getInstruction,
75
117
  };
@@ -16,12 +16,12 @@ const shuffle_1 = require("../../../utils/alea/shuffle");
16
16
  const getAnswer = (type, firstTerm, secondTerm) => {
17
17
  switch (type) {
18
18
  case 1: //(a+b)^2
19
- return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new addNode_1.AddNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false });
19
+ return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new addNode_1.AddNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false, forbidFactorize: true });
20
20
  case 2:
21
- return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false });
21
+ return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false, forbidFactorize: true });
22
22
  case 3:
23
23
  default:
24
- return new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm)).simplify({ keepPowers: false });
24
+ return new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm)).simplify({ keepPowers: false, forbidFactorize: true });
25
25
  }
26
26
  };
27
27
  //(x sqrt(a) +- [y || y*sqrt(b)])^2
@@ -0,0 +1,2 @@
1
+ export declare const numberVEA: (studentAns: string, answer: string) => boolean;
2
+ //# sourceMappingURL=numberVEA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/numberVEA.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,eAAgB,MAAM,UAAU,MAAM,YAI3D,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.numberVEA = void 0;
4
+ const numberParser_1 = require("../../tree/parsers/numberParser");
5
+ const numberVEA = (studentAns, answer) => {
6
+ const parsed = (0, numberParser_1.numberParser)(studentAns);
7
+ if (!parsed)
8
+ return false;
9
+ return parsed === answer;
10
+ };
11
+ exports.numberVEA = numberVEA;
package/lib/index.d.ts CHANGED
@@ -47,7 +47,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
47
47
  rational: [number, number];
48
48
  rational2: [number, number];
49
49
  }, {
50
- allowNonIrreductible: boolean;
50
+ allowNonIrreductible?: boolean | undefined;
51
51
  }> | import("./exercises/exercise").Exercise<{
52
52
  num: number;
53
53
  denum: number;
@@ -390,7 +390,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
390
390
  randomUnitIndex: number;
391
391
  randomUnitInstructionIndex: number;
392
392
  randomLength: number;
393
- }, {}> | import("./exercises/exercise").Exercise<{
393
+ }, {
394
+ units: string[];
395
+ }> | import("./exercises/exercise").Exercise<{
394
396
  randomUnitIndex: number;
395
397
  randomUnitInstructionIndex: number;
396
398
  randomMass: number;
@@ -731,6 +733,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
731
733
  type: number;
732
734
  }, {}> | import("./exercises/exercise").Exercise<{
733
735
  coeffs: number[];
736
+ }, {}> | import("./exercises/exercise").Exercise<{
737
+ trinomCoeffs: number[];
738
+ isAskingPositive: boolean;
734
739
  }, {}> | import("./exercises/exercise").Exercise<{
735
740
  a: number;
736
741
  k: number;
@@ -1061,6 +1066,19 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1061
1066
  }, {}> | import("./exercises/exercise").Exercise<{
1062
1067
  type: number;
1063
1068
  commands: string[];
1069
+ }, {}> | import("./exercises/exercise").Exercise<{
1070
+ startPoint: number[];
1071
+ vector: number[];
1072
+ askedPointCoords: number[];
1073
+ askedPointName: string;
1074
+ isOnLine: boolean;
1075
+ coeff?: number | undefined;
1076
+ }, {}> | import("./exercises/exercise").Exercise<{
1077
+ startPoint: number[];
1078
+ vector: number[];
1079
+ }, {}> | import("./exercises/exercise").Exercise<{
1080
+ startPoint: number[];
1081
+ vector: number[];
1064
1082
  }, {}> | import("./exercises/exercise").Exercise<{
1065
1083
  coeffs: number[];
1066
1084
  to: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
2
+ import { SpacePoint } from "./spacePoint";
3
+ import { SpaceVector } from "./spaceVector";
4
+ export declare class ParametricLine {
5
+ startPoint: SpacePoint;
6
+ vector: SpaceVector;
7
+ equations: AlgebraicNode[];
8
+ constructor(startPoint: SpacePoint, vector: SpaceVector);
9
+ toDetailedEvaluation(t: AlgebraicNode): AlgebraicNode[];
10
+ getPointCoords(t: AlgebraicNode): AlgebraicNode[];
11
+ getPoint(t: AlgebraicNode): SpacePoint;
12
+ hasPoint(p: SpacePoint): boolean;
13
+ toTex(): string;
14
+ }
15
+ //# sourceMappingURL=parametricLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parametricLine.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/parametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAA0B,MAAM,eAAe,CAAC;AAEpE,qBAAa,cAAc;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,aAAa,EAAE,CAAC;gBACf,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW;IAavD,oBAAoB,CAAC,CAAC,EAAE,aAAa;IAIrC,cAAc,CAAC,CAAC,EAAE,aAAa;IAG/B,QAAQ,CAAC,CAAC,EAAE,aAAa;IAKzB,QAAQ,CAAC,CAAC,EAAE,UAAU;IAYtB,KAAK;CAUN"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParametricLine = void 0;
4
+ const addNode_1 = require("../../tree/nodes/operators/addNode");
5
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
6
+ const variableNode_1 = require("../../tree/nodes/variables/variableNode");
7
+ const spacePoint_1 = require("./spacePoint");
8
+ const spaceVector_1 = require("./spaceVector");
9
+ class ParametricLine {
10
+ constructor(startPoint, vector) {
11
+ this.startPoint = startPoint;
12
+ this.vector = vector;
13
+ const pointCoords = this.startPoint.getCoords();
14
+ const vectorCoords = this.vector.getCoords();
15
+ this.equations = [0, 1, 2].map((i) => new addNode_1.AddNode(pointCoords[i], new multiplyNode_1.MultiplyNode(vectorCoords[i], new variableNode_1.VariableNode("t"))).simplify({ forbidFactorize: true }));
16
+ }
17
+ toDetailedEvaluation(t) {
18
+ return this.equations.map((e) => e.toDetailedEvaluation({ t: t }));
19
+ }
20
+ getPointCoords(t) {
21
+ return this.toDetailedEvaluation(t).map((e) => e.simplify());
22
+ }
23
+ getPoint(t) {
24
+ const pointCoords = this.toDetailedEvaluation(t).map((e) => e.simplify());
25
+ return new spacePoint_1.SpacePoint("A", pointCoords[0], pointCoords[1], pointCoords[2]);
26
+ }
27
+ hasPoint(p) {
28
+ if (p.equals(this.startPoint))
29
+ return true;
30
+ const secondPoint = this.vector.getEndPoint(this.startPoint);
31
+ const vector1 = spaceVector_1.SpaceVectorConstructor.fromPoints(this.startPoint, p);
32
+ const vector2 = spaceVector_1.SpaceVectorConstructor.fromPoints(this.startPoint, secondPoint);
33
+ return vector1.isColinear(vector2);
34
+ }
35
+ toTex() {
36
+ return `
37
+ \\left\\{\\begin{matrix}
38
+ x=${this.equations[0].toTex()} \\\\
39
+ y=${this.equations[1].toTex()} \\\\
40
+ z=${this.equations[2].toTex()}
41
+ \\end{matrix}
42
+ \\right.
43
+ `;
44
+ }
45
+ }
46
+ exports.ParametricLine = ParametricLine;
@@ -7,6 +7,7 @@ type AleaBound = {
7
7
  export declare abstract class SpacePointConstructor {
8
8
  static random(name: string, xOpts?: AleaBound, yOpts?: AleaBound, zOpts?: AleaBound): SpacePoint;
9
9
  static randomDifferent(names: string[]): SpacePoint[];
10
+ static fromScalars(arr: number[], name?: string): SpacePoint;
10
11
  }
11
12
  export declare class SpacePoint {
12
13
  name: string;
@@ -14,6 +15,8 @@ export declare class SpacePoint {
14
15
  y: AlgebraicNode;
15
16
  z: AlgebraicNode;
16
17
  constructor(name: string, x: AlgebraicNode, y: AlgebraicNode, z: AlgebraicNode);
18
+ getCoords(): AlgebraicNode[];
19
+ getEvaluatedCoords(): number[];
17
20
  toTex(): string;
18
21
  toTexWithCoords(): string;
19
22
  toCoords(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"spacePoint.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spacePoint.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,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,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AChB,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;CAKb"}
@@ -27,6 +27,12 @@ class SpacePointConstructor {
27
27
  }
28
28
  return res;
29
29
  }
30
+ static fromScalars(arr, name = "A") {
31
+ if (arr.length !== 3) {
32
+ throw new Error("array must have 3 elements");
33
+ }
34
+ return new SpacePoint(name, new numberNode_1.NumberNode(arr[0]), new numberNode_1.NumberNode(arr[1]), new numberNode_1.NumberNode(arr[2]));
35
+ }
30
36
  }
31
37
  exports.SpacePointConstructor = SpacePointConstructor;
32
38
  class SpacePoint {
@@ -36,6 +42,12 @@ class SpacePoint {
36
42
  this.y = y;
37
43
  this.z = z;
38
44
  }
45
+ getCoords() {
46
+ return [this.x, this.y, this.z];
47
+ }
48
+ getEvaluatedCoords() {
49
+ return this.getCoords().map((e) => e.evaluate({}));
50
+ }
39
51
  toTex() {
40
52
  return `${this.name}`;
41
53
  }
@@ -5,6 +5,7 @@ export declare abstract class SpaceVectorConstructor {
5
5
  static fromPoints(origin: SpacePoint, end: SpacePoint): SpaceVector;
6
6
  static random(name: string, allowNull?: boolean): SpaceVector;
7
7
  static randomDifferents(names: string[], allowNull?: boolean): SpaceVector[];
8
+ static fromScalars(arr: number[]): SpaceVector;
8
9
  }
9
10
  export declare class SpaceVector {
10
11
  name: string;
@@ -13,11 +14,15 @@ export declare class SpaceVector {
13
14
  y: AlgebraicNode;
14
15
  z: AlgebraicNode;
15
16
  constructor(name: string, x: AlgebraicNode, y: AlgebraicNode, z: AlgebraicNode);
17
+ getCoords(): AlgebraicNode[];
18
+ getEvaluatedCoords(): number[];
16
19
  toTex(): string;
17
20
  toCoordsTex(): string;
18
21
  toInlineCoordsTex(): string;
19
22
  toTexWithCoords(): string;
23
+ vetorialProduct(v: SpaceVector): SpaceVector;
20
24
  isColinear(v: SpaceVector): boolean;
25
+ isCoplanar(v: SpaceVector): boolean;
21
26
  determinant(v: SpaceVector): AlgebraicNode;
22
27
  times(k: AlgebraicNode, name?: string): SpaceVector;
23
28
  scalarProduct(v: SpaceVector): Node;
@@ -1 +1 @@
1
- {"version":3,"file":"spaceVector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spaceVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAY,MAAM,uBAAuB,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,WAAW;IAQnE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,WAAW;IAY1D,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,UAAO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AAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,UAAO,GAAG,WAAW,EAAE;IAWzE,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE;CAWjC;AAED,qBAAa,WAAW;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,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;IAGlB,KAAK,IAAI,MAAM;IAIf,WAAW,IAAI,MAAM;IAGrB,iBAAiB,IAAI,MAAM;IAK3B,eAAe,IAAI,MAAM;IAMzB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW;IAiB5C,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;IAMnC,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;IAGnC,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,aAAa;IAI1C,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAQrC,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAInC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW;IAShC,OAAO,IAAI,aAAa;IAYxB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM;IAQjD,MAAM,CAAC,CAAC,EAAE,WAAW;CAGtB"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SpaceVector = exports.SpaceVectorConstructor = void 0;
4
4
  const sqrtNode_1 = require("../../tree/nodes/functions/sqrtNode");
5
+ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
5
6
  const addNode_1 = require("../../tree/nodes/operators/addNode");
6
7
  const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
7
8
  const powerNode_1 = require("../../tree/nodes/operators/powerNode");
@@ -34,6 +35,12 @@ class SpaceVectorConstructor {
34
35
  }
35
36
  return res;
36
37
  }
38
+ static fromScalars(arr) {
39
+ if (arr.length !== 3) {
40
+ throw new Error("array must have 3 elements");
41
+ }
42
+ return new SpaceVector("P", new numberNode_1.NumberNode(arr[0]), new numberNode_1.NumberNode(arr[1]), new numberNode_1.NumberNode(arr[2]));
43
+ }
37
44
  }
38
45
  exports.SpaceVectorConstructor = SpaceVectorConstructor;
39
46
  class SpaceVector {
@@ -44,6 +51,12 @@ class SpaceVector {
44
51
  this.y = y;
45
52
  this.z = z;
46
53
  }
54
+ getCoords() {
55
+ return [this.x, this.y, this.z];
56
+ }
57
+ getEvaluatedCoords() {
58
+ return this.getCoords().map((e) => e.evaluate({}));
59
+ }
47
60
  toTex() {
48
61
  return `\\overrightarrow{${this.name}}`;
49
62
  }
@@ -58,7 +71,14 @@ class SpaceVector {
58
71
  toTexWithCoords() {
59
72
  return `\\overrightarrow{${this.name}}\\begin{pmatrix}${this.x.toTex()} \\\\ ${this.y.toTex()} \\\\ ${this.z.toTex()} \\end{pmatrix}`;
60
73
  }
74
+ vetorialProduct(v) {
75
+ return new SpaceVector(`w`, new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.y, v.z), new multiplyNode_1.MultiplyNode(this.z, v.y)).simplify(), new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.z, v.x), new multiplyNode_1.MultiplyNode(this.x, v.z)).simplify(), new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.x, v.y), new multiplyNode_1.MultiplyNode(this.y, v.x)).simplify());
76
+ }
61
77
  isColinear(v) {
78
+ const vectorialProduct = this.vetorialProduct(v);
79
+ return vectorialProduct.equals(new SpaceVector("0", (0).toTree(), (0).toTree(), (0).toTree()));
80
+ }
81
+ isCoplanar(v) {
62
82
  throw Error("unimplemented");
63
83
  }
64
84
  determinant(v) {
@@ -1 +1 @@
1
- {"version":3,"file":"affine.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/affine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAG3C,MAAM,CAAC,MAAM,CACX,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC1D,MAAM;IAcT,MAAM,CAAC,gBAAgB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC1D,MAAM,EAAE;CAWZ;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;gBAEL,CAAC,EAAE,MAAM,EA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Q,UAAU;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;gBAEL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAOxD,OAAO,IAAI,MAAM;IAIjB,MAAM,IAAI,MAAM;IAMhB,KAAK,CAAC,CAAC,EAAE,MAAM;IAIf,QAAQ,IAAI,MAAM;IAIlB,iBAAiB,IAAI,MAAM;CAG5B"}
@@ -38,7 +38,9 @@ class Affine extends polynomial_1.Polynomial {
38
38
  return new rational_1.Rational(-this.b, this.a).simplify();
39
39
  }
40
40
  square() {
41
- return new trinom_1.Trinom(this.a ** 2, 2 * this.a * this.b, this.b ** 2, this.variable);
41
+ return new trinom_1.Trinom(this.a ** 2, 2 * this.a * this.b, this.b ** 2, {
42
+ variable: this.variable,
43
+ });
42
44
  }
43
45
  times(n) {
44
46
  return new Affine(this.a * n, this.b * n);
@@ -0,0 +1,52 @@
1
+ import { AddNode } from "../../tree/nodes/operators/addNode";
2
+ import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
3
+ import { NodeType } from "../../tree/nodes/node";
4
+ export declare abstract class GeneralTrinomConstructor {
5
+ static random(aOpts?: {
6
+ min?: number;
7
+ max?: number;
8
+ excludes?: number[];
9
+ }, bOpts?: {
10
+ min?: number;
11
+ max?: number;
12
+ excludes?: number[];
13
+ }, cOpts?: {
14
+ min?: number;
15
+ max?: number;
16
+ excludes?: number[];
17
+ }): GeneralTrinom;
18
+ static randomCanonical(aOpts?: {
19
+ min?: number;
20
+ max?: number;
21
+ excludes?: number[];
22
+ from?: number[];
23
+ }, alphaOpts?: {
24
+ min?: number;
25
+ max?: number;
26
+ excludes?: number[];
27
+ }, betaOpts?: {
28
+ min?: number;
29
+ max?: number;
30
+ excludes?: number[];
31
+ }): GeneralTrinom;
32
+ static randomNiceRoots(nbOfRoots?: number): GeneralTrinom;
33
+ static fromCoeffs(coeffs: number[]): GeneralTrinom;
34
+ }
35
+ type TrinomOptions = {
36
+ variable: string;
37
+ };
38
+ export declare class GeneralTrinom {
39
+ a: AlgebraicNode;
40
+ b: AlgebraicNode;
41
+ c: AlgebraicNode;
42
+ variable: string;
43
+ type: NodeType;
44
+ constructor(a: AlgebraicNode | number, b: AlgebraicNode | number, c: AlgebraicNode | number, opts?: TrinomOptions);
45
+ getDelta(): AlgebraicNode;
46
+ getRoots(): AlgebraicNode[];
47
+ toTree(): AddNode;
48
+ toTex(): string;
49
+ getCoeffs(): number[];
50
+ }
51
+ export {};
52
+ //# sourceMappingURL=generalTrinom.d.ts.map