math-exercises 3.0.14 → 3.0.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,UAAU,YAiBtB,CAAC"}
1
+ {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,YAGtB,CAAC"}
package/lib/playground.js CHANGED
@@ -1,21 +1,5 @@
1
- import { probaLawFlip } from "./utils/alea/probaLawFlip.js";
1
+ import { parseAlgebraic } from "./tree/parsers/latexParser.js";
2
2
  export const playground = () => {
3
- const res = [0, 0, 0];
4
- for (let i = 0; i < 1000; i++) {
5
- const x = probaLawFlip([
6
- [-1, 0.45],
7
- [0, 0.1],
8
- [1, 0.45],
9
- ]);
10
- if (x === -1) {
11
- res[0]++;
12
- }
13
- else if (x === 0) {
14
- res[1]++;
15
- }
16
- else {
17
- res[2]++;
18
- }
19
- }
20
- console.log(res);
3
+ const tex = "\\cos\\left(\\frac{\\pi}{2}\\right)";
4
+ console.log(parseAlgebraic(tex).simplify().toTex());
21
5
  };
@@ -58,7 +58,7 @@ export class CosNode {
58
58
  if (!trigoPoint)
59
59
  return new CosNode(simplifiedChild);
60
60
  else
61
- return trigoPoint.sin;
61
+ return trigoPoint.cos;
62
62
  }
63
63
  else {
64
64
  // Écrire les règles algébriques spécifiques à sin ici
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.14",
4
+ "version": "3.0.15",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [