pimath 0.0.133 → 0.1.0

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 (94) hide show
  1. package/dist/pimath.js +2888 -3590
  2. package/package.json +38 -20
  3. package/types/algebra/equation.d.ts +102 -0
  4. package/types/algebra/equation.d.ts.map +1 -0
  5. package/types/algebra/equationSolver.d.ts +10 -0
  6. package/types/algebra/equationSolver.d.ts.map +1 -0
  7. package/types/algebra/factor.d.ts +46 -0
  8. package/types/algebra/factor.d.ts.map +1 -0
  9. package/types/algebra/linearSystem.d.ts +37 -0
  10. package/types/algebra/linearSystem.d.ts.map +1 -0
  11. package/{dist/maths → types}/algebra/monom.d.ts +95 -133
  12. package/types/algebra/monom.d.ts.map +1 -0
  13. package/types/algebra/polyFactor.d.ts +43 -0
  14. package/types/algebra/polyFactor.d.ts.map +1 -0
  15. package/types/algebra/polynom.d.ts +107 -0
  16. package/types/algebra/polynom.d.ts.map +1 -0
  17. package/types/algebra/rational.d.ts +41 -0
  18. package/types/algebra/rational.d.ts.map +1 -0
  19. package/{dist/maths → types}/coefficients/fraction.d.ts +69 -67
  20. package/types/coefficients/fraction.d.ts.map +1 -0
  21. package/{dist/maths → types}/coefficients/nthRoot.d.ts +4 -7
  22. package/types/coefficients/nthRoot.d.ts.map +1 -0
  23. package/{dist/maths → types}/geometry/circle.d.ts +14 -21
  24. package/types/geometry/circle.d.ts.map +1 -0
  25. package/types/geometry/geomMath.d.ts +9 -0
  26. package/types/geometry/geomMath.d.ts.map +1 -0
  27. package/types/geometry/line.d.ts +83 -0
  28. package/types/geometry/line.d.ts.map +1 -0
  29. package/types/geometry/line3.d.ts +58 -0
  30. package/types/geometry/line3.d.ts.map +1 -0
  31. package/types/geometry/matrix.d.ts +12 -0
  32. package/types/geometry/matrix.d.ts.map +1 -0
  33. package/types/geometry/plane3.d.ts +36 -0
  34. package/types/geometry/plane3.d.ts.map +1 -0
  35. package/types/geometry/point.d.ts +12 -0
  36. package/types/geometry/point.d.ts.map +1 -0
  37. package/{dist/maths → types}/geometry/triangle.d.ts +11 -34
  38. package/types/geometry/triangle.d.ts.map +1 -0
  39. package/types/geometry/vector.d.ts +55 -0
  40. package/types/geometry/vector.d.ts.map +1 -0
  41. package/types/geometry/vector3d.d.ts +37 -0
  42. package/types/geometry/vector3d.d.ts.map +1 -0
  43. package/types/helpers.d.ts +3 -0
  44. package/types/helpers.d.ts.map +1 -0
  45. package/types/index.d.ts +59 -0
  46. package/types/index.d.ts.map +1 -0
  47. package/types/numeric.d.ts +39 -0
  48. package/types/pimath.interface.d.ts +57 -0
  49. package/types/pimath.interface.d.ts.map +1 -0
  50. package/types/randomization/algebra/rndEquation.d.ts +4 -0
  51. package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
  52. package/types/randomization/algebra/rndMonom.d.ts +4 -0
  53. package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
  54. package/types/randomization/algebra/rndPolynom.d.ts +5 -0
  55. package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
  56. package/types/randomization/coefficient/rndFraction.d.ts +4 -0
  57. package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
  58. package/types/randomization/geometry/rndCircle.d.ts +4 -0
  59. package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
  60. package/types/randomization/geometry/rndLine.d.ts +4 -0
  61. package/types/randomization/geometry/rndLine.d.ts.map +1 -0
  62. package/types/randomization/geometry/rndLine3.d.ts +4 -0
  63. package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
  64. package/types/randomization/geometry/rndPoint.d.ts +4 -0
  65. package/types/randomization/geometry/rndPoint.d.ts.map +1 -0
  66. package/types/randomization/random.d.ts +20 -0
  67. package/types/randomization/random.d.ts.map +1 -0
  68. package/types/randomization/rndHelpers.d.ts +21 -0
  69. package/types/randomization/rndTypes.d.ts +64 -0
  70. package/types/randomization/rndTypes.d.ts.map +1 -0
  71. package/dist/main.d.ts +0 -39
  72. package/dist/maths/algebra/equation.d.ts +0 -120
  73. package/dist/maths/algebra/linearSystem.d.ts +0 -40
  74. package/dist/maths/algebra/logicalset.d.ts +0 -28
  75. package/dist/maths/algebra/polynom.d.ts +0 -155
  76. package/dist/maths/algebra/rational.d.ts +0 -44
  77. package/dist/maths/algebra/study/rationalStudy.d.ts +0 -14
  78. package/dist/maths/algebra/study.d.ts +0 -140
  79. package/dist/maths/geometry/line.d.ts +0 -102
  80. package/dist/maths/geometry/point.d.ts +0 -36
  81. package/dist/maths/geometry/vector.d.ts +0 -38
  82. package/dist/maths/numeric.d.ts +0 -28
  83. package/dist/maths/numexp.d.ts +0 -19
  84. package/dist/maths/randomization/random.d.ts +0 -26
  85. package/dist/maths/randomization/randomCore.d.ts +0 -7
  86. package/dist/maths/randomization/rndFraction.d.ts +0 -13
  87. package/dist/maths/randomization/rndGeometryCircle.d.ts +0 -13
  88. package/dist/maths/randomization/rndGeometryLine.d.ts +0 -13
  89. package/dist/maths/randomization/rndGeometryPoint.d.ts +0 -13
  90. package/dist/maths/randomization/rndHelpers.d.ts +0 -23
  91. package/dist/maths/randomization/rndMonom.d.ts +0 -13
  92. package/dist/maths/randomization/rndPolynom.d.ts +0 -14
  93. package/dist/maths/randomization/rndTypes.d.ts +0 -40
  94. package/dist/maths/shutingyard.d.ts +0 -59
package/package.json CHANGED
@@ -1,19 +1,32 @@
1
1
  {
2
2
  "name": "pimath",
3
- "version": "0.0.133",
3
+ "version": "0.1.0",
4
4
  "description": "A math library for teacher :)",
5
5
  "type": "module",
6
- "main": "dist/pimath.js",
7
- "types": "dist/pimath.d.ts",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/pimath.js",
12
+ "require": "./dist/pimath.js"
13
+ },
14
+ "./types": {
15
+ "import": "./types/index.d.ts",
16
+ "require": "./types/index.d.ts"
17
+ }
18
+ },
8
19
  "files": [
9
- "dist"
20
+ "dist",
21
+ "types"
10
22
  ],
11
23
  "scripts": {
12
- "test": "mocha -r ts-node/register 'tests/**/*.test.ts'",
24
+ "test": "vitest",
13
25
  "dev": "vite serve",
14
26
  "build": "tsc --p ./tsconfig-build.json && vite build",
15
27
  "preview": "vite preview",
16
- "docs": "typedoc"
28
+ "docs": "typedoc",
29
+ "dependency-cruise": "dependency-cruise -T dot -x node_modules -v -- src/index.ts | dot -T svg > dependencies.svg"
17
30
  },
18
31
  "keywords": [
19
32
  "math",
@@ -22,19 +35,24 @@
22
35
  "author": "Basil Gass",
23
36
  "license": "MIT",
24
37
  "devDependencies": {
25
- "@types/chai": "*",
26
- "@types/mocha": "*",
27
- "@types/node": "^20.8.2",
28
- "@typescript-eslint/eslint-plugin": "^6.7.4",
29
- "@typescript-eslint/parser": "^6.7.4",
30
- "chai": "*",
31
- "eslint": "^8.50.0",
32
- "mocha": "*",
33
- "ts-loader": "^9.4.4",
34
- "ts-node": "^10.9.1",
35
- "typedoc": "^0.25.1",
36
- "typescript": "^5.2.2",
37
- "vite": "^5.2.10",
38
- "vite-plugin-dts": "^3.9.0"
38
+ "@eslint/js": "^9.4.0",
39
+ "@types/eslint__js": "^8.42.3",
40
+ "autoprefixer": "^10.4.19",
41
+ "dependency-cruiser": "^16.3.10",
42
+ "eslint": "^8.57.0",
43
+ "globals": "^15.3.0",
44
+ "postcss": "^8.4.38",
45
+ "tailwindcss": "^3.4.3",
46
+ "ts-loader": "^9.5.1",
47
+ "ts-node": "^10.9.2",
48
+ "typedoc": "^0.25.13",
49
+ "typescript": "^5.4.5",
50
+ "typescript-eslint": "^7.12.0",
51
+ "vite": "^5.2.12",
52
+ "vite-plugin-dts": "^3.9.1",
53
+ "vitest": "^1.6.0"
54
+ },
55
+ "dependencies": {
56
+ "piexpression": "^0.0.8"
39
57
  }
40
58
  }
@@ -0,0 +1,102 @@
1
+ import { IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
2
+ import { Fraction } from '../coefficients/fraction';
3
+ import { Polynom } from './polynom';
4
+
5
+ export type EQUATION_SIGN = "=" | "<=" | ">=" | "<" | ">";
6
+ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
7
+ #private;
8
+ constructor(equation: InputAlgebra<Polynom> | Equation);
9
+ constructor(left: InputAlgebra<Polynom>, right: InputAlgebra<Polynom>, sign?: EQUATION_SIGN);
10
+ parse: (equationString: string) => this;
11
+ create: (left: Polynom, right: Polynom, sign?: string) => this;
12
+ clone: () => Equation;
13
+ /**
14
+ * Add a value to the equation
15
+ * if value is an equation, add the left part to the left part of the equation
16
+ * and the right part to the right part of the equation
17
+ * if value is a string, try to create an equation
18
+ * if it fails, create a polynom and add it to the left and right part of the equation
19
+ * @param value | Polynom | Monom | Fraction | string | monom
20
+ */
21
+ add(value: InputValue<Equation | Polynom>): this;
22
+ /**
23
+ * Get the degree of the equation
24
+ * @param letter
25
+ */
26
+ degree: (letter?: string) => Fraction;
27
+ /**
28
+ * divide an equation by a given value (transformed as a fraction)
29
+ *
30
+ * ```
31
+ * 8x+10=6x \vert 2
32
+ * 4x+5=3x
33
+ * ```
34
+ *
35
+ * |>Alternatively with $3x-4$ maybe it's working ?
36
+ * $$\frac{3x}{5}$$
37
+ *
38
+ * @param value
39
+ * @returns {Equation}
40
+ */
41
+ divide: (value: InputValue<Fraction>) => this;
42
+ /**
43
+ * Create an Equation using two polynoms.
44
+ * Markdown *support* is cool
45
+ * @param values
46
+ * @param asNumeric
47
+ */
48
+ evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean | undefined): boolean;
49
+ /**
50
+ * Determine if the equation contains a variable.
51
+ * @param letter
52
+ */
53
+ hasVariable: (letter: string) => boolean;
54
+ isEqual(value: InputValue<Equation>): boolean;
55
+ isLinearTo: (equ: Equation) => boolean;
56
+ /**
57
+ * Determine if the equation contains more than one letter/variable.
58
+ */
59
+ isMultiVariable: () => boolean;
60
+ isEqualTo: (equ: Equation) => boolean;
61
+ /**
62
+ * Reorder the polynom to have only one letter on the left, the rest on the right.
63
+ * @param letter
64
+ */
65
+ isolate: (letter?: string) => this | false;
66
+ letters: () => string[];
67
+ /**
68
+ * Reorder will move all monoms containing a letter on the left, all the other on the right.
69
+ */
70
+ moveLeft: () => this;
71
+ /**
72
+ * Multiple an equation by a fraction value.
73
+ * @param value
74
+ */
75
+ multiply: (value: InputValue<Fraction>) => this;
76
+ pow(value: number): this;
77
+ opposite: () => this;
78
+ reduce(): this;
79
+ reorder: (allLeft?: boolean) => this;
80
+ replaceBy: (letter: string, P: Polynom) => this;
81
+ /**
82
+ * Multiply by the lcm denominator and divide by the gcm numerators.
83
+ */
84
+ simplify: () => this;
85
+ solve: () => ISolution[];
86
+ split(): [Polynom, Polynom];
87
+ subtract(value: InputValue<Equation | Polynom>): this;
88
+ test: (values: literalType<Fraction>) => boolean;
89
+ static isEquationString(equationString: string): boolean;
90
+ static makeSolutionsUnique(solutions: ISolution[], sorted?: boolean): ISolution[];
91
+ get display(): string;
92
+ get left(): Polynom;
93
+ set left(value: Polynom);
94
+ get numberOfVars(): number;
95
+ get right(): Polynom;
96
+ set right(value: Polynom);
97
+ get sign(): string;
98
+ set sign(value: string);
99
+ get signAsTex(): string;
100
+ get tex(): string;
101
+ get variables(): string[];
102
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAInD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAMzD,qBAAa,QAAS,YA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,QAAO,IAAI,CAIzB;IAEM,MAAM,IAAI,IAAI;IAwBd,OAAO,aAAc,OAAO,KAAG,IAAI,CAyBzC;IAGM,SAAS,WAAY,MAAM,KAAK,OAAO,KAAG,IAAI,CAIpD;IAKM,QAAQ,QAAO,IAAI,CAIzB;IAGM,KAAK,QAAO,SAAS,EAAE,CAG7B;IAEM,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAI3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IAoBrD,IAAI,WAAY,YAAY,QAAQ,CAAC,KAAG,OAAO,CAErD;WAEa,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO;WAWjD,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE;IAsBxF,IAAW,OAAO,IAAI,MAAM,CAE3B;IAGD,IAAW,IAAI,IAAI,OAAO,CAEzB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,OAAO,EAE7B;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,OAAO,EAE9B;IAGD,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,EAG5B;IAED,IAAW,SAAS,IAAI,MAAM,CAU7B;IAED,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;CA2EJ"}
@@ -0,0 +1,10 @@
1
+ import { ISolution } from '../pimath.interface';
2
+ import { Polynom } from './polynom';
3
+ import { Equation } from './equation';
4
+
5
+ export declare class EquationSolver {
6
+ #private;
7
+ constructor(left: Polynom | Equation, right?: Polynom, variable?: string);
8
+ solve(): ISolution[];
9
+ solveAsCardan(): ISolution[];
10
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,qBAAa,cAAc;;gBAIX,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,SAAM;IAW9D,KAAK,IAAI,SAAS,EAAE;IAuBpB,aAAa,IAAI,SAAS,EAAE;CAkUtC"}
@@ -0,0 +1,46 @@
1
+ import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
2
+ import { Fraction } from '../coefficients/fraction';
3
+ import { Polynom } from './polynom';
4
+
5
+ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor>, IAlgebra<Factor> {
6
+ #private;
7
+ constructor(value: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
8
+ parse(): Factor;
9
+ clone(): Factor;
10
+ add(): Factor;
11
+ get withPower(): this;
12
+ get withRoot(): this;
13
+ get asSingle(): this;
14
+ degree(letter?: string): Fraction;
15
+ derivative(): Factor[];
16
+ develop(): Polynom;
17
+ get display(): string;
18
+ divide(value: InputAlgebra<Factor | Polynom>): this;
19
+ evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
20
+ hasVariable(letter: string): boolean;
21
+ inverse(): this;
22
+ isEqual(value: Factor): boolean;
23
+ isOne(): boolean;
24
+ isSameAs(value: InputAlgebra<Factor | Polynom>): boolean;
25
+ isZero(): boolean;
26
+ multiply(value: InputAlgebra<Factor | Polynom>): this;
27
+ one(): this;
28
+ opposite(): Factor;
29
+ get polynom(): Polynom;
30
+ set polynom(value: Polynom);
31
+ pow(value: number | Fraction): this;
32
+ get power(): Fraction;
33
+ set power(value: InputValue<Fraction>);
34
+ primitive(): Factor;
35
+ reduce(): Factor;
36
+ root(value: number): this;
37
+ sqrt(): this;
38
+ subtract(): Factor;
39
+ get tex(): string;
40
+ get variables(): string[];
41
+ zero(): this;
42
+ }
43
+ export declare enum FACTOR_DISPLAY {
44
+ ROOT = 0,
45
+ POWER = 1
46
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,qBAAa,MAAO,YAChB,aAAa,CAAC,MAAM,CAAC,EACrB,WAAW,CAAC,MAAM,CAAC,EACnB,QAAQ,CAAC,MAAM,CAAC;;gBAMJ,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAmBxE,KAAK,IAAiC,MAAM;IAI5C,KAAK,IAAI,MAAM;IAIf,GAAG,IAAI,MAAM;IAIpB,IAAW,SAAS,IAAI,IAAI,CAG3B;IAED,IAAW,QAAQ,IAAI,IAAI,CAG1B;IACD,IAAW,QAAQ,IAAI,IAAI,CAG1B;IAEM,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ;IAIjC,UAAU,IAAI,MAAM,EAAE;IAoBtB,OAAO,IAAI,OAAO;IAQzB,IAAW,OAAO,IAAI,MAAM,CAyB3B;IAEM,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI;IAkBnD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ;IAS/G,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIpC,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAO/B,KAAK,IAAI,OAAO;IAIhB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC;IAc9C,MAAM,IAAI,OAAO;IAIjB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI;IAkBrD,GAAG,IAAI,IAAI;IAMX,QAAQ,IAAI,MAAM;IAIzB,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAEhC;IAEM,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAK1C,IAAW,KAAK,IAAI,QAAQ,CAE3B;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,EAE3C;IAEM,SAAS,IAAI,MAAM;IAInB,MAAM,IAAI,MAAM;IAIhB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,IAAI,IAAI,IAAI;IAIZ,QAAQ,IAAI,MAAM;IAIzB,IAAW,GAAG,IAAI,MAAM,CAyBvB;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAEM,IAAI,IAAI,IAAI;CAMtB;AAED,oBAAY,cAAc;IACtB,IAAI,IAAA;IACJ,KAAK,IAAA;CACR"}
@@ -0,0 +1,37 @@
1
+ import { IAlgebra, IEquation, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
2
+ import { Fraction } from '../coefficients/fraction';
3
+ import { Equation } from './equation';
4
+ import { Polynom } from './polynom';
5
+
6
+ /**
7
+ * Linear system of equations
8
+ * @class LinearSystem
9
+ */
10
+ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
11
+ #private;
12
+ constructor(...values: (string | Equation)[]);
13
+ parse: (...equations: (string | Equation)[]) => this;
14
+ clone: () => LinearSystem;
15
+ static fromMatrix(matrix: InputValue<Fraction>[][], letters?: string): LinearSystem;
16
+ add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
17
+ buildTex: (equations: Equation[], operators?: (string[])[]) => string;
18
+ degree(letter?: string | undefined): Fraction;
19
+ get display(): string;
20
+ get equations(): Equation[];
21
+ set equations(value: Equation[]);
22
+ evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean | undefined): number | Fraction;
23
+ hasVariable(letter: string): boolean;
24
+ isEqual(value: LinearSystem): boolean;
25
+ get isSolvable(): boolean;
26
+ get matrix(): [Fraction[][], Fraction[]];
27
+ mergeEquations: (eq1: Equation, eq2: Equation, factor1: Fraction, factor2: Fraction) => Equation;
28
+ multiply(value: InputValue<Fraction> | InputValue<Fraction>[], index?: number): this;
29
+ reduce(): LinearSystem;
30
+ reorder: () => this;
31
+ solve(): ISolution[];
32
+ solveMatrix: () => Fraction[];
33
+ subtract(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
34
+ get tex(): string;
35
+ get variables(): string[];
36
+ set variables(value: string | string[]);
37
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linearSystem.d.ts","sourceRoot":"","sources":["../../src/algebra/linearSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAA;AAC/G,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAC,OAAO,EAAC,MAAM,WAA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AQ,WAAW,QAAQ,KAAG,QAAQ,CAWrG;IAEM,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAwBpF,MAAM,IAAI,YAAY;IAKtB,OAAO,QAAO,IAAI,CAMxB;IAED,KAAK,IAAI,SAAS,EAAE;IAIb,WAAW,QAAO,QAAQ,EAAE,CA0ClC;IAEM,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqB3F,IAAW,GAAG,IAAI,MAAM,CAQvB;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAI5C;CA2CJ"}
@@ -1,207 +1,169 @@
1
+ import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
1
2
  import { Fraction } from '../coefficients/fraction';
2
- import { Token } from '../shutingyard.ts';
3
3
 
4
- export type literalType = {
5
- [Key: string]: Fraction;
6
- };
7
- export declare class Monom {
8
- private _coefficient;
9
- private _literal;
4
+ export declare class Monom implements IPiMathObject<Monom>, IExpression<Monom>, IAnalyse<Monom>, IAlgebra<Monom> {
5
+ #private;
6
+ constructor(value?: InputValue<Fraction>);
7
+ constructor(value?: Monom);
10
8
  /**
11
- * Create a Monom
12
- * Defined as \\(k \\cdot x^{n}\\), where \\( k,n \in \\mathbb{Q}\\).
13
- * Examples: \\(3x^2\\) or \\(3/5x^2\\)
14
- * @param value (optional) string The value that should be parse. Can be a Monom, a Fraction, a string or a number. If nothing is provided, it will return the trivial monom (0).
9
+ * Parse a string to a monom. The string may include fraction.
10
+ * @param inputStr
15
11
  */
16
- constructor(value?: unknown);
12
+ parse(inputStr: InputAlgebra<Monom>): this;
17
13
  /**
18
- * Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
19
- * @returns {Fraction}
14
+ * Clone the current Monom.
20
15
  */
21
- get coefficient(): Fraction;
16
+ clone: () => Monom;
17
+ static gcd: (...monoms: Monom[]) => Monom;
22
18
  /**
23
- * Set the coefficient \\(k\\) value of the monom
24
- * @param {Fraction | number | string} F
19
+ * Multiply two monoms and return a NEW monom.
20
+ * @param monoms
25
21
  */
26
- set coefficient(F: Fraction | number | string);
22
+ static xMultiply: (...monoms: Monom[]) => Monom;
27
23
  /**
28
- * Get the literal part of \\(x^{n_1}y^{n_2}\\) as dictionary \\[\\begin{array}{ll}x&=n_1\\\\y&=n_2\\end{array}\\]
29
- * @returns {literalType}
24
+ * Add all similar monoms. If they aren't similar, they are simply skipped.
25
+ * @param M (Monom[]) The monoms to add.
30
26
  */
31
- get literal(): literalType;
27
+ add: (...M: InputAlgebra<Fraction>[]) => this;
32
28
  /**
33
- * Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
34
- * @param {literalType} L
29
+ * Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
30
+ * @returns {Fraction}
35
31
  */
36
- set literal(L: literalType);
32
+ get coefficient(): Fraction;
37
33
  /**
38
- * Get the literal square roots of the Monom.
39
- * TODO: remove this getter ? Is it used and is it correct ?
40
- * @returns {literalType}
34
+ * Set the coefficient \\(k\\) value of the monom
35
+ * @param {Fraction | number | string} F
41
36
  */
42
- get literalSqrt(): literalType;
37
+ set coefficient(F: InputValue<Fraction>);
38
+ containsRationalPower: () => boolean;
43
39
  /**
44
- * Set the literal part of the monom from a string
45
- * @param inputStr String like x^2y^3
40
+ * Get the degree of a monom. If no setLetter is given, the result will be the global degree.
41
+ * @param letter (string) Letter to get to degree (power)
46
42
  */
47
- set literalStr(inputStr: string);
43
+ degree: (letter?: string) => Fraction;
48
44
  /**
49
- * Get the variables letters
45
+ * Derivative the monom
46
+ * @param letter
50
47
  */
51
- get variables(): string[];
48
+ derivative: (letter?: string) => Monom;
52
49
  /**
53
50
  * This display getter is to be used in the polynom display getter
54
51
  */
55
52
  get display(): string;
56
- get dividers(): Monom[];
57
- /**
58
- * Display the monom, forcing the '+' sign to appear
59
- */
60
- get displayWithSign(): string;
61
- get texWithSign(): string;
62
- get plotFunction(): string;
63
53
  /**
64
- * Get the tex output of the monom
54
+ * Divide the current monoms by multiple monoms
55
+ * @param M (Monom[])
65
56
  */
66
- get tex(): string;
57
+ divide: (...M: InputAlgebra<Fraction>[]) => this;
58
+ get dividers(): Monom[];
67
59
  /**
68
- * Get the least common multiple of monoms
69
- * @param monoms Array of monoms
60
+ * Evaluate a monom. Each setLetter must be assigned to a Fraction.
61
+ * @param values Dictionary of <setLetter: Fraction>
62
+ * @param asNumeric
70
63
  */
71
- static lcm: (...monoms: Monom[]) => Monom;
64
+ evaluate: (values: literalType<number | Fraction> | InputValue<Fraction>, asNumeric?: boolean) => Fraction | number;
72
65
  /**
73
- * Multiply two monoms and return a NEW monom.
74
- * @param monoms
66
+ * Determine if a monom contains a setLetter in it's literal part
67
+ * @param letter
75
68
  */
76
- static xmultiply: (...monoms: Monom[]) => Monom;
69
+ hasVariable: (letter?: string) => boolean;
70
+ integrate(a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string | undefined): Fraction;
71
+ inverse: () => this;
72
+ isDivisible: (div: Monom) => boolean;
77
73
  /**
78
- * Parse a string to a monom. The string may include fraction.
79
- * @param inputStr
74
+ * Determine if two monoms are equals
75
+ * @param M
80
76
  */
81
- parse: (inputStr: unknown) => Monom;
82
- addToken: (stack: Monom[], element: Token) => void;
77
+ isEqual: (M: Monom) => boolean;
78
+ isLiteralSquare: () => boolean;
83
79
  /**
84
- * Clone the current Monom.
80
+ * Determine if the monom is one
85
81
  */
86
- clone: () => Monom;
87
- copyLiterals: (literal: literalType) => literalType;
88
- makeSame: (M: Monom) => Monom;
82
+ isOne: () => boolean;
89
83
  /**
90
- * Create a zero value monom
84
+ * Determine if two monoms are similar
85
+ * @param M
91
86
  */
92
- zero: () => Monom;
87
+ isSameAs: (M: Monom) => boolean;
88
+ isSquare: () => boolean;
93
89
  /**
94
- * Create a one value monom
90
+ * Determine if the monom is null
95
91
  */
96
- one: () => Monom;
92
+ isZero: () => boolean;
97
93
  /**
98
- * Clean the monom by removing each letters with a power of zero.
94
+ * Get the literal part of \\(x^{n_1}y^{n_2}\\) as dictionary \\[\\begin{array}{ll}x&=n_1\\\\y&=n_2\\end{array}\\]
95
+ * @returns {literalType}
99
96
  */
100
- clean: () => Monom;
101
- reduce: () => Monom;
97
+ get literal(): literalType<Fraction>;
102
98
  /**
103
- * Get the opposed
104
- * Returns a monom.
99
+ * Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
100
+ * @param {literalType<Fraction>} L
105
101
  */
106
- opposed: () => Monom;
102
+ set literal(L: literalType<Fraction>);
107
103
  /**
108
- * Add all similar monoms. If they aren't similar, they are simply skipped.
109
- * @param M (Monom[]) The monoms to add.
104
+ * Get the literal square roots of the Monom.
105
+ * TODO: remove this getter ? Is it used and is it correct ?
106
+ * @returns {literalType<Fraction>}
110
107
  */
111
- add: (...M: Monom[]) => Monom;
108
+ get literalSqrt(): literalType<Fraction>;
112
109
  /**
113
- * Subtract multiple monoms
114
- * @param M (Monom[]) The monoms to subtract
110
+ * Set the literal part of the monom from a string
111
+ * @param inputStr String like x^2y^3
115
112
  */
116
- subtract: (...M: Monom[]) => Monom;
113
+ set literalStr(inputStr: string);
117
114
  /**
118
115
  * Multiple multiple monoms to the current monom
119
116
  * @param M (Monom[]) The monoms to multiply to.
120
117
  */
121
- multiply: (...M: Monom[]) => Monom;
122
- multiplyByNumber: (F: Fraction | number) => Monom;
118
+ multiply: (...M: InputAlgebra<Fraction>[]) => this;
123
119
  /**
124
- * Divide the current monoms by multiple monoms
125
- * @param M (Monom[])
120
+ * Create a one value monom
126
121
  */
127
- divide: (...M: Monom[]) => Monom;
122
+ one: () => this;
123
+ /**
124
+ * Get the opposite
125
+ * Returns a monom.
126
+ */
127
+ opposite: () => this;
128
+ get plotFunction(): string;
128
129
  /**
129
130
  * Get the pow of a monom.
130
131
  * @param nb (number) : Mathematical pow
131
132
  */
132
- pow: (nb: number | Fraction) => Monom;
133
+ pow: (nb: number | Fraction) => this;
134
+ primitive: (letter?: string) => Monom;
135
+ reduce: () => this;
136
+ removeVariable(letter: string): void;
133
137
  /**
134
138
  * Get the nth-root of the monom
135
- * @param p
136
- */
137
- root: (p: number) => Monom;
138
- /**
139
- * Return the square root of a monom
140
- */
141
- sqrt: () => Monom;
142
- compare: (M: Monom, sign?: string) => boolean;
143
- /**
144
- * Determine if the monom is null
145
- */
146
- isZero(): boolean;
147
- /**
148
- * Determine if the monom is one
149
- */
150
- isOne(): boolean;
151
- /**
152
- * Determine if two monoms are equals
153
- * @param M
154
139
  */
155
- isEqual: (M: Monom) => boolean;
156
- /**
157
- * Determine if two monoms are similar
158
- * @param M
159
- */
160
- isSameAs: (M: Monom) => boolean;
161
- isSquare: () => boolean;
162
- isLiteralSquare: () => boolean;
163
- hasFractionCoefficient: () => boolean;
164
- /**
165
- * Determine if a monom contains a setLetter in it's literal part
166
- * @param letter
167
- */
168
- hasLetter: (letter?: string) => boolean;
140
+ root: () => this;
169
141
  /**
170
142
  * Set the power of a particular setLetter
171
143
  * @param letter (string) Letter to change
172
144
  * @param pow (number) Power of the setLetter (must be positive integer.
173
145
  */
174
- setLetter: (letter: string, pow: Fraction | number) => void;
146
+ setLetter: (letter: string, pow: InputValue<Fraction>) => this;
175
147
  /**
176
- * Get the degree of a monom. If no setLetter is given, the result will be the global degree.
177
- * @param letter (string) Letter to get to degree (power)
148
+ * Return the square root of a monom
178
149
  */
179
- degree: (letter?: string) => Fraction;
150
+ sqrt: () => this;
180
151
  /**
181
- * Evaluate a monom. Each setLetter must be assigned to a Fraction.
182
- * @param values Dictionary of <setLetter: Fraction>
152
+ * Subtract multiple monoms
153
+ * @param M (Monom[]) The monoms to subtract
183
154
  */
184
- evaluate: (values: literalType | Fraction | number) => Fraction;
185
- evaluateAsNumeric: (values: number | {
186
- [Key: string]: number;
187
- }) => number;
155
+ subtract: (...M: InputAlgebra<Fraction>[]) => this;
188
156
  /**
189
- * Derivative the monom
190
- * @param letter
157
+ * Get the tex output of the monom
191
158
  */
192
- derivative: (letter?: string) => Monom;
193
- primitive: (letter?: string) => Monom;
159
+ get tex(): string;
194
160
  /**
195
- * Determine if multiple monoms are similar
196
- * @param M
161
+ * Get the variables letters
197
162
  */
198
- areSameAs: (...M: Monom[]) => boolean;
163
+ get variables(): string[];
199
164
  /**
200
- * Determine if multiple monoms are equals
201
- * @param M
165
+ * Create a zero value monom
202
166
  */
203
- areEquals: (...M: Monom[]) => boolean;
204
- isDivisible: (div: Monom) => boolean;
167
+ zero: () => this;
205
168
  private _getLiteralDividers;
206
- private _shutingYardToReducedMonom;
207
169
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monom.d.ts","sourceRoot":"","sources":["../../src/algebra/monom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAMnD,qBAAa,KAAM,YAAW,aAAa,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;;gBAIxF,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;gBAC5B,KAAK,CAAC,EAAE,KAAK;IAkBlB,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI;IAwB1C,KAAK,QAAO,KAAK,CAUvB;IAED,OAAc,GAAG,cAAe,KAAK,EAAE,KAAG,KAAK,CAiC9C;IAMD,OAAc,SAAS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,IAAI,WAAW,CAAC,QAAQ,CAAC,CAW9C;IAMD,IAAW,UAAU,CAAC,QAAQ,EAAE,MAAM,EAyBrC;IAMM,QAAQ,SAAU,aAAa,QAAQ,CAAC,EAAE,KAAG,IAAI,CAkBvD;IAKM,GAAG,QAAO,IAAI,CAIpB;IAMM,QAAQ,QAAO,IAAI,CAGzB;IAED,IAAW,YAAY,IAAI,MAAM,CAgChC;IAMM,GAAG,OAAQ,MAAM,GAAG,QAAQ,KAAG,IAAI,CAMzC;IAMM,SAAS,YAAa,MAAM,KAAG,KAAK,CAyB1C;IAEM,MAAM,QAAO,IAAI,CAWvB;IAEM,cAAc,CAAC,MAAM,EAAE,MAAM;IAS7B,IAAI,QAAO,IAAI,CAErB;IAOM,SAAS,WAAY,MAAM,OAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAcnE;IAKM,IAAI,QAAO,IAAI,CASrB;IAMM,QAAQ,SAAU,aAAa,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBvD;IAKD,IAAW,GAAG,IAAI,MAAM,CAgCvB;IAMD,IAAW,SAAS,IAAI,MAAM,EAAE,CAa/B;IAKM,IAAI,QAAO,IAAI,CAIrB;IAgDD,OAAO,CAAC,mBAAmB;CA+G9B"}
@@ -0,0 +1,43 @@
1
+ import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
2
+ import { Fraction } from '../coefficients/fraction';
3
+ import { Factor } from './factor';
4
+ import { Polynom } from './polynom';
5
+
6
+ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
7
+ #private;
8
+ constructor(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]);
9
+ parse(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]): this;
10
+ clone(): PolyFactor;
11
+ add(...values: PolyFactor[]): this;
12
+ degree(letter?: string): Fraction;
13
+ derivative(): this;
14
+ develop(): Polynom;
15
+ divide(value: PolyFactor): this;
16
+ evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
17
+ hasVariable(letter: string): boolean;
18
+ inverse(): this;
19
+ isEqual(value: PolyFactor): boolean;
20
+ isOne(): boolean;
21
+ isZero(): boolean;
22
+ multiply(...values: PolyFactor[]): this;
23
+ one(): this;
24
+ opposite(): this;
25
+ pow(value: number | Fraction): this;
26
+ primitive(): PolyFactor;
27
+ reduce(): this;
28
+ root(value: number): this;
29
+ sort(): this;
30
+ sqrt(): this;
31
+ subtract(...values: PolyFactor[]): this;
32
+ zero(): this;
33
+ static gcd(...values: PolyFactor[]): PolyFactor;
34
+ get factors(): Factor[];
35
+ set factors(value: Factor[]);
36
+ get variables(): string[];
37
+ get asRoot(): this;
38
+ get asPower(): this;
39
+ get numerator(): Factor[];
40
+ get denominator(): Factor[];
41
+ get display(): string;
42
+ get tex(): string;
43
+ }