math-exercises 3.0.48 → 3.0.49

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 (56) hide show
  1. package/lib/exercises/math/calcul/addAndSub.d.ts +7 -1
  2. package/lib/exercises/math/calcul/addAndSub.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/addAndSub.js +26 -14
  4. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  6. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  7. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/affines/affineExpressionReading.js +0 -1
  9. package/lib/exercises/math/functions/affines/index.d.ts +0 -1
  10. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  11. package/lib/exercises/math/functions/affines/index.js +0 -1
  12. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts +10 -0
  13. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -0
  14. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +171 -0
  15. package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.d.ts +9 -0
  16. package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.d.ts.map +1 -0
  17. package/lib/exercises/math/geometry/lines/findPointOnLineWithCartesianEquation.js +146 -0
  18. package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.d.ts +8 -0
  19. package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.d.ts.map +1 -0
  20. package/lib/exercises/math/geometry/lines/findPointOnLineWithReductEquation.js +99 -0
  21. package/lib/exercises/math/geometry/lines/index.d.ts +5 -0
  22. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  23. package/lib/exercises/math/geometry/lines/index.js +5 -0
  24. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts +13 -0
  25. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -0
  26. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +118 -0
  27. package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts +11 -0
  28. package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -0
  29. package/lib/exercises/math/geometry/lines/isPointOnLine.js +94 -0
  30. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  31. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  32. package/lib/exercises/math/probaStat/stats1var/etendueList.js +46 -14
  33. package/lib/index.d.ts +28 -7
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/math/sequences/geometricSequence.js +2 -2
  36. package/lib/playground.d.ts.map +1 -1
  37. package/lib/playground.js +0 -6
  38. package/lib/tree/nodes/algebraicNode.d.ts +0 -1
  39. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  40. package/lib/tree/nodes/node.d.ts +1 -0
  41. package/lib/tree/nodes/node.d.ts.map +1 -1
  42. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  43. package/lib/tree/nodes/numbers/numberNode.js +4 -1
  44. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  45. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  46. package/lib/tree/nodes/operators/fractionNode.js +14 -25
  47. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  48. package/lib/tree/nodes/operators/multiplyNode.js +7 -1
  49. package/lib/tree/nodes/operators/scalarProductNode.d.ts.map +1 -1
  50. package/lib/tree/nodes/polynomials/monomNode.js +1 -2
  51. package/lib/tree/parsers/pointParser.d.ts +3 -0
  52. package/lib/tree/parsers/pointParser.d.ts.map +1 -0
  53. package/lib/tree/parsers/pointParser.js +13 -0
  54. package/lib/tree/parsers/spacePointParser.d.ts.map +1 -1
  55. package/lib/tree/parsers/spacePointParser.js +2 -0
  56. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { Point } from "../../math/geometry/point.js";
2
+ export declare const pointParser: (ans: string) => false | Point;
3
+ //# sourceMappingURL=pointParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/pointParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAKrD,eAAO,MAAM,WAAW,QAAS,MAAM,kBAUtC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Point } from "../../math/geometry/point.js";
2
+ import { parseAlgebraic } from "./latexParser.js";
3
+ export const pointParser = (ans) => {
4
+ const formated = ans
5
+ .replaceAll("\\left", "")
6
+ .replaceAll("\\right", "")
7
+ .replaceAll("(", "")
8
+ .replaceAll(")", "");
9
+ const coords = formated.split(";").map((e) => parseAlgebraic(e));
10
+ if (coords.length !== 2)
11
+ return false;
12
+ return new Point("A", coords[0], coords[1]);
13
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"spacePointParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/spacePointParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,eAAO,MAAM,gBAAgB,QAAS,MAAM,uBAW3C,CAAC"}
1
+ {"version":3,"file":"spacePointParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/spacePointParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,eAAO,MAAM,gBAAgB,QAAS,MAAM,uBAY3C,CAAC"}
@@ -9,6 +9,8 @@ export const spacePointParser = (ans) => {
9
9
  const coords = formated.split(";").map((e) => valueParser(e));
10
10
  if (coords?.some((e) => e === false))
11
11
  return false;
12
+ if (coords.length !== 3)
13
+ return false;
12
14
  const trees = coords.map((e) => e.toTree());
13
15
  return new SpacePoint("A", trees[0], trees[1], trees[2]);
14
16
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.48",
4
+ "version": "3.0.49",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [