pimath 0.1.40 → 0.2.1
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/dist/pimath.js +3106 -2873
- package/dist/pimath.js.map +1 -1
- package/package.json +13 -11
- package/src/algebra/equation.ts +113 -111
- package/src/algebra/equationSolver.ts +69 -120
- package/src/algebra/factor.ts +6 -7
- package/src/algebra/linearSystem.ts +97 -46
- package/src/algebra/logicalset.ts +51 -52
- package/src/algebra/monom.ts +23 -61
- package/src/algebra/operations.ts +0 -1
- package/src/algebra/polyFactor.ts +5 -5
- package/src/algebra/polynom.ts +69 -216
- package/src/analyze/index.ts +4 -0
- package/src/analyze/solution.ts +92 -29
- package/src/analyze/tableOfSigns.ts +1 -1
- package/src/coefficients/fraction.ts +189 -149
- package/src/coefficients/index.ts +1 -1
- package/src/coefficients/root.ts +66 -19
- package/src/geometry/TupleN.ts +128 -0
- package/src/geometry/circle.ts +308 -238
- package/src/geometry/geomMath.ts +4 -3
- package/src/geometry/index.ts +1 -0
- package/src/geometry/line.ts +221 -245
- package/src/geometry/line3.ts +78 -73
- package/src/geometry/plane3.ts +64 -55
- package/src/geometry/point.ts +57 -19
- package/src/geometry/triangle.ts +376 -248
- package/src/geometry/vector.ts +113 -229
- package/src/index.ts +13 -12
- package/src/numeric.ts +6 -9
- package/src/pimath.interface.ts +30 -28
- package/src/randomization/algebra/rndPolynom.ts +29 -15
- package/src/randomization/coefficient/rndFraction.ts +3 -3
- package/src/randomization/geometry/rndLine.ts +8 -10
- package/src/randomization/random.ts +11 -13
- package/src/randomization/rndTypes.ts +16 -12
- package/types/algebra/equation.d.ts +18 -17
- package/types/algebra/equation.d.ts.map +1 -1
- package/types/algebra/equationSolver.d.ts +5 -4
- package/types/algebra/equationSolver.d.ts.map +1 -1
- package/types/algebra/factor.d.ts +1 -1
- package/types/algebra/factor.d.ts.map +1 -1
- package/types/algebra/linearSystem.d.ts +23 -6
- package/types/algebra/linearSystem.d.ts.map +1 -1
- package/types/algebra/logicalset.d.ts +1 -1
- package/types/algebra/logicalset.d.ts.map +1 -1
- package/types/algebra/monom.d.ts +1 -6
- package/types/algebra/monom.d.ts.map +1 -1
- package/types/algebra/operations.d.ts.map +1 -1
- package/types/algebra/polyFactor.d.ts +4 -4
- package/types/algebra/polyFactor.d.ts.map +1 -1
- package/types/algebra/polynom.d.ts +10 -7
- package/types/algebra/polynom.d.ts.map +1 -1
- package/types/analyze/index.d.ts +2 -0
- package/types/analyze/index.d.ts.map +1 -0
- package/types/analyze/solution.d.ts +14 -8
- package/types/analyze/solution.d.ts.map +1 -1
- package/types/coefficients/fraction.d.ts +14 -12
- package/types/coefficients/fraction.d.ts.map +1 -1
- package/types/coefficients/index.d.ts +1 -1
- package/types/coefficients/index.d.ts.map +1 -1
- package/types/coefficients/root.d.ts +3 -0
- package/types/coefficients/root.d.ts.map +1 -1
- package/types/geometry/TupleAbstract.d.ts +22 -0
- package/types/geometry/TupleAbstract.d.ts.map +1 -0
- package/types/geometry/TupleN.d.ts +24 -0
- package/types/geometry/TupleN.d.ts.map +1 -0
- package/types/geometry/circle.d.ts +26 -17
- package/types/geometry/circle.d.ts.map +1 -1
- package/types/geometry/geomMath.d.ts +2 -1
- package/types/geometry/geomMath.d.ts.map +1 -1
- package/types/geometry/index.d.ts.map +1 -1
- package/types/geometry/line.d.ts +21 -30
- package/types/geometry/line.d.ts.map +1 -1
- package/types/geometry/line3.d.ts +19 -19
- package/types/geometry/line3.d.ts.map +1 -1
- package/types/geometry/matrix.d.ts +11 -11
- package/types/geometry/plane3.d.ts +10 -10
- package/types/geometry/plane3.d.ts.map +1 -1
- package/types/geometry/point.d.ts +11 -6
- package/types/geometry/point.d.ts.map +1 -1
- package/types/geometry/triangle.d.ts +68 -23
- package/types/geometry/triangle.d.ts.map +1 -1
- package/types/geometry/vector.d.ts +24 -44
- package/types/geometry/vector.d.ts.map +1 -1
- package/types/index.d.ts +5 -4
- package/types/index.d.ts.map +1 -1
- package/types/numeric.d.ts.map +1 -1
- package/types/pimath.interface.d.ts +18 -24
- package/types/pimath.interface.d.ts.map +1 -1
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -1
- package/types/randomization/coefficient/rndFraction.d.ts +1 -1
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -1
- package/types/randomization/geometry/rndLine.d.ts.map +1 -1
- package/types/randomization/random.d.ts +3 -2
- package/types/randomization/random.d.ts.map +1 -1
- package/types/randomization/rndTypes.d.ts +15 -10
- package/types/randomization/rndTypes.d.ts.map +1 -1
- package/src/coefficients/nthRoot.ts +0 -149
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import { Polynom
|
|
4
|
-
import {
|
|
1
|
+
import type {randomPolynomConfig} from "../rndTypes"
|
|
2
|
+
import {rndMonom} from "./rndMonom"
|
|
3
|
+
import {Monom, Polynom} from "../../algebra"
|
|
4
|
+
import {randomInt, randomIntSym} from "../rndHelpers"
|
|
5
5
|
|
|
6
|
-
const factorableConfig = {
|
|
6
|
+
const factorableConfig: randomPolynomConfig = {
|
|
7
7
|
letters: 'x',
|
|
8
8
|
degree: 2,
|
|
9
9
|
fraction: false,
|
|
@@ -12,6 +12,7 @@ const factorableConfig = {
|
|
|
12
12
|
factorable: false,
|
|
13
13
|
allowNullMonom: true,
|
|
14
14
|
numberOfMonoms: 0,
|
|
15
|
+
commonConstant: false,
|
|
15
16
|
positive: true
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -21,24 +22,25 @@ export function rndPolynom(userConfig?: randomPolynomConfig): Polynom {
|
|
|
21
22
|
userConfig
|
|
22
23
|
)
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
if (config.factorable) return rndFactorablePolynom(factorableConfig)
|
|
25
26
|
|
|
26
27
|
// Create the polynom
|
|
27
28
|
const P = new Polynom().empty()
|
|
28
29
|
|
|
29
30
|
let M: Monom
|
|
31
|
+
const targetDegree = config.degree ?? 2
|
|
30
32
|
|
|
31
|
-
for (let i =
|
|
33
|
+
for (let i = targetDegree; i >= 0; i--) {
|
|
32
34
|
// Create monom of corresponding degree.
|
|
33
35
|
M = rndMonom({
|
|
34
36
|
letters: config.letters,
|
|
35
37
|
degree: i,
|
|
36
38
|
fraction: config.fraction,
|
|
37
|
-
zero: (i ===
|
|
39
|
+
zero: (i === targetDegree) ? false : config.allowNullMonom
|
|
38
40
|
})
|
|
39
41
|
|
|
40
42
|
// If degree is the greatest and unit is true, set the monom value to one.
|
|
41
|
-
if (config.unit &&
|
|
43
|
+
if (config.unit && targetDegree === i) {
|
|
42
44
|
M.coefficient.one()
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -72,15 +74,27 @@ export function rndFactorablePolynom(userConfig?: randomPolynomConfig): Polynom
|
|
|
72
74
|
userConfig
|
|
73
75
|
)
|
|
74
76
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const _factorableConfig = { ...config }
|
|
77
|
+
const _factorableConfig = {...config}
|
|
78
78
|
_factorableConfig.degree = 1
|
|
79
79
|
_factorableConfig.factorable = false
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const factors: Polynom[] = []
|
|
82
|
+
const targetDegree = config.degree ?? 2
|
|
83
|
+
|
|
84
|
+
while (factors.length < targetDegree) {
|
|
85
|
+
factors.push(rndPolynom(_factorableConfig))
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
// Add a common constant if necessary.
|
|
89
|
+
if (userConfig?.commonConstant !== false) {
|
|
90
|
+
let k = randomIntSym(10, false)
|
|
91
|
+
|
|
92
|
+
if (userConfig?.commonConstant === true && (k === 1 || k === -1)) {
|
|
93
|
+
k *= randomInt(2, 5)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (k !== 1 && k !== -1) factors.unshift(new Polynom(k))
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return Polynom.xMultiply(...factors)
|
|
86
100
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type {randomCoefficientConfig} from "../rndTypes"
|
|
2
|
+
import {Fraction} from "../../coefficients"
|
|
3
|
+
import {randomInt, randomIntSym} from "../rndHelpers"
|
|
4
4
|
|
|
5
5
|
export function rndFraction(userConfig?: randomCoefficientConfig): Fraction {
|
|
6
6
|
const config = Object.assign(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
1
|
+
import {Line} from "../../geometry/line"
|
|
2
|
+
import {Vector} from "../../geometry/vector"
|
|
3
|
+
import {randomIntSym} from "../rndHelpers"
|
|
4
|
+
import type {randomGeometryLineConfig} from "../rndTypes"
|
|
5
5
|
|
|
6
6
|
export function rndLine(userConfig?: randomGeometryLineConfig): Line {
|
|
7
7
|
const config = Object.assign(
|
|
@@ -13,16 +13,14 @@ export function rndLine(userConfig?: randomGeometryLineConfig): Line {
|
|
|
13
13
|
}, userConfig)
|
|
14
14
|
|
|
15
15
|
// The A point exists.
|
|
16
|
-
const d = new Vector(
|
|
17
|
-
randomIntSym(10),
|
|
18
|
-
randomIntSym(10)
|
|
19
|
-
)
|
|
16
|
+
const d = new Vector(0, 0)
|
|
20
17
|
|
|
21
18
|
while (d.isNull) {
|
|
22
|
-
d.x = randomIntSym(10)
|
|
23
|
-
d.y = randomIntSym(10)
|
|
19
|
+
d.x = randomIntSym(10, config.allow?.vertical ?? true)
|
|
20
|
+
d.y = randomIntSym(10, config.allow?.horizontal ?? true)
|
|
24
21
|
}
|
|
25
22
|
|
|
23
|
+
// slope === 1 => slope must be positive
|
|
26
24
|
if (config.slope === 1) {
|
|
27
25
|
if (d.x.sign() !== d.y.sign()) {
|
|
28
26
|
d.y.opposite()
|
|
@@ -9,15 +9,16 @@ import type {
|
|
|
9
9
|
randomPolynomConfig
|
|
10
10
|
} from "./rndTypes"
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import {randomArray, randomBool, randomInt, randomIntSym, randomItem, randomPrime, shuffleArray} from "./rndHelpers"
|
|
13
|
+
import {rndFraction} from "./coefficient/rndFraction"
|
|
14
|
+
import {rndMonom} from "./algebra/rndMonom"
|
|
15
|
+
import {rndPolynom} from "./algebra/rndPolynom"
|
|
16
|
+
import {rndEquation} from "./algebra/rndEquation"
|
|
17
|
+
import {rndCircle} from "./geometry/rndCircle"
|
|
18
|
+
import {rndLine} from "./geometry/rndLine"
|
|
19
|
+
import {rndLine3} from "./geometry/rndLine3"
|
|
20
|
+
import {rndVector} from "./geometry/rndVector"
|
|
21
|
+
import {Point} from "../geometry"
|
|
21
22
|
|
|
22
23
|
export type * from "./rndTypes"
|
|
23
24
|
|
|
@@ -79,10 +80,7 @@ export const Random = {
|
|
|
79
80
|
},
|
|
80
81
|
|
|
81
82
|
point: (config?: randomGeometryPointConfig) => {
|
|
82
|
-
|
|
83
|
-
vector.asPoint = true
|
|
84
|
-
|
|
85
|
-
return vector
|
|
83
|
+
return new Point(rndVector(config))
|
|
86
84
|
},
|
|
87
85
|
|
|
88
86
|
circle: (config?: randomGeometryCircleConfig) => {
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Fraction} from "../coefficients/fraction"
|
|
2
2
|
|
|
3
3
|
export interface randomCoefficientConfig {
|
|
4
|
-
negative?: boolean,
|
|
5
4
|
max?: number,
|
|
5
|
+
natural?: boolean
|
|
6
|
+
negative?: boolean,
|
|
6
7
|
reduced?: boolean,
|
|
7
8
|
zero?: boolean,
|
|
8
|
-
natural?: boolean
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface randomMonomConfig {
|
|
12
|
-
letters?: string,
|
|
13
12
|
degree?: number,
|
|
14
13
|
fraction?: boolean | randomCoefficientConfig,
|
|
14
|
+
letters?: string,
|
|
15
15
|
zero?: boolean
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface randomPolynomConfig {
|
|
19
|
-
|
|
19
|
+
allowNullMonom?: boolean,
|
|
20
|
+
commonConstant?: boolean ,
|
|
20
21
|
degree?: number,
|
|
21
|
-
fraction?: boolean | randomCoefficientConfig,
|
|
22
|
-
zero?: boolean
|
|
23
|
-
unit?: boolean,
|
|
24
22
|
factorable?: boolean,
|
|
25
|
-
|
|
23
|
+
fraction?: boolean | randomCoefficientConfig,
|
|
24
|
+
letters?: string,
|
|
26
25
|
numberOfMonoms?: number,
|
|
27
26
|
positive?: boolean
|
|
27
|
+
unit?: boolean,
|
|
28
|
+
zero?: boolean
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export interface randomEquationConfig extends randomPolynomConfig {
|
|
@@ -37,9 +38,12 @@ export interface randomEquationConfig extends randomPolynomConfig {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
|
|
41
41
|
export interface randomGeometryLineConfig {
|
|
42
42
|
A: { x: number | Fraction, y: number | Fraction },
|
|
43
|
+
allow?: {
|
|
44
|
+
vertical?: boolean,
|
|
45
|
+
horizontal?: boolean
|
|
46
|
+
}
|
|
43
47
|
slope?: Fraction | string | number,
|
|
44
48
|
}
|
|
45
49
|
|
|
@@ -50,14 +54,14 @@ export interface randomGeometryLine3Config {
|
|
|
50
54
|
|
|
51
55
|
|
|
52
56
|
export interface randomGeometryPointConfig {
|
|
53
|
-
quadrant?: number | null,
|
|
54
57
|
axis?: 'x' | 'y' | 'z' | null,
|
|
55
58
|
fraction?: boolean,
|
|
56
59
|
max?: number
|
|
60
|
+
quadrant?: number | null,
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export interface randomGeometryCircleConfig {
|
|
60
64
|
center?: randomGeometryPointConfig,
|
|
61
|
-
radius?: number,
|
|
62
65
|
pointsOnCircle?: number
|
|
66
|
+
radius?: number,
|
|
63
67
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject,
|
|
1
|
+
import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients/fraction';
|
|
3
3
|
import { Polynom } from './polynom';
|
|
4
|
+
import { Solution } from '../analyze/solution';
|
|
4
5
|
export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
|
|
5
6
|
#private;
|
|
6
7
|
constructor(equation: InputAlgebra<Polynom> | Equation);
|
|
7
8
|
constructor(left: InputAlgebra<Polynom>, right: InputAlgebra<Polynom>, sign?: EQUATION_SIGN);
|
|
8
9
|
parse: (equationString: string) => this;
|
|
9
|
-
create: (left: Polynom, right: Polynom, sign?: string) => this;
|
|
10
10
|
clone: () => Equation;
|
|
11
|
+
get tex(): string;
|
|
12
|
+
get display(): string;
|
|
13
|
+
static isEquationString(equationString: string): boolean;
|
|
14
|
+
static makeSolutionsUnique(solutions: Solution[], sorted?: boolean): Solution[];
|
|
11
15
|
/**
|
|
12
16
|
* Add a value to the equation
|
|
13
17
|
* if value is an equation, add the left part to the left part of the equation
|
|
@@ -17,6 +21,7 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
17
21
|
* @param value | Polynom | Monom | Fraction | string | monom
|
|
18
22
|
*/
|
|
19
23
|
add(value: InputValue<Equation | Polynom>): this;
|
|
24
|
+
create: (left: Polynom, right: Polynom, sign?: string) => this;
|
|
20
25
|
/**
|
|
21
26
|
* Get the degree of the equation
|
|
22
27
|
* @param letter
|
|
@@ -50,17 +55,19 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
50
55
|
*/
|
|
51
56
|
hasVariable: (letter: string) => boolean;
|
|
52
57
|
isEqual(value: InputValue<Equation>): boolean;
|
|
58
|
+
isEqualTo: (equ: Equation) => boolean;
|
|
53
59
|
isLinearTo: (equ: Equation) => boolean;
|
|
54
60
|
/**
|
|
55
61
|
* Determine if the equation contains more than one letter/variable.
|
|
56
62
|
*/
|
|
57
63
|
isMultiVariable: () => boolean;
|
|
58
|
-
isEqualTo: (equ: Equation) => boolean;
|
|
59
64
|
/**
|
|
60
65
|
* Reorder the polynom to have only one letter on the left, the rest on the right.
|
|
61
66
|
* @param letter
|
|
62
67
|
*/
|
|
63
68
|
isolate: (letter?: string) => this | false;
|
|
69
|
+
get left(): Polynom;
|
|
70
|
+
set left(value: Polynom);
|
|
64
71
|
letters: () => string[];
|
|
65
72
|
/**
|
|
66
73
|
* Reorder will move all monoms containing a letter on the left, all the other on the right.
|
|
@@ -71,30 +78,24 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
71
78
|
* @param value
|
|
72
79
|
*/
|
|
73
80
|
multiply: (value: InputValue<Fraction>) => this;
|
|
74
|
-
|
|
81
|
+
get numberOfVars(): number;
|
|
75
82
|
opposite: () => this;
|
|
83
|
+
pow(value: number): this;
|
|
76
84
|
reduce(): this;
|
|
77
85
|
reorder: (allLeft?: boolean) => this;
|
|
78
86
|
replaceBy: (letter: string, P: Polynom) => this;
|
|
87
|
+
get right(): Polynom;
|
|
88
|
+
set right(value: Polynom);
|
|
89
|
+
get sign(): string;
|
|
90
|
+
set sign(value: string);
|
|
91
|
+
get signAsTex(): string;
|
|
79
92
|
/**
|
|
80
93
|
* Multiply by the lcm denominator and divide by the gcm numerators.
|
|
81
94
|
*/
|
|
82
95
|
simplify: () => this;
|
|
83
|
-
solve: () =>
|
|
96
|
+
solve: () => Solution[];
|
|
84
97
|
split(): [Polynom, Polynom];
|
|
85
98
|
subtract(value: InputValue<Equation | Polynom>): this;
|
|
86
99
|
test: (values: literalType<Fraction>) => boolean;
|
|
87
|
-
static isEquationString(equationString: string): boolean;
|
|
88
|
-
static makeSolutionsUnique(solutions: ISolution[], sorted?: boolean): ISolution[];
|
|
89
|
-
get display(): string;
|
|
90
|
-
get left(): Polynom;
|
|
91
|
-
set left(value: Polynom);
|
|
92
|
-
get numberOfVars(): number;
|
|
93
|
-
get right(): Polynom;
|
|
94
|
-
set right(value: Polynom);
|
|
95
|
-
get sign(): string;
|
|
96
|
-
set sign(value: string);
|
|
97
|
-
get signAsTex(): string;
|
|
98
|
-
get tex(): string;
|
|
99
100
|
get variables(): string[];
|
|
100
101
|
}
|
|
@@ -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,
|
|
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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M,QAAQ,QAAO,IAAI,CAIzB;IAEM,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMxB,MAAM,IAAI,IAAI;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,12 +1,13 @@
|
|
|
1
|
-
import { ISolution } from '../pimath.interface';
|
|
2
1
|
import { Polynom } from './polynom';
|
|
3
2
|
import { Equation } from './equation';
|
|
3
|
+
import { Solution } from '../analyze';
|
|
4
4
|
export declare class EquationSolver {
|
|
5
5
|
#private;
|
|
6
|
+
_: number;
|
|
6
7
|
constructor(left: Polynom | Equation, right?: Polynom, variable?: string);
|
|
7
|
-
get
|
|
8
|
+
get bissectionComplexityCounter(): number;
|
|
8
9
|
get bissectionDeltaX(): number;
|
|
9
10
|
set bissectionDeltaX(value: number);
|
|
10
|
-
solve():
|
|
11
|
-
solveAsCardan():
|
|
11
|
+
solve(): Solution[];
|
|
12
|
+
solveAsCardan(): Solution[];
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,qBAAa,cAAc;;IACvB,CAAC,EAAE,MAAM,CAAA;gBAKG,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,SAAM;IAgBrE,IAAI,2BAA2B,WAE9B;IAED,IAAI,gBAAgB,IAIQ,MAAM,CAFjC;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAEjC;IAEM,KAAK,IAAI,QAAQ,EAAE;IAqCnB,aAAa,IAAI,QAAQ,EAAE;CAyZrC"}
|
|
@@ -6,7 +6,6 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
|
|
|
6
6
|
constructor(value?: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
|
|
7
7
|
parse(): Factor;
|
|
8
8
|
clone(): Factor;
|
|
9
|
-
fromPolynom(polynom: InputValue<Polynom>): this;
|
|
10
9
|
get tex(): string;
|
|
11
10
|
get display(): string;
|
|
12
11
|
add(): Factor;
|
|
@@ -16,6 +15,7 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
|
|
|
16
15
|
develop(): Polynom;
|
|
17
16
|
divide(value: InputAlgebra<Factor | Polynom>): this;
|
|
18
17
|
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
18
|
+
fromPolynom(polynom: InputValue<Polynom>): this;
|
|
19
19
|
hasVariable(letter: string): boolean;
|
|
20
20
|
inverse(): this;
|
|
21
21
|
isEqual(value: Factor): boolean;
|
|
@@ -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,
|
|
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,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,qBAAa,MAAO,YAAW,aAAa,CAAC,MAAM,CAAC,EAChD,WAAW,CAAC,MAAM,CAAC,EACnB,QAAQ,CAAC,MAAM,CAAC;;gBAMJ,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAsBzE,KAAK,IAAiC,MAAM;IAI5C,KAAK,IAAI,MAAM;IAItB,IAAW,GAAG,IAAI,MAAM,CAyBvB;IAED,IAAW,OAAO,IAAI,MAAM,CAyB3B;IAEM,GAAG,IAAI,MAAM;IAIpB,IAAW,QAAQ,IAAI,IAAI,CAG1B;IAEM,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ;IAIjC,UAAU,IAAI,MAAM,EAAE;IAoBtB,OAAO,IAAI,OAAO;IAQlB,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,G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
1
|
+
import { IAlgebra, IEquation, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Equation } from './equation';
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
|
+
import { Solution } from '../analyze/solution';
|
|
5
6
|
export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
|
|
6
7
|
#private;
|
|
7
8
|
constructor(...values: (string | Equation)[]);
|
|
8
9
|
parse: (...equations: (string | Equation)[]) => this;
|
|
9
10
|
clone: () => LinearSystem;
|
|
11
|
+
get tex(): string;
|
|
12
|
+
get display(): string;
|
|
10
13
|
static fromMatrix(matrix: InputValue<Fraction>[][], letters?: string): LinearSystem;
|
|
11
14
|
add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
12
15
|
buildTex: (equations: Equation[], operators?: (string[])[]) => string;
|
|
13
16
|
degree(letter?: string): Fraction;
|
|
14
|
-
get display(): string;
|
|
15
17
|
get equations(): Equation[];
|
|
16
18
|
set equations(value: Equation[]);
|
|
17
19
|
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
@@ -19,14 +21,29 @@ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquat
|
|
|
19
21
|
isEqual(value: LinearSystem): boolean;
|
|
20
22
|
get isSolvable(): boolean;
|
|
21
23
|
get matrix(): [Fraction[][], Fraction[]];
|
|
22
|
-
mergeEquations
|
|
24
|
+
mergeEquations(equation1: {
|
|
25
|
+
id: number;
|
|
26
|
+
factor: InputValue<Fraction>;
|
|
27
|
+
}, equation2: {
|
|
28
|
+
id: number;
|
|
29
|
+
factor: number;
|
|
30
|
+
}): Equation;
|
|
23
31
|
multiply(value: InputValue<Fraction> | InputValue<Fraction>[], index?: number): this;
|
|
24
|
-
reduce():
|
|
32
|
+
reduce(): this;
|
|
25
33
|
reorder: () => this;
|
|
26
|
-
solve():
|
|
34
|
+
solve(): Solution[];
|
|
27
35
|
solveMatrix: () => Fraction[];
|
|
36
|
+
solve_compute_factors(letter: string): [
|
|
37
|
+
{
|
|
38
|
+
id: number;
|
|
39
|
+
factor: number;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: number;
|
|
43
|
+
factor: number;
|
|
44
|
+
}
|
|
45
|
+
][];
|
|
28
46
|
subtract(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
29
|
-
get tex(): string;
|
|
30
47
|
get variables(): string[];
|
|
31
48
|
set variables(value: string | string[]);
|
|
32
49
|
}
|
|
@@ -1 +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,
|
|
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,WAAW,EAAC,MAAM,qBAAqB,CAAA;AACpG,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAEjD,qBAAa,YAAa,YAAW,aAAa,CAAC,YAAY,CAAC,EAC5D,SAAS,CAAC,YAAY,CAAC,EACvB,QAAQ,CAAC,YAAY,CAAC;;gBAQV,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;IAWrC,KAAK,GAAI,GAAG,WAAW,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,KAAG,IAAI,CAOzD;IAEM,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CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAwBpF,MAAM,IAAI,IAAI;IAOd,OAAO,QAAO,IAAI,CAMxB;IAED,KAAK,IAAI,QAAQ,EAAE;IA+BZ,WAAW,QAAO,QAAQ,EAAE,CA2DlC;IAED,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAChC;QAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;QAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;KAAC,EAAE;IA2B/D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqB3F,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAI5C;CAmCJ"}
|
|
@@ -9,12 +9,12 @@ export declare class LogicalSet {
|
|
|
9
9
|
*/
|
|
10
10
|
constructor(value?: string);
|
|
11
11
|
parse: (value: string) => this;
|
|
12
|
+
get tex(): string;
|
|
12
13
|
evaluate(values: Record<string, boolean>): boolean;
|
|
13
14
|
get rpn(): {
|
|
14
15
|
token: string;
|
|
15
16
|
tokenType: string;
|
|
16
17
|
}[];
|
|
17
|
-
get tex(): string;
|
|
18
18
|
get variables(): string[];
|
|
19
19
|
vennAB(): string[];
|
|
20
20
|
vennABC(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"AASA,qBAAa,UAAU;;gBAOP,KAAK,CAAC,EAAE,MAAM;IAU1B,KAAK,GAAI,OAAO,MAAM,KAAG,IAAI,CAO5B;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"AASA,qBAAa,UAAU;;gBAOP,KAAK,CAAC,EAAE,MAAM;IAU1B,KAAK,GAAI,OAAO,MAAM,KAAG,IAAI,CAO5B;IAED,IAAI,GAAG,IAAI,MAAM,CAsEhB;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IA+ClD,IAAI,GAAG,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAEhD;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAIxB;IAED,MAAM,IAAI,MAAM,EAAE;IASlB,OAAO,IAAI,MAAM,EAAE;CAiFtB"}
|
package/types/algebra/monom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
|
-
import { Fraction } from '../coefficients
|
|
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>);
|
|
@@ -103,11 +103,6 @@ export declare class Monom implements IPiMathObject<Monom>, IExpression<Monom>,
|
|
|
103
103
|
* @param {literalType<Fraction>} L
|
|
104
104
|
*/
|
|
105
105
|
set literal(L: literalType<Fraction>);
|
|
106
|
-
/**
|
|
107
|
-
* Get the literal square roots of the Monom.
|
|
108
|
-
* @returns {literalType<Fraction>}
|
|
109
|
-
*/
|
|
110
|
-
get literalSqrt(): literalType<Fraction>;
|
|
111
106
|
/**
|
|
112
107
|
* Set the literal part of the monom from a string
|
|
113
108
|
* @param inputStr String like x^2y^3
|
|
@@ -1 +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,EAAC,QAAQ,EAAC,MAAM,
|
|
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,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AAKxC,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;IAmC1C,KAAK,QAAO,KAAK,CAUvB;IAKD,IAAW,GAAG,IAAI,MAAM,CA+BvB;IAMD,IAAW,OAAO,IAAI,MAAM,CA8B3B;IAED,OAAc,GAAG,GAAI,GAAG,QAAQ,KAAK,EAAE,KAAG,KAAK,CAiC9C;IAMD,OAAc,SAAS,GAAI,GAAG,QAAQ,KAAK,EAAE,KAAG,KAAK,CAQpD;IAMM,GAAG,GAAI,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBlD;IAMD,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAMD,IAAW,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,QAA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I,CAGzB;IAED,IAAW,YAAY,IAAI,MAAM,CAgChC;IAMM,GAAG,GAAI,IAAI,MAAM,GAAG,QAAQ,KAAG,IAAI,CAMzC;IAEM,SAAS,GAAI,eAAY,KAAG,KAAK,CAoBvC;IAEM,MAAM,QAAO,IAAI,CAWvB;IAEM,cAAc,CAAC,MAAM,EAAE,MAAM;IAS7B,IAAI,QAAO,IAAI,CAErB;IAOM,SAAS,GAAI,QAAQ,MAAM,EAAE,KAAK,UAAU,CAAC,QAAQ,CAAC,KAAG,IAAI,CAcnE;IAKM,IAAI,QAAO,IAAI,CASrB;IAMM,QAAQ,GAAI,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBvD;IAMD,IAAW,SAAS,IAAI,MAAM,EAAE,CAa/B;IAKM,IAAI,QAAO,IAAI,CAIrB;IAmID,OAAO,CAAC,mBAAmB;CAsB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/algebra/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAG3E,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/algebra/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAG3E,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAmB5G"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject,
|
|
1
|
+
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType, POLYFACTOR_TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Factor } from './factor';
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
5
|
import { Solution } from '../analyze/solution';
|
|
6
6
|
export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
|
|
7
7
|
#private;
|
|
8
|
-
constructor(...values: (Factor | PolyFactor)[]);
|
|
9
|
-
parse(...values: (Factor | PolyFactor)[]): this;
|
|
8
|
+
constructor(...values: (InputAlgebra<Polynom> | Factor | PolyFactor)[]);
|
|
9
|
+
parse(...values: (InputAlgebra<Polynom> | Factor | PolyFactor)[]): this;
|
|
10
10
|
clone(): PolyFactor;
|
|
11
11
|
get tex(): string;
|
|
12
12
|
get display(): string;
|
|
@@ -29,7 +29,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
29
29
|
* Get the roots of the PolyFactor.
|
|
30
30
|
*/
|
|
31
31
|
getRoots(): Solution[];
|
|
32
|
-
getZeroes():
|
|
32
|
+
getZeroes(): Solution[];
|
|
33
33
|
hasVariable(letter: string): boolean;
|
|
34
34
|
inverse(): this;
|
|
35
35
|
isEqual(value: PolyFactor): boolean;
|
|
@@ -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,EACV,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,QAAQ,EACR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alyse, IExpression, InputAlgebra, InputValue, IPiMathObject,
|
|
1
|
+
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Monom } from './monom';
|
|
4
|
+
import { Solution } from '../analyze/solution';
|
|
4
5
|
export type PolynomParsingType = InputValue<Polynom> | Monom;
|
|
5
6
|
export interface IEuclidean {
|
|
6
7
|
quotient: Polynom;
|
|
@@ -32,6 +33,7 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
32
33
|
clone: () => Polynom;
|
|
33
34
|
get tex(): string;
|
|
34
35
|
get display(): string;
|
|
36
|
+
static xMultiply(...polynoms: InputValue<Polynom>[]): Polynom;
|
|
35
37
|
add: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
36
38
|
commonMonom: () => Monom;
|
|
37
39
|
degree: (letter?: string) => Fraction;
|
|
@@ -48,15 +50,17 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
48
50
|
/**
|
|
49
51
|
* Factorize a polynom and store the best results in factors.
|
|
50
52
|
* @param letter
|
|
53
|
+
* TODO: Handle other letter than 'x'.
|
|
51
54
|
*/
|
|
52
|
-
factorize
|
|
55
|
+
factorize(letter?: string): Polynom[];
|
|
56
|
+
get factors(): Polynom[];
|
|
53
57
|
fromCoefficients(...values: InputValue<Fraction>[]): this;
|
|
54
58
|
gcdDenominator: () => number;
|
|
55
59
|
gcdNumerator: () => number;
|
|
56
60
|
getCoefficients(): Fraction[];
|
|
57
61
|
getDenominators: () => number[];
|
|
58
62
|
getNumerators: () => number[];
|
|
59
|
-
getZeroes: () =>
|
|
63
|
+
getZeroes: () => Solution[];
|
|
60
64
|
hasVariable(letter: string): boolean;
|
|
61
65
|
integrate: (a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string) => Fraction;
|
|
62
66
|
inverse(): Polynom | undefined;
|
|
@@ -66,7 +70,6 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
66
70
|
get isMultiVariable(): boolean;
|
|
67
71
|
isOne(): boolean;
|
|
68
72
|
isOppositeAt: (P: Polynom) => boolean;
|
|
69
|
-
isReduced: (polynomString: string) => boolean;
|
|
70
73
|
isSameAs: (P: Polynom) => boolean;
|
|
71
74
|
isZero(): boolean;
|
|
72
75
|
lcmDenominator: () => number;
|
|
@@ -96,8 +99,8 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
96
99
|
*/
|
|
97
100
|
replaceBy: (letter: string, P: Polynom) => this;
|
|
98
101
|
root(): Polynom;
|
|
99
|
-
get roots():
|
|
100
|
-
set roots(value:
|
|
102
|
+
get roots(): Solution[];
|
|
103
|
+
set roots(value: Solution[]);
|
|
101
104
|
setVariable(value: string): this;
|
|
102
105
|
sqrt(): Polynom;
|
|
103
106
|
subtract: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
@@ -109,5 +112,5 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
109
112
|
* @returns {this}
|
|
110
113
|
*/
|
|
111
114
|
zero: () => this;
|
|
112
|
-
get zeroes():
|
|
115
|
+
get zeroes(): Solution[];
|
|
113
116
|
}
|