pimath 0.2.4 → 0.2.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pimath",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "A math library for teacher :)",
5
5
  "type": "module",
6
6
  "main": "dist/pimath.js",
@@ -9,7 +9,7 @@ import type {
9
9
  } from "../pimath.interface"
10
10
  import {Fraction} from "../coefficients/fraction"
11
11
  import {Polynom} from "./polynom"
12
- import {replace_in_array, wrapParenthesis} from "../helpers"
12
+ import {replace_in_array, splitIfOutsideParentheses, wrapParenthesis} from "../helpers"
13
13
 
14
14
  export class Factor implements IPiMathObject<Factor>,
15
15
  IExpression<Factor>,
@@ -25,13 +25,13 @@ export class Factor implements IPiMathObject<Factor>,
25
25
  this.#polynom = value.polynom.clone()
26
26
  this.#power = value.power.clone()
27
27
 
28
- if(power !== undefined){
28
+ if (power !== undefined) {
29
29
  this.#power.multiply(new Fraction(power))
30
30
  }
31
- } else if(value !== undefined) {
31
+ } else if (value !== undefined) {
32
32
  this.#polynom = new Polynom(value)
33
33
  this.#power = new Fraction(power ?? 1)
34
- }else{
34
+ } else {
35
35
  this.#polynom = new Polynom()
36
36
  this.#power = new Fraction(1)
37
37
  }
@@ -329,6 +329,48 @@ export class Factor implements IPiMathObject<Factor>,
329
329
  return this
330
330
  }
331
331
 
332
+ static checkParseAsFactors(str: string): boolean {
333
+ const splitPlus = splitIfOutsideParentheses(str, "+")
334
+ if(splitPlus[0]==='') splitPlus.shift()
335
+ if(splitPlus.length>1) return false
336
+
337
+ const splitMinus = splitIfOutsideParentheses(str, "-")
338
+ if(splitMinus[0]==='') splitMinus.shift()
339
+ if(splitMinus.length>1) return false
340
+
341
+ return true
342
+ }
343
+
344
+ static factorsFromString(value: string, isNumerator = true): Factor[] {
345
+ if (!Factor.checkParseAsFactors(value)) {
346
+ return [new Factor(value, isNumerator ? 1 : -1)]
347
+ }
348
+
349
+ const sign = isNumerator ? 1 : -1
350
+ const factors: Factor[] = []
351
+
352
+ // Alternance : facteur parenthésé avec puissance optionnelle | séquence non-parenthésée
353
+ const regex =
354
+ /\(([^)]+)\)(?:\^(-?[0-9]+(?:\/[0-9]+)?|\(-?[0-9]+(?:\/[0-9]+)?\)))?|([^(]+)/g
355
+
356
+ for (const match of value.matchAll(regex)) {
357
+ if (match[1] !== undefined) {
358
+ // Cas : (expr)^puissance
359
+ const powStr = (match[2] ?? '1')
360
+ .replace(/[()]/g, '')
361
+
362
+ factors.push(new Factor(
363
+ new Polynom(match[1]),
364
+ new Fraction(powStr).multiply(sign))
365
+ )
366
+ } else if (match[3]?.trim()) {
367
+ // Cas : monôme ou constante hors parenthèses (ex: 3x^2, 3)
368
+ factors.push(new Factor(new Polynom(match[3].trim()), new Fraction(sign)))
369
+ }
370
+ }
371
+
372
+ return factors
373
+ }
332
374
  }
333
375
 
334
376
  export enum FACTOR_DISPLAY {
@@ -12,7 +12,8 @@ import type {
12
12
  import {Fraction} from "../coefficients"
13
13
  import {Factor, FACTOR_DISPLAY} from "./factor"
14
14
  import {Polynom} from "./polynom"
15
- import type {Solution} from "../analyze/solution"
15
+ import type {Solution} from "../analyze"
16
+ import {splitIfOutsideParentheses} from "../helpers"
16
17
 
17
18
 
18
19
  // PolyFactor is a class that represents a polynomial in factored form.
@@ -92,6 +93,9 @@ export class PolyFactor implements IPiMathObject<PolyFactor>,
92
93
 
93
94
  }
94
95
 
96
+
97
+
98
+
95
99
  static #gcdWith(PF1: PolyFactor, PF2: PolyFactor): PolyFactor {
96
100
  // Get all factors of the two polynomials
97
101
  // Find the common factors
@@ -328,29 +332,40 @@ export class PolyFactor implements IPiMathObject<PolyFactor>,
328
332
 
329
333
  public fromPolynom(numerator: InputAlgebra<Polynom>, denominator?: InputAlgebra<Polynom>): this {
330
334
  // fromPolynom loads the numerator and denominator as is, without factorizing !
335
+ // TODO: fromPolynom should parse the string if it's factorized: 3x(...)^3(..)^2(12x)
331
336
  this.#factors = [new Factor(new Polynom(numerator))]
332
337
 
333
338
  if (denominator) {
334
339
  const polynom = new Polynom(denominator)
335
340
 
336
- if (polynom.isOne()) {
337
- return this
338
- }
339
- if (polynom.isZero()) {
340
- throw new Error("Cannot divide by zero")
341
- }
341
+ if (polynom.isOne()) return this
342
+
343
+ if (polynom.isZero()) throw new Error("Cannot divide by zero")
344
+
342
345
  this.#factors.push(new Factor(polynom, -1))
343
346
  }
344
- // // Find all factors from a polynom
345
- // this.#factors = new Polynom(numerator)
346
- // .factorize(letter)
347
- // .map(value => new Factor(value))
348
- //
349
- // if (denominator) {
350
- // new Polynom(denominator)
351
- // .factorize(letter)
352
- // .forEach(value => this.#factors.push(new Factor(value, -1)))
353
- // }
347
+ return this
348
+ }
349
+
350
+ public fromString(value: string): this {
351
+ this.#factors = []
352
+
353
+ // Two cases :
354
+ // - either the string is given as a factorized string
355
+ // - or the string has something that prevents this => use fromPolynom
356
+
357
+ const [num, ...den] = splitIfOutsideParentheses(value, '/')
358
+ if(num==='') throw new Error('Parsing a PolyFactor from a string requires a numerator')
359
+ if(den.length>1) throw new Error('Parsing a PolyFactor from a string only allows max one signe "/"')
360
+
361
+ if(den.length===0) {
362
+ this.#factors = Factor.factorsFromString(num, true)
363
+ }else{
364
+ this.#factors = [
365
+ ...Factor.factorsFromString(num, true),
366
+ ...Factor.factorsFromString(den[0], false),
367
+ ]
368
+ }
354
369
 
355
370
  return this
356
371
  }
@@ -544,7 +559,7 @@ export class PolyFactor implements IPiMathObject<PolyFactor>,
544
559
  }
545
560
 
546
561
  // The sign for this indexed root is a t(ab)
547
- if (root === undefined || root.value !== roots_key[(index - 1) / 2]) {
562
+ if (root?.value !== roots_key[(index - 1) / 2]) {
548
563
  return 't'
549
564
  }
550
565
 
@@ -666,3 +681,4 @@ function keyFactors(value: PolyFactor): Record<string, Factor[]> {
666
681
 
667
682
  return kF
668
683
  }
684
+
package/src/helpers.ts CHANGED
@@ -33,3 +33,30 @@ export function replace_in_array<T>(haystack: string[], search: string, target:
33
33
  return x === search ? target : x
34
34
  }) as T
35
35
  }
36
+
37
+ export function splitIfOutsideParentheses(
38
+ value: string,
39
+ splitChar: string,
40
+ ): string[] {
41
+ if (splitChar.length !== 1) {
42
+ throw new Error(`splitChar must be a single character, got: "${splitChar}"`)
43
+ }
44
+
45
+ let depth = 0,
46
+ lastIndex = 0
47
+ const result: string[] = []
48
+
49
+ for (let i = 0; i < value.length; i++) {
50
+ const ch = value[i]
51
+ if (ch === "(") depth++
52
+ else if (ch === ")") depth--
53
+ else if (ch === splitChar && depth === 0) {
54
+ result.push(value.substring(lastIndex, i))
55
+ lastIndex = i + 1
56
+ }
57
+ }
58
+
59
+ result.push(value.substring(lastIndex))
60
+
61
+ return result
62
+ }
@@ -17,13 +17,11 @@ const defaultPolynomConfig: randomPolynomConfig = {
17
17
  }
18
18
 
19
19
  export function rndPolynom(userConfig?: randomPolynomConfig): Polynom {
20
- console.log(userConfig)
21
20
  const config = Object.assign(
21
+ {},
22
22
  defaultPolynomConfig,
23
23
  userConfig
24
24
  )
25
- console.log('>>>>')
26
- console.log(config)
27
25
 
28
26
  if (config.factorable) return rndFactorablePolynom(config)
29
27
 
@@ -40,6 +40,8 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
40
40
  get withPower(): this;
41
41
  get withRoot(): this;
42
42
  zero(): this;
43
+ static checkParseAsFactors(str: string): boolean;
44
+ static factorsFromString(value: string, isNumerator?: boolean): Factor[];
43
45
  }
44
46
  export declare enum FACTOR_DISPLAY {
45
47
  ROOT = 0,
@@ -1 +1 @@
1
- {"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QA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,SAAS,IAAI,MAAM;IAInB,MAAM,IAAI,MAAM;IAIhB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,IAAI,IAAI,IAAI;IAIZ,QAAQ,IAAI,MAAM;IAIlB,YAAY,IAAI,cAAc;IAwBrC,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,IAAI,IAAI,CAG3B;IAED,IAAW,QAAQ,IAAI,IAAI,CAG1B;IAEM,IAAI,IAAI,IAAI;IAMnB,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAYhD,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,UAAO,GAAG,MAAM,EAAE;CA8BxE;AAED,oBAAY,cAAc;IACtB,IAAI,IAAA;IACJ,KAAK,IAAA;CACR"}
@@ -2,7 +2,7 @@ import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literal
2
2
  import { Fraction } from '../coefficients';
3
3
  import { Factor } from './factor';
4
4
  import { Polynom } from './polynom';
5
- import { Solution } from '../analyze/solution';
5
+ import { Solution } from '../analyze';
6
6
  export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
7
7
  #private;
8
8
  constructor(...values: (InputAlgebra<Polynom> | Factor | PolyFactor)[]);
@@ -25,6 +25,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
25
25
  get factors(): Factor[];
26
26
  set factors(value: Factor[]);
27
27
  fromPolynom(numerator: InputAlgebra<Polynom>, denominator?: InputAlgebra<Polynom>): this;
28
+ fromString(value: string): this;
28
29
  /**
29
30
  * Get the roots of the PolyFactor.
30
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,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AI,IAAI,IAAI;CAwBtB"}
@@ -3,3 +3,4 @@ export declare function stripParenthesis(str: string): string;
3
3
  export declare function wrapVert(str: string, tex?: boolean): string;
4
4
  export declare function wrapNorm(str: string, tex?: boolean): string;
5
5
  export declare function replace_in_array<T>(haystack: string[], search: string, target: string, start?: number, end?: number): T;
6
+ export declare function splitIfOutsideParentheses(value: string, splitChar: string): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAUvH"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAUvH;AAED,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAClB,MAAM,EAAE,CAsBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"rndPolynom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndPolynom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAQ,OAAO,EAAC,MAAM,eAAe,CAAA;AAgB5C,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAmDpE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CA6B9E"}
1
+ {"version":3,"file":"rndPolynom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndPolynom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAQ,OAAO,EAAC,MAAM,eAAe,CAAA;AAgB5C,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAiDpE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CA6B9E"}