math-exercises 2.2.48 → 2.2.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 (53) hide show
  1. package/lib/exercises/exercise.d.ts +5 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSum.js +12 -4
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +33 -5
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +39 -5
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -8
  12. package/lib/exercises/math/geometry/index.d.ts +1 -0
  13. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  14. package/lib/exercises/math/geometry/index.js +1 -0
  15. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts +8 -0
  16. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -0
  17. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +110 -0
  18. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts +8 -0
  19. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -0
  20. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +108 -0
  21. package/lib/exercises/math/geometry/parametric/index.d.ts +4 -0
  22. package/lib/exercises/math/geometry/parametric/index.d.ts.map +1 -0
  23. package/lib/exercises/math/geometry/parametric/index.js +19 -0
  24. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts +12 -0
  25. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -0
  26. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +95 -0
  27. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  28. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +66 -24
  29. package/lib/index.d.ts +14 -1
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/math/geometry/parametricLine.d.ts +15 -0
  32. package/lib/math/geometry/parametricLine.d.ts.map +1 -0
  33. package/lib/math/geometry/parametricLine.js +47 -0
  34. package/lib/math/geometry/spacePoint.d.ts +3 -0
  35. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  36. package/lib/math/geometry/spacePoint.js +12 -0
  37. package/lib/math/geometry/spaceVector.d.ts +5 -0
  38. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  39. package/lib/math/geometry/spaceVector.js +20 -0
  40. package/lib/server.js +7 -3
  41. package/lib/tree/parsers/rationalParser.d.ts +2 -0
  42. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  43. package/lib/tree/parsers/rationalParser.js +33 -8
  44. package/lib/tree/parsers/spacePointParser.d.ts +3 -0
  45. package/lib/tree/parsers/spacePointParser.d.ts.map +1 -0
  46. package/lib/tree/parsers/spacePointParser.js +18 -0
  47. package/lib/tree/parsers/spaceVectorParser.d.ts +3 -0
  48. package/lib/tree/parsers/spaceVectorParser.d.ts.map +1 -0
  49. package/lib/tree/parsers/spaceVectorParser.js +18 -0
  50. package/lib/tree/parsers/valueParser.d.ts +2 -0
  51. package/lib/tree/parsers/valueParser.d.ts.map +1 -0
  52. package/lib/tree/parsers/valueParser.js +10 -0
  53. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceVectorParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/spaceVectorParser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,eAAO,MAAM,iBAAiB,QAAS,MAAM,wBAW5C,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spaceVectorParser = void 0;
4
+ const valueParser_1 = require("./valueParser");
5
+ const spaceVector_1 = require("../../math/geometry/spaceVector");
6
+ const spaceVectorParser = (ans) => {
7
+ const formated = ans
8
+ .replaceAll("\\left", "")
9
+ .replaceAll("\\right", "")
10
+ .replaceAll("(", "")
11
+ .replaceAll(")", "");
12
+ const coords = formated.split(";").map((e) => (0, valueParser_1.valueParser)(e));
13
+ if (coords?.some((e) => e === false))
14
+ return false;
15
+ const trees = coords.map((e) => e.toTree());
16
+ return new spaceVector_1.SpaceVector("A", trees[0], trees[1], trees[2]);
17
+ };
18
+ exports.spaceVectorParser = spaceVectorParser;
@@ -0,0 +1,2 @@
1
+ export declare const valueParser: (ans: string) => number | false;
2
+ //# sourceMappingURL=valueParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/valueParser.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAS,MAAM,mBAItC,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.valueParser = void 0;
4
+ const valueParser = (ans) => {
5
+ const nb = ans.unfrenchify();
6
+ if (isNaN(nb))
7
+ return false;
8
+ return nb;
9
+ };
10
+ exports.valueParser = valueParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.48",
3
+ "version": "2.2.49",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [