pimath 0.2.8 → 0.2.9

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 (50) hide show
  1. package/dist/pimath.js +5581 -5042
  2. package/dist/pimath.js.map +1 -1
  3. package/package.json +16 -16
  4. package/src/algebra/equation.ts +21 -22
  5. package/src/algebra/polynom.ts +19 -16
  6. package/types/algebra/equation.d.ts +6 -58
  7. package/types/algebra/equation.d.ts.map +1 -1
  8. package/types/algebra/equationSolver.d.ts +4 -3
  9. package/types/algebra/factor.d.ts +4 -3
  10. package/types/algebra/index.d.ts +1 -0
  11. package/types/algebra/linearSystem.d.ts +6 -5
  12. package/types/algebra/logicalset.d.ts +1 -7
  13. package/types/algebra/matrix.d.ts +4 -3
  14. package/types/algebra/monom.d.ts +3 -115
  15. package/types/algebra/operations.d.ts +2 -1
  16. package/types/algebra/polyFactor.d.ts +6 -14
  17. package/types/algebra/polynom.d.ts +6 -36
  18. package/types/algebra/polynom.d.ts.map +1 -1
  19. package/types/analyze/index.d.ts +3 -2
  20. package/types/analyze/solution.d.ts +4 -3
  21. package/types/analyze/tableOfSigns.d.ts +4 -3
  22. package/types/coefficients/fraction.d.ts +2 -14
  23. package/types/coefficients/index.d.ts +1 -0
  24. package/types/coefficients/root.d.ts +3 -5
  25. package/types/geometry/TupleN.d.ts +3 -2
  26. package/types/geometry/circle.d.ts +6 -15
  27. package/types/geometry/geomMath.d.ts +4 -3
  28. package/types/geometry/index.d.ts +1 -0
  29. package/types/geometry/line.d.ts +7 -16
  30. package/types/geometry/line3.d.ts +5 -9
  31. package/types/geometry/plane3.d.ts +6 -5
  32. package/types/geometry/point.d.ts +6 -5
  33. package/types/geometry/sphere3.d.ts +5 -4
  34. package/types/geometry/triangle.d.ts +6 -12
  35. package/types/geometry/vector.d.ts +5 -4
  36. package/types/helpers.d.ts +1 -0
  37. package/types/index.d.ts +22 -21
  38. package/types/numeric.d.ts +1 -16
  39. package/types/pimath.interface.d.ts +5 -4
  40. package/types/randomization/algebra/rndEquation.d.ts +3 -2
  41. package/types/randomization/algebra/rndMonom.d.ts +3 -2
  42. package/types/randomization/algebra/rndPolynom.d.ts +3 -2
  43. package/types/randomization/coefficient/rndFraction.d.ts +3 -2
  44. package/types/randomization/geometry/rndCircle.d.ts +3 -2
  45. package/types/randomization/geometry/rndLine.d.ts +3 -2
  46. package/types/randomization/geometry/rndLine3.d.ts +3 -2
  47. package/types/randomization/geometry/rndVector.d.ts +3 -2
  48. package/types/randomization/random.d.ts +11 -10
  49. package/types/randomization/rndHelpers.d.ts +1 -14
  50. package/types/randomization/rndTypes.d.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pimath",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "A math library for teacher :)",
5
5
  "type": "module",
6
6
  "main": "dist/pimath.js",
@@ -38,22 +38,22 @@
38
38
  "url": "git+https://github.com/basilgass/PiMath.git"
39
39
  },
40
40
  "devDependencies": {
41
- "@tailwindcss/vite": "^4.1.18",
42
- "@vitejs/plugin-vue": "^6.0.4",
43
- "autoprefixer": "^10.4.24",
44
- "dependency-cruiser": "^17.3.8",
45
- "eslint": "^9.39.2",
46
- "globals": "^17.3.0",
47
- "tailwindcss": "^4.1.18",
48
- "ts-loader": "^9.5.4",
41
+ "@tailwindcss/vite": "^4.3.2",
42
+ "@types/eslint": "^9.6.1",
43
+ "@vitejs/plugin-vue": "^6.0.7",
44
+ "autoprefixer": "^10.5.2",
45
+ "dependency-cruiser": "^18.0.0",
46
+ "eslint": "^10.6.0",
47
+ "globals": "^17.7.0",
48
+ "tailwindcss": "^4.3.2",
49
+ "ts-loader": "^9.6.2",
49
50
  "ts-node": "^10.9.2",
50
- "typedoc": "^0.28.16",
51
- "typescript": "^5.9.3",
52
- "typescript-eslint": "^8.54.0",
53
- "vite": "^7.3.1",
54
- "vite-plugin-dts": "^4.5.4",
55
- "vitest": "^4.0.18",
56
- "vue-router": "^5.0.2"
51
+ "typedoc": "^0.28.20",
52
+ "typescript": "^6.0.3",
53
+ "typescript-eslint": "^8.63.0",
54
+ "vite": "^8.1.4",
55
+ "vitest": "^4.1.10",
56
+ "vue-router": "^5.1.0"
57
57
  },
58
58
  "dependencies": {
59
59
  "piexpression": "^0.1.3"
@@ -7,15 +7,14 @@ import type {
7
7
  IPiMathObject,
8
8
  literalType
9
9
  } from "../pimath.interface"
10
- import {Fraction} from "../coefficients/fraction"
10
+ import {Fraction} from "../coefficients"
11
11
  import {Numeric} from "../numeric"
12
12
  import {EquationSolver} from "./equationSolver"
13
13
  import {Monom} from "./monom"
14
14
  import {Polynom} from "./polynom"
15
- import type {Solution} from "../analyze/solution"
15
+ import type {Solution} from "../analyze"
16
16
 
17
- export class Equation implements
18
- IPiMathObject<Equation>,
17
+ export class Equation implements IPiMathObject<Equation>,
19
18
  IEquation<Equation>,
20
19
  IAlgebra<Equation> {
21
20
 
@@ -96,15 +95,15 @@ export class Equation implements
96
95
  }
97
96
 
98
97
  public static makeSolutionsUnique(solutions: Solution[], sorted?: boolean): Solution[] {
99
- const solutionAsTex: string[] = [],
100
- uniqueSolutions = solutions.filter(sol => {
101
- if (!solutionAsTex.includes(sol.tex)) {
102
- solutionAsTex.push(sol.tex)
103
- return true
104
- } else {
105
- return false
106
- }
107
- })
98
+ const solutionAsTex: string[] = []
99
+ const uniqueSolutions = solutions.filter(sol => {
100
+ if (!solutionAsTex.includes(sol.tex)) {
101
+ solutionAsTex.push(sol.tex)
102
+ return true
103
+ } else {
104
+ return false
105
+ }
106
+ })
108
107
 
109
108
  if (sorted === true) {
110
109
  uniqueSolutions.sort((a, b) => a.value - b.value)
@@ -191,13 +190,13 @@ export class Equation implements
191
190
  * @param values
192
191
  * @param asNumeric
193
192
  */
194
- public evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean ): boolean {
193
+ public evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric: boolean): boolean {
195
194
  // Evaluate the left and right part of the equation.
196
195
  // compare the results.
197
196
 
198
197
  // Evaluate the left and right part of the equation.
199
- const left = this.#left.evaluate(values, asNumeric),
200
- right = this.#right.evaluate(values, asNumeric)
198
+ const left = this.#left.evaluate(values, asNumeric)
199
+ const right = this.#right.evaluate(values, asNumeric)
201
200
 
202
201
  // compare the results.
203
202
  if (asNumeric) {
@@ -227,8 +226,8 @@ export class Equation implements
227
226
 
228
227
  // Equations helpers
229
228
  public isEqualTo = (equ: Equation): boolean => {
230
- const p1 = equ.clone().moveLeft().left,
231
- p2 = this.clone().moveLeft().left
229
+ const p1 = equ.clone().moveLeft().left
230
+ const p2 = this.clone().moveLeft().left
232
231
 
233
232
  // They are the same.
234
233
  return p1.isEqual(p2) || p1.isOppositeAt(p2)
@@ -236,8 +235,8 @@ export class Equation implements
236
235
 
237
236
  public isLinearTo = (equ: Equation): boolean => {
238
237
  // Move all left.
239
- const p1 = equ.clone().moveLeft().simplify().left,
240
- p2 = this.clone().moveLeft().simplify().left
238
+ const p1 = equ.clone().moveLeft().simplify().left
239
+ const p2 = this.clone().moveLeft().simplify().left
241
240
 
242
241
  // They are the same.
243
242
  return p1.isEqual(p2) || p1.isOppositeAt(p2)
@@ -427,7 +426,7 @@ export class Equation implements
427
426
  // Set the sign value as formatted.
428
427
  this.#sign = this.#formatSign(value)
429
428
  }
430
-
429
+
431
430
  public get signAsTex(): string {
432
431
  if (this.#sign === '>=') {
433
432
  return '\\geq'
@@ -480,7 +479,7 @@ export class Equation implements
480
479
  }
481
480
 
482
481
  public test = (values: literalType<Fraction>): boolean => {
483
- return (this.left.evaluate(values) as Fraction).isEqual(this.right.evaluate(values))
482
+ return (this.left.evaluate(values)).isEqual(this.right.evaluate(values))
484
483
  }
485
484
 
486
485
  public get variables(): string[] {
@@ -136,7 +136,7 @@ export class Polynom implements IPiMathObject<Polynom>,
136
136
 
137
137
  for (const value of values) {
138
138
  if (value instanceof Polynom) {
139
- this.#monoms = this.#monoms.concat(value.monoms.map(m=>m.clone()))
139
+ this.#monoms = this.#monoms.concat(value.monoms.map(m => m.clone()))
140
140
  } else if (value instanceof Monom) {
141
141
  this.#monoms.push(value.clone())
142
142
  } else if (typeof value === "number" && Number.isSafeInteger(value)) {
@@ -279,8 +279,11 @@ export class Polynom implements IPiMathObject<Polynom>,
279
279
  return {quotient, reminder}
280
280
  }
281
281
 
282
+ public evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric: true): number
283
+ public evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: false): Fraction
284
+ public evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean): Fraction | number
282
285
  public evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean): Fraction | number {
283
- // Return the numeric value, without using Fraction
286
+ // Return the numeric value without using Fraction
284
287
  if (asNumeric) {
285
288
  return this.#evaluateAsNumeric(values)
286
289
  }
@@ -304,7 +307,7 @@ export class Polynom implements IPiMathObject<Polynom>,
304
307
  this.#factors = []
305
308
 
306
309
  // There is only one monom - it's already considered as factor.
307
- if(this.monoms.length===1) return [this.clone()]
310
+ if (this.monoms.length === 1) return [this.clone()]
308
311
 
309
312
  let P = this.clone().reorder()
310
313
 
@@ -400,7 +403,7 @@ export class Polynom implements IPiMathObject<Polynom>,
400
403
  const orderedPolynom = this.clone().reorder()
401
404
 
402
405
  const length = this.degree().value + 1
403
- const coeffs = Array.from({length}, ()=>new Fraction(0))
406
+ const coeffs = Array.from({length}, () => new Fraction(0))
404
407
 
405
408
  orderedPolynom.monoms.forEach(monom => {
406
409
  const index = length - monom.degree().value - 1
@@ -445,13 +448,13 @@ export class Polynom implements IPiMathObject<Polynom>,
445
448
  public integrate(a: InputValue<Fraction>, b: InputValue<Fraction>, letter = 'x'): Fraction {
446
449
  const primitive = this.primitive(letter)
447
450
 
448
- const valuesA: literalType<Fraction> = {},
449
- valuesB: literalType<Fraction> = {}
451
+ const valuesA: literalType<Fraction> = {}
452
+ const valuesB: literalType<Fraction> = {}
450
453
 
451
454
  valuesA[letter] = new Fraction(a)
452
455
  valuesB[letter] = new Fraction(b)
453
456
 
454
- return (primitive.evaluate(valuesB) as Fraction).subtract(primitive.evaluate(valuesA))
457
+ return (primitive.evaluate(valuesB)).subtract(primitive.evaluate(valuesA))
455
458
  }
456
459
 
457
460
  public inverse(): Polynom | undefined {
@@ -494,7 +497,7 @@ export class Polynom implements IPiMathObject<Polynom>,
494
497
  const zero = div.getZeroes()[0]
495
498
 
496
499
  if (zero.exact) {
497
- return (this.evaluate(zero.fraction) as Fraction).isZero()
500
+ return (this.evaluate(zero.fraction)).isZero()
498
501
  } else {
499
502
  return false
500
503
  }
@@ -548,7 +551,7 @@ export class Polynom implements IPiMathObject<Polynom>,
548
551
  // Finite value: evaluate directly
549
552
  if (f.isFinite()) {
550
553
  const l = letter ?? this.variables[0] ?? 'x'
551
- return this.evaluate({[l]: f}) as Fraction
554
+ return this.evaluate({[l]: f})
552
555
  }
553
556
 
554
557
  const M = this.monomByDegree(undefined, letter)
@@ -747,8 +750,8 @@ export class Polynom implements IPiMathObject<Polynom>,
747
750
  public reorder(letter = 'x', revert = false): this {
748
751
  const otherLetters = this.variables.filter(x => x !== letter)
749
752
  this.#monoms.sort(function (a, b) {
750
- const da = a.degree(letter).value,
751
- db = b.degree(letter).value
753
+ const da = a.degree(letter).value
754
+ const db = b.degree(letter).value
752
755
 
753
756
  // Values are different
754
757
  if (da !== db) {
@@ -758,8 +761,8 @@ export class Polynom implements IPiMathObject<Polynom>,
758
761
  // if values are equals, check other letters - it must be reverted in that case !
759
762
  if (otherLetters.length > 0) {
760
763
  for (const L of otherLetters) {
761
- const da = a.degree(L).value,
762
- db = b.degree(L).value
764
+ const da = a.degree(L).value
765
+ const db = b.degree(L).value
763
766
 
764
767
  // Values are different
765
768
  if (da !== db) {
@@ -889,7 +892,7 @@ export class Polynom implements IPiMathObject<Polynom>,
889
892
  ]
890
893
 
891
894
  testingRoots.forEach((test, index) => {
892
- const sign = this.evaluate({[this.variables[0] ?? 'x']: test}, true) as number
895
+ const sign = this.evaluate({[this.variables[0] ?? 'x']: test}, true)
893
896
  signs[index * 2] = sign > 0 ? '+' : '-'
894
897
  })
895
898
  }
@@ -1128,8 +1131,8 @@ export class Polynom implements IPiMathObject<Polynom>,
1128
1131
 
1129
1132
  case ShutingyardType.OPERATION:
1130
1133
  if (stack.length >= 2) {
1131
- const b = stack.pop(),
1132
- a = stack.pop()
1134
+ const b = stack.pop()
1135
+ const a = stack.pop()
1133
1136
 
1134
1137
  // Check if the polynoms are not undefined.
1135
1138
  if (a === undefined || b === undefined) {
@@ -1,7 +1,7 @@
1
- import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
2
- import { Fraction } from '../coefficients/fraction';
3
- import { Polynom } from './polynom';
4
- import { Solution } from '../analyze/solution';
1
+ import type { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, literalType } from "../pimath.interface";
2
+ import { Fraction } from "../coefficients";
3
+ import { Polynom } from "./polynom";
4
+ import type { Solution } from "../analyze";
5
5
  export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
6
6
  #private;
7
7
  constructor(equation: InputAlgebra<Polynom> | Equation);
@@ -12,71 +12,21 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
12
12
  get display(): string;
13
13
  static isEquationString(equationString: string): boolean;
14
14
  static makeSolutionsUnique(solutions: Solution[], sorted?: boolean): Solution[];
15
- /**
16
- * Add a value to the equation
17
- * if value is an equation, add the left part to the left part of the equation
18
- * and the right part to the right part of the equation
19
- * if value is a string, try to create an equation
20
- * if it fails, create a polynom and add it to the left and right part of the equation
21
- * @param value | Polynom | Monom | Fraction | string | monom
22
- */
23
15
  add(value: InputValue<Equation | Polynom>): this;
24
16
  create: (left: Polynom, right: Polynom, sign?: string) => this;
25
- /**
26
- * Get the degree of the equation
27
- * @param letter
28
- */
29
17
  degree: (letter?: string) => Fraction;
30
- /**
31
- * divide an equation by a given value (transformed as a fraction)
32
- *
33
- * ```
34
- * 8x+10=6x \vert 2
35
- * 4x+5=3x
36
- * ```
37
- *
38
- * |>Alternatively with $3x-4$ maybe it's working ?
39
- * $$\frac{3x}{5}$$
40
- *
41
- * @param value
42
- * @returns {Equation}
43
- */
44
18
  divide: (value: InputValue<Fraction>) => this;
45
- /**
46
- * Create an Equation using two polynoms.
47
- * Markdown *support* is cool
48
- * @param values
49
- * @param asNumeric
50
- */
51
- evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): boolean;
52
- /**
53
- * Determine if the equation contains a variable.
54
- * @param letter
55
- */
19
+ evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric: boolean): boolean;
56
20
  hasVariable: (letter: string) => boolean;
57
21
  isEqual(value: InputValue<Equation>): boolean;
58
22
  isEqualTo: (equ: Equation) => boolean;
59
23
  isLinearTo: (equ: Equation) => boolean;
60
- /**
61
- * Determine if the equation contains more than one letter/variable.
62
- */
63
24
  isMultiVariable: () => boolean;
64
- /**
65
- * Reorder the polynom to have only one letter on the left, the rest on the right.
66
- * @param letter
67
- */
68
25
  isolate: (letter?: string) => this | false;
69
26
  get left(): Polynom;
70
27
  set left(value: Polynom);
71
28
  letters: () => string[];
72
- /**
73
- * Reorder will move all monoms containing a letter on the left, all the other on the right.
74
- */
75
29
  moveLeft: () => this;
76
- /**
77
- * Multiple an equation by a fraction value.
78
- * @param value
79
- */
80
30
  multiply: (value: InputValue<Fraction>) => this;
81
31
  get numberOfVars(): number;
82
32
  opposite: () => this;
@@ -89,9 +39,6 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
89
39
  get sign(): string;
90
40
  set sign(value: string);
91
41
  get signAsTex(): string;
92
- /**
93
- * Multiply by the lcm denominator and divide by the gcm numerators.
94
- */
95
42
  simplify: () => this;
96
43
  solve: () => Solution[];
97
44
  split(): [Polynom, Polynom];
@@ -99,3 +46,4 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
99
46
  test: (values: literalType<Fraction>) => boolean;
100
47
  get variables(): string[];
101
48
  }
49
+ //# sourceMappingURL=equation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAIjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAEjD,qBAAa,QAAS,YAClB,aAAa,CAAC,QAAQ,CAAC,EACvB,SAAS,CAAC,QAAQ,CAAC,EACnB,QAAQ,CAAC,QAAQ,CAAC;;gBAUN,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,QAAQ;gBAC1C,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa;IA8BpF,KAAK,GAAI,gBAAgB,MAAM,KAAG,IAAI,CAY5C;IAEM,KAAK,QAAO,QAAQ,CAE1B;IAED,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;WAEa,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO;WAWjD,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE;IA0B/E,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IAwBhD,MAAM,GAAI,MAAM,OAAO,EAAE,OA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;IAwBd,OAAO,GAAI,UAAU,OAAO,KAAG,IAAI,CAyBzC;IAGM,SAAS,GAAI,QAAQ,MAAM,EAAE,GAAG,OAAO,KAAG,IAAI,CAIpD;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;IAKM,QAAQ,QAAO,IAAI,CAIzB;IAGM,KAAK,QAAO,QAAQ,EAAE,CAG5B;IAEM,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAI3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IAoBrD,IAAI,GAAI,QAAQ,WAAW,CAAC,QAAQ,CAAC,KAAG,OAAO,CAErD;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;CAsEJ"}
@@ -1,6 +1,6 @@
1
- import { Polynom } from './polynom';
2
- import { Equation } from './equation';
3
- import { Solution } from '../analyze';
1
+ import type { Polynom } from "./polynom";
2
+ import type { Equation } from "./equation";
3
+ import { Solution } from "../analyze";
4
4
  export declare class EquationSolver {
5
5
  #private;
6
6
  _: number;
@@ -11,3 +11,4 @@ export declare class EquationSolver {
11
11
  solve(): Solution[];
12
12
  solveAsCardan(): Solution[];
13
13
  }
14
+ //# sourceMappingURL=equationSolver.d.ts.map
@@ -1,6 +1,6 @@
1
- import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
2
- import { Fraction } from '../coefficients/fraction';
3
- import { Polynom } from './polynom';
1
+ import type { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType, TABLE_OF_SIGNS } from "../pimath.interface";
2
+ import { Fraction } from "../coefficients/fraction";
3
+ import { Polynom } from "./polynom";
4
4
  export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor>, IAlgebra<Factor> {
5
5
  #private;
6
6
  constructor(value?: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
@@ -47,3 +47,4 @@ export declare enum FACTOR_DISPLAY {
47
47
  ROOT = 0,
48
48
  POWER = 1
49
49
  }
50
+ //# sourceMappingURL=factor.d.ts.map
@@ -7,3 +7,4 @@ export * from './monom';
7
7
  export * from './polyFactor';
8
8
  export * from './polynom';
9
9
  export * from './matrix';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
- import { IAlgebra, IEquation, InputValue, IPiMathObject, literalType } from '../pimath.interface';
2
- import { Fraction } from '../coefficients';
3
- import { Equation } from './equation';
4
- import { Polynom } from './polynom';
5
- import { Solution } from '../analyze';
1
+ import type { IAlgebra, IEquation, InputValue, IPiMathObject, literalType } from "../pimath.interface";
2
+ import { Fraction } from "../coefficients";
3
+ import { Equation } from "./equation";
4
+ import { Polynom } from "./polynom";
5
+ import { Solution } from "../analyze";
6
6
  export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
7
7
  #private;
8
8
  constructor(...values: (string | Equation)[]);
@@ -48,3 +48,4 @@ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquat
48
48
  get variables(): string[];
49
49
  set variables(value: string | string[]);
50
50
  }
51
+ //# sourceMappingURL=linearSystem.d.ts.map
@@ -1,12 +1,5 @@
1
- /**
2
- * Polynom class can handle polynoms, reorder, resolve, ...
3
- */
4
1
  export declare class LogicalSet {
5
2
  #private;
6
- /**
7
- *
8
- * @param {string} value (optional) Default polynom to parse on class creation
9
- */
10
3
  constructor(value?: string);
11
4
  parse: (value: string) => this;
12
5
  get tex(): string;
@@ -19,3 +12,4 @@ export declare class LogicalSet {
19
12
  vennAB(): string[];
20
13
  vennABC(): string[];
21
14
  }
15
+ //# sourceMappingURL=logicalset.d.ts.map
@@ -1,6 +1,6 @@
1
- import { IExpressionMultiply, InputAlgebra, InputValue, IPiMathObject } from '../pimath.interface';
2
- import { Polynom } from './polynom';
3
- import { Vector } from '../geometry';
1
+ import type { IExpressionMultiply, InputAlgebra, InputValue, IPiMathObject } from "../pimath.interface";
2
+ import { Polynom } from "./polynom";
3
+ import type { Vector } from "../geometry";
4
4
  export type IMatrixValues = InputAlgebra<Polynom>[][];
5
5
  export declare class Matrix implements IPiMathObject<Matrix>, IExpressionMultiply<Matrix> {
6
6
  #private;
@@ -49,3 +49,4 @@ export declare class Matrix implements IPiMathObject<Matrix>, IExpressionMultipl
49
49
  get values(): Polynom[][];
50
50
  zero(): this;
51
51
  }
52
+ //# sourceMappingURL=matrix.d.ts.map
@@ -1,162 +1,50 @@
1
- import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
2
- import { Fraction } from '../coefficients';
1
+ import type { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from "../pimath.interface";
2
+ import { Fraction } from "../coefficients";
3
3
  export declare class Monom implements IPiMathObject<Monom>, IExpression<Monom>, IAnalyse<Monom>, IAlgebra<Monom> {
4
4
  #private;
5
5
  constructor(value?: InputValue<Fraction>);
6
6
  constructor(value?: Monom);
7
- /**
8
- * Parse a string to a monom. The string may include fraction.
9
- * @param inputStr
10
- */
11
7
  parse(inputStr: InputAlgebra<Monom>): this;
12
- /**
13
- * Clone the current Monom.
14
- */
15
8
  clone: () => Monom;
16
- /**
17
- * Get the tex output of the monom
18
- */
19
9
  get tex(): string;
20
- /**
21
- * This display getter is to be used in the polynom display getter
22
- */
23
10
  get display(): string;
24
11
  static gcd: (...monoms: Monom[]) => Monom;
25
- /**
26
- * Multiply two monoms and return a NEW monom.
27
- * @param monoms
28
- */
29
12
  static xMultiply: (...monoms: Monom[]) => Monom;
30
- /**
31
- * Add all similar monoms. If they aren't similar, they are simply skipped.
32
- * @param M (Monom[]) The monoms to add.
33
- */
34
13
  add: (...M: InputAlgebra<Fraction>[]) => this;
35
- /**
36
- * Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
37
- * @returns {Fraction}
38
- */
39
14
  get coefficient(): Fraction;
40
- /**
41
- * Set the coefficient \\(k\\) value of the monom
42
- * @param {Fraction | number | string} F
43
- */
44
15
  set coefficient(F: InputValue<Fraction>);
45
16
  containsRationalPower: () => boolean;
46
- /**
47
- * Get the degree of a monom. If no setLetter is given, the result will be the global degree.
48
- * @param letter (string) Letter to get to degree (power)
49
- */
50
17
  degree: (letter?: string) => Fraction;
51
- /**
52
- * Derivative the monom
53
- * @param letter
54
- */
55
18
  derivative: (letter?: string) => Monom;
56
- /**
57
- * Divide the current monoms by multiple monoms
58
- * @param M (Monom[])
59
- */
60
19
  divide: (...M: InputAlgebra<Fraction>[]) => this;
61
20
  get dividers(): Monom[];
62
- /**
63
- * Evaluate a monom. Each setLetter must be assigned to a Fraction.
64
- * @param values Dictionary of <setLetter: Fraction>
65
- * @param asNumeric
66
- */
67
21
  evaluate: (values: literalType<number | Fraction> | InputValue<Fraction>, asNumeric?: boolean) => Fraction | number;
68
- /**
69
- * Determine if a monom contains a setLetter in it's literal part
70
- * @param letter
71
- */
72
22
  hasVariable: (letter?: string) => boolean;
73
23
  integrate(a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string): Fraction;
74
24
  inverse: () => this;
75
25
  isDivisible: (div: Monom) => boolean;
76
- /**
77
- * Determine if two monoms are equals
78
- * @param M
79
- */
80
26
  isEqual: (M: Monom) => boolean;
81
27
  isLiteralSquare: () => boolean;
82
- /**
83
- * Determine if the monom is one
84
- */
85
28
  isOne: () => boolean;
86
- /**
87
- * Determine if two monoms are similar
88
- * @param M
89
- */
90
29
  isSameAs: (M: Monom) => boolean;
91
30
  isSquare: () => boolean;
92
- /**
93
- * Determine if the monom is null
94
- */
95
31
  isZero: () => boolean;
96
- /**
97
- * Get the literal part of \\(x^{n_1}y^{n_2}\\) as dictionary \\[\\begin{array}{ll}x&=n_1\\\\y&=n_2\\end{array}\\]
98
- * @returns {literalType}
99
- */
100
32
  get literal(): literalType<Fraction>;
101
- /**
102
- * Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
103
- * @param {literalType<Fraction>} L
104
- */
105
33
  set literal(L: literalType<Fraction>);
106
- /**
107
- * Set the literal part of the monom from a string
108
- * @param inputStr String like x^2y^3
109
- */
110
34
  set literalStr(inputStr: string);
111
- /**
112
- * Multiple multiple monoms to the current monom
113
- * @param M (Monom[]) The monoms to multiply to.
114
- */
115
35
  multiply: (...M: InputAlgebra<Fraction>[]) => this;
116
- /**
117
- * Create a one value monom
118
- */
119
36
  one: () => this;
120
- /**
121
- * Get the opposite
122
- * Returns a monom.
123
- */
124
37
  opposite: () => this;
125
38
  get plotFunction(): string;
126
- /**
127
- * Get the pow of a monom.
128
- * @param nb (number) : Mathematical pow
129
- */
130
39
  pow: (nb: number | Fraction) => this;
131
40
  primitive: (letter?: string) => Monom;
132
41
  reduce: () => this;
133
42
  removeVariable(letter: string): void;
134
- /**
135
- * Get the nth-root of the monom
136
- * @todo Not yet implemented
137
- */
138
43
  root: () => this;
139
- /**
140
- * Set the power of a particular setLetter
141
- * @param letter (string) Letter to change
142
- * @param pow (number) Power of the setLetter (must be positive integer.
143
- */
144
44
  setLetter: (letter: string, pow: InputValue<Fraction>) => this;
145
- /**
146
- * Return the square root of a monom
147
- */
148
45
  sqrt: () => this;
149
- /**
150
- * Subtract multiple monoms
151
- * @param M (Monom[]) The monoms to subtract
152
- */
153
46
  subtract: (...M: InputAlgebra<Fraction>[]) => this;
154
- /**
155
- * Get the variables letters
156
- */
157
47
  get variables(): string[];
158
- /**
159
- * Create a zero value monom
160
- */
161
48
  zero: () => this;
162
49
  }
50
+ //# sourceMappingURL=monom.d.ts.map
@@ -1,2 +1,3 @@
1
- import { IExpressionMultiply, IPiMathObject } from '../pimath.interface';
1
+ import type { IExpressionMultiply, IPiMathObject } from "../pimath.interface";
2
2
  export declare function operation_pow<T extends IPiMathObject<T> & IExpressionMultiply<T>>(item: T, value: number): T;
3
+ //# sourceMappingURL=operations.d.ts.map