math-exercises 3.0.9 → 3.0.11

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 (139) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -1
  3. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
  4. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +6 -2
  6. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts +1 -1
  7. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +54 -17
  9. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts +11 -0
  10. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +134 -0
  12. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts +3 -0
  13. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts.map +1 -0
  14. package/lib/exercises/math/functions/trinoms/devForm/index.js +2 -0
  15. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +9 -0
  16. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -0
  17. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +42 -0
  18. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts +9 -0
  19. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -0
  20. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +50 -0
  21. package/lib/exercises/math/functions/trinoms/equation/index.d.ts +5 -0
  22. package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -0
  23. package/lib/exercises/math/functions/trinoms/equation/index.js +4 -0
  24. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts +11 -0
  25. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -0
  26. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +102 -0
  27. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
  28. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
  29. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +131 -0
  30. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts +7 -0
  31. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
  32. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +69 -0
  33. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts +8 -0
  34. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -0
  35. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +72 -0
  36. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts +2 -0
  37. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -0
  38. package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
  39. package/lib/exercises/math/functions/trinoms/index.d.ts +7 -23
  40. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/trinoms/index.js +7 -23
  42. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +3 -0
  43. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -0
  44. package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
  45. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts +8 -0
  46. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -0
  47. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +285 -0
  48. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts +9 -0
  49. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -0
  50. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +112 -0
  51. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts +10 -0
  52. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -0
  53. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +124 -0
  54. package/lib/exercises/math/functions/trinoms/roots/index.d.ts +8 -0
  55. package/lib/exercises/math/functions/trinoms/roots/index.d.ts.map +1 -0
  56. package/lib/exercises/math/functions/trinoms/roots/index.js +7 -0
  57. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts +9 -0
  58. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -0
  59. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +54 -0
  60. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts +9 -0
  61. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -0
  62. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +55 -0
  63. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts +9 -0
  64. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -0
  65. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +67 -0
  66. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts +8 -0
  67. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -0
  68. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +109 -0
  69. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts +9 -0
  70. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -0
  71. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +63 -0
  72. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts +8 -0
  73. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -0
  74. package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +109 -0
  75. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +3 -0
  76. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -0
  77. package/lib/exercises/math/functions/trinoms/sign/index.js +2 -0
  78. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +8 -0
  79. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +120 -0
  81. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts +8 -0
  82. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -0
  83. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +119 -0
  84. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts +8 -0
  85. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -0
  86. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +49 -0
  87. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts +10 -0
  88. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -0
  89. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +64 -0
  90. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts +9 -0
  91. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -0
  92. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +48 -0
  93. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts +9 -0
  94. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -0
  95. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +55 -0
  96. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +9 -0
  97. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -0
  98. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +42 -0
  99. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +9 -0
  100. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -0
  101. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +8 -0
  102. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts +9 -0
  103. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -0
  104. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +90 -0
  105. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts +9 -0
  106. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -0
  107. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +55 -0
  108. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts +9 -0
  109. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -0
  110. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +59 -0
  111. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +2 -0
  112. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  113. package/lib/exercises/math/geometry/areas/triangleArea.js +56 -31
  114. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  115. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +34 -14
  116. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  117. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  118. package/lib/index.d.ts +43 -32
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/math/geometry/line.d.ts +1 -1
  121. package/lib/math/geometry/line.d.ts.map +1 -1
  122. package/lib/math/geometry/line.js +11 -1
  123. package/lib/math/geometry/parabola.d.ts +1 -1
  124. package/lib/math/geometry/parabola.d.ts.map +1 -1
  125. package/lib/math/geometry/parabola.js +4 -1
  126. package/lib/math/geometry/triangle.d.ts +1 -0
  127. package/lib/math/geometry/triangle.d.ts.map +1 -1
  128. package/lib/math/geometry/triangle.js +10 -2
  129. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  130. package/lib/tests/questionTest.d.ts.map +1 -1
  131. package/lib/tests/questionTest.js +1 -1
  132. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  133. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  134. package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
  135. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/polynomials/trinomNode.js +9 -0
  137. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  138. package/lib/tree/nodes/variables/variableNode.js +1 -3
  139. package/package.json +1 -1
@@ -62,6 +62,7 @@ export declare class TrinomNode implements AlgebraicNode {
62
62
  toMathString(): string;
63
63
  getRoots(): AlgebraicNode[];
64
64
  toTree(): import("../../../tree/nodes/operators/addNode.js").AddNode | import("../../../tree/nodes/operators/multiplyNode.js").MultiplyNode;
65
+ toFactorized(): AlgebraicNode | import("../../../tree/nodes/operators/addNode.js").AddNode | import("../../../tree/nodes/operators/multiplyNode.js").MultiplyNode;
65
66
  toTex(): string;
66
67
  getCoeffs(): number[];
67
68
  toIdentifiers(): TrinomNodeIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"trinomNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/polynomials/trinomNode.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,aAAa,EACb,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAE7C,8BAAsB,qBAAqB;IACzC,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,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,UAAU;IAmBb,MAAM,CAAC,eAAe,CACpB,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,EACD,SAAS,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GA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ACzB,CAAC,EAAE,aAAa,GAAG,MAAM,EACzB,IAAI,CAAC,EAAE,iBAAiB;IAU1B,QAAQ;IAgBR,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;IAGvC,MAAM,CAAC,IAAI,EAAE,aAAa;IAG1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAG/B,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAG7C,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAGhD,YAAY;IAIZ,QAAQ,IAAI,aAAa,EAAE;IAgB3B,MAAM;IAYN,YAAY;IAiBZ,KAAK;IAGL,SAAS;IAIT,aAAa,IAAI,qBAAqB;CASvC"}
@@ -138,6 +138,15 @@ export class TrinomNode {
138
138
  return add(highMonom, this.c);
139
139
  return add(highMonom, add(middleMonom, this.c));
140
140
  }
141
+ toFactorized() {
142
+ const roots = this.getRoots();
143
+ if (!roots.length)
144
+ return this.toTree();
145
+ if (roots.length === 1) {
146
+ return multiply(this.a, square(substract(this.variable, roots[0]))).simplify();
147
+ }
148
+ return multiply(this.a, multiply(substract(this.variable, roots[0]), substract(this.variable, roots[1]))).simplify();
149
+ }
141
150
  toTex() {
142
151
  return this.toTree().toTex();
143
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"variableNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/variables/variableNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI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,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAKxD"}
@@ -47,9 +47,7 @@ export class VariableNode {
47
47
  return isVariableNode(node) && node.name === this.name;
48
48
  }
49
49
  toDetailedEvaluation(vars) {
50
- if (!vars[this.name])
51
- throw Error("Detailed Evaluation variable non handled");
52
- return vars[this.name];
50
+ return vars[this.name] ?? this;
53
51
  }
54
52
  derivative(varName) {
55
53
  const variable = varName ?? "x";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.9",
4
+ "version": "3.0.11",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [