pimath 0.1.10 → 0.1.12
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 +4220 -0
- package/package.json +1 -1
- package/types/algebra/equation.d.ts +101 -0
- package/types/algebra/equation.d.ts.map +1 -0
- package/types/algebra/equationSolver.d.ts +9 -0
- package/types/algebra/equationSolver.d.ts.map +1 -0
- package/types/algebra/factor.d.ts +46 -0
- package/types/algebra/factor.d.ts.map +1 -0
- package/types/algebra/linearSystem.d.ts +32 -0
- package/types/algebra/linearSystem.d.ts.map +1 -0
- package/types/algebra/logicalset.d.ts +21 -0
- package/types/algebra/logicalset.d.ts.map +1 -0
- package/types/algebra/monom.d.ts +168 -0
- package/types/algebra/monom.d.ts.map +1 -0
- package/types/algebra/polyFactor.d.ts +50 -0
- package/types/algebra/polyFactor.d.ts.map +1 -0
- package/types/algebra/polynom.d.ts +109 -0
- package/types/algebra/polynom.d.ts.map +1 -0
- package/types/coefficients/fraction.d.ts +91 -0
- package/types/coefficients/fraction.d.ts.map +1 -0
- package/types/coefficients/nthRoot.d.ts +20 -0
- package/types/coefficients/nthRoot.d.ts.map +1 -0
- package/types/geometry/circle.d.ts +38 -0
- package/types/geometry/circle.d.ts.map +1 -0
- package/types/geometry/geomMath.d.ts +8 -0
- package/types/geometry/geomMath.d.ts.map +1 -0
- package/types/geometry/line.d.ts +90 -0
- package/types/geometry/line.d.ts.map +1 -0
- package/types/geometry/line3.d.ts +57 -0
- package/types/geometry/line3.d.ts.map +1 -0
- package/types/geometry/matrix.d.ts +11 -0
- package/types/geometry/matrix.d.ts.map +1 -0
- package/types/geometry/plane3.d.ts +35 -0
- package/types/geometry/plane3.d.ts.map +1 -0
- package/types/geometry/point.d.ts +11 -0
- package/types/geometry/point.d.ts.map +1 -0
- package/types/geometry/triangle.d.ts +69 -0
- package/types/geometry/triangle.d.ts.map +1 -0
- package/types/geometry/vector.d.ts +55 -0
- package/types/geometry/vector.d.ts.map +1 -0
- package/types/helpers.d.ts +4 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts +27 -28
- package/types/numeric.d.ts +39 -0
- package/types/numeric.d.ts.map +1 -0
- package/types/pimath.interface.d.ts +61 -0
- package/types/pimath.interface.d.ts.map +1 -0
- package/types/randomization/algebra/rndEquation.d.ts +3 -0
- package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
- package/types/randomization/algebra/rndMonom.d.ts +3 -0
- package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
- package/types/randomization/algebra/rndPolynom.d.ts +4 -0
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
- package/types/randomization/coefficient/rndFraction.d.ts +3 -0
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
- package/types/randomization/geometry/rndCircle.d.ts +3 -0
- package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine.d.ts +3 -0
- package/types/randomization/geometry/rndLine.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine3.d.ts +3 -0
- package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
- package/types/randomization/geometry/rndVector.d.ts +3 -0
- package/types/randomization/geometry/rndVector.d.ts.map +1 -0
- package/types/randomization/random.d.ts +20 -0
- package/types/randomization/random.d.ts.map +1 -0
- package/types/randomization/rndHelpers.d.ts +21 -0
- package/types/randomization/rndHelpers.d.ts.map +1 -0
- package/types/randomization/rndTypes.d.ts +63 -0
- package/types/randomization/rndTypes.d.ts.map +1 -0
- package/dist/index.js +0 -47
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Polynom } from './polynom';
|
|
4
|
+
export type EQUATION_SIGN = "=" | "<=" | ">=" | "<" | ">";
|
|
5
|
+
export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(equation: InputAlgebra<Polynom> | Equation);
|
|
8
|
+
constructor(left: InputAlgebra<Polynom>, right: InputAlgebra<Polynom>, sign?: EQUATION_SIGN);
|
|
9
|
+
parse: (equationString: string) => this;
|
|
10
|
+
create: (left: Polynom, right: Polynom, sign?: string) => this;
|
|
11
|
+
clone: () => Equation;
|
|
12
|
+
/**
|
|
13
|
+
* Add a value to the equation
|
|
14
|
+
* if value is an equation, add the left part to the left part of the equation
|
|
15
|
+
* and the right part to the right part of the equation
|
|
16
|
+
* if value is a string, try to create an equation
|
|
17
|
+
* if it fails, create a polynom and add it to the left and right part of the equation
|
|
18
|
+
* @param value | Polynom | Monom | Fraction | string | monom
|
|
19
|
+
*/
|
|
20
|
+
add(value: InputValue<Equation | Polynom>): this;
|
|
21
|
+
/**
|
|
22
|
+
* Get the degree of the equation
|
|
23
|
+
* @param letter
|
|
24
|
+
*/
|
|
25
|
+
degree: (letter?: string) => Fraction;
|
|
26
|
+
/**
|
|
27
|
+
* divide an equation by a given value (transformed as a fraction)
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* 8x+10=6x \vert 2
|
|
31
|
+
* 4x+5=3x
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* |>Alternatively with $3x-4$ maybe it's working ?
|
|
35
|
+
* $$\frac{3x}{5}$$
|
|
36
|
+
*
|
|
37
|
+
* @param value
|
|
38
|
+
* @returns {Equation}
|
|
39
|
+
*/
|
|
40
|
+
divide: (value: InputValue<Fraction>) => this;
|
|
41
|
+
/**
|
|
42
|
+
* Create an Equation using two polynoms.
|
|
43
|
+
* Markdown *support* is cool
|
|
44
|
+
* @param values
|
|
45
|
+
* @param asNumeric
|
|
46
|
+
*/
|
|
47
|
+
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean | undefined): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Determine if the equation contains a variable.
|
|
50
|
+
* @param letter
|
|
51
|
+
*/
|
|
52
|
+
hasVariable: (letter: string) => boolean;
|
|
53
|
+
isEqual(value: InputValue<Equation>): boolean;
|
|
54
|
+
isLinearTo: (equ: Equation) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Determine if the equation contains more than one letter/variable.
|
|
57
|
+
*/
|
|
58
|
+
isMultiVariable: () => boolean;
|
|
59
|
+
isEqualTo: (equ: Equation) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Reorder the polynom to have only one letter on the left, the rest on the right.
|
|
62
|
+
* @param letter
|
|
63
|
+
*/
|
|
64
|
+
isolate: (letter?: string) => this | false;
|
|
65
|
+
letters: () => string[];
|
|
66
|
+
/**
|
|
67
|
+
* Reorder will move all monoms containing a letter on the left, all the other on the right.
|
|
68
|
+
*/
|
|
69
|
+
moveLeft: () => this;
|
|
70
|
+
/**
|
|
71
|
+
* Multiple an equation by a fraction value.
|
|
72
|
+
* @param value
|
|
73
|
+
*/
|
|
74
|
+
multiply: (value: InputValue<Fraction>) => this;
|
|
75
|
+
pow(value: number): this;
|
|
76
|
+
opposite: () => this;
|
|
77
|
+
reduce(): this;
|
|
78
|
+
reorder: (allLeft?: boolean) => this;
|
|
79
|
+
replaceBy: (letter: string, P: Polynom) => this;
|
|
80
|
+
/**
|
|
81
|
+
* Multiply by the lcm denominator and divide by the gcm numerators.
|
|
82
|
+
*/
|
|
83
|
+
simplify: () => this;
|
|
84
|
+
solve: () => ISolution[];
|
|
85
|
+
split(): [Polynom, Polynom];
|
|
86
|
+
subtract(value: InputValue<Equation | Polynom>): this;
|
|
87
|
+
test: (values: literalType<Fraction>) => boolean;
|
|
88
|
+
static isEquationString(equationString: string): boolean;
|
|
89
|
+
static makeSolutionsUnique(solutions: ISolution[], sorted?: boolean): ISolution[];
|
|
90
|
+
get display(): string;
|
|
91
|
+
get left(): Polynom;
|
|
92
|
+
set left(value: Polynom);
|
|
93
|
+
get numberOfVars(): number;
|
|
94
|
+
get right(): Polynom;
|
|
95
|
+
set right(value: Polynom);
|
|
96
|
+
get sign(): string;
|
|
97
|
+
set sign(value: string);
|
|
98
|
+
get signAsTex(): string;
|
|
99
|
+
get tex(): string;
|
|
100
|
+
get variables(): string[];
|
|
101
|
+
}
|
|
@@ -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,YAClB,aAAa,CAAC,QAAQ,CAAC,EACvB,SAAS,CAAC,QAAQ,CAAC,EACnB,QAAQ,CAAC,QAAQ,CAAC;;gBAaN,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;IAkCpF,KAAK,mBAAoB,MAAM,KAAG,IAAI,CAY5C;IAEM,MAAM,SAAU,OAAO,SAAS,OAAO,SAAS,MAAM,KAAG,IAAI,CAKnE;IAEM,KAAK,QAAO,QAAQ,CAE1B;IAUM,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IA2BhD,MAAM,YAAa,MAAM,KAAG,QAAQ,CAE1C;IAgBM,MAAM,UAAW,UAAU,CAAC,QAAQ,CAAC,KAAG,IAAI,CASl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3B;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,9 @@
|
|
|
1
|
+
import { ISolution } from '../pimath.interface';
|
|
2
|
+
import { Polynom } from './polynom';
|
|
3
|
+
import { Equation } from './equation';
|
|
4
|
+
export declare class EquationSolver {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(left: Polynom | Equation, right?: Polynom, variable?: string);
|
|
7
|
+
solve(): ISolution[];
|
|
8
|
+
solveAsCardan(): ISolution[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,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;CA8TtC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Polynom } from './polynom';
|
|
4
|
+
export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor>, IAlgebra<Factor> {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(value: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
|
|
7
|
+
parse(): Factor;
|
|
8
|
+
clone(): Factor;
|
|
9
|
+
add(): Factor;
|
|
10
|
+
get withPower(): this;
|
|
11
|
+
get withRoot(): this;
|
|
12
|
+
get asSingle(): this;
|
|
13
|
+
degree(letter?: string): Fraction;
|
|
14
|
+
derivative(): Factor[];
|
|
15
|
+
develop(): Polynom;
|
|
16
|
+
get display(): string;
|
|
17
|
+
divide(value: InputAlgebra<Factor | Polynom>): this;
|
|
18
|
+
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
19
|
+
hasVariable(letter: string): boolean;
|
|
20
|
+
inverse(): this;
|
|
21
|
+
isEqual(value: Factor): boolean;
|
|
22
|
+
isOne(): boolean;
|
|
23
|
+
isSameAs(value: InputAlgebra<Factor | Polynom>): boolean;
|
|
24
|
+
isZero(): boolean;
|
|
25
|
+
multiply(value: InputAlgebra<Factor | Polynom>): this;
|
|
26
|
+
one(): this;
|
|
27
|
+
opposite(): Factor;
|
|
28
|
+
get polynom(): Polynom;
|
|
29
|
+
set polynom(value: Polynom);
|
|
30
|
+
pow(value: number | Fraction): this;
|
|
31
|
+
get power(): Fraction;
|
|
32
|
+
set power(value: InputValue<Fraction>);
|
|
33
|
+
primitive(): Factor;
|
|
34
|
+
reduce(): Factor;
|
|
35
|
+
root(value: number): this;
|
|
36
|
+
sqrt(): this;
|
|
37
|
+
subtract(): Factor;
|
|
38
|
+
get tex(): string;
|
|
39
|
+
get variables(): string[];
|
|
40
|
+
zero(): this;
|
|
41
|
+
tableOfSigns(roots?: ISol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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;IAMZ,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,cAAc;CAwB3D;AAED,oBAAY,cAAc;IACtB,IAAI,IAAA;IACJ,KAAK,IAAA;CACR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(...values: (string | Equation)[]);
|
|
8
|
+
parse: (...equations: (string | Equation)[]) => this;
|
|
9
|
+
clone: () => LinearSystem;
|
|
10
|
+
static fromMatrix(matrix: InputValue<Fraction>[][], letters?: string): LinearSystem;
|
|
11
|
+
add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
12
|
+
buildTex: (equations: Equation[], operators?: (string[])[]) => string;
|
|
13
|
+
degree(letter?: string | undefined): Fraction;
|
|
14
|
+
get display(): string;
|
|
15
|
+
get equations(): Equation[];
|
|
16
|
+
set equations(value: Equation[]);
|
|
17
|
+
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean | undefined): number | Fraction;
|
|
18
|
+
hasVariable(letter: string): boolean;
|
|
19
|
+
isEqual(value: LinearSystem): boolean;
|
|
20
|
+
get isSolvable(): boolean;
|
|
21
|
+
get matrix(): [Fraction[][], Fraction[]];
|
|
22
|
+
mergeEquations: (eq1: Equation, eq2: Equation, factor1: Fraction, factor2: Fraction) => Equation;
|
|
23
|
+
multiply(value: InputValue<Fraction> | InputValue<Fraction>[], index?: number): this;
|
|
24
|
+
reduce(): LinearSystem;
|
|
25
|
+
reorder: () => this;
|
|
26
|
+
solve(): ISolution[];
|
|
27
|
+
solveMatrix: () => Fraction[];
|
|
28
|
+
subtract(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
29
|
+
get tex(): string;
|
|
30
|
+
get variables(): string[];
|
|
31
|
+
set variables(value: string | string[]);
|
|
32
|
+
}
|
|
@@ -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,aAA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,KAAK,EAAE,YAAY,GAAG,OAAO;IAI5C,IAAW,UAAU,IAAI,OAAO,CAW/B;IAED,IAAW,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAG9C;IAEM,cAAc,QAAS,QAAQ,OAAO,QAAQ,WAAW,QAAQ,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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polynom class can handle polynoms, reorder, resolve, ...
|
|
3
|
+
*/
|
|
4
|
+
export declare class LogicalSet {
|
|
5
|
+
#private;
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {string} value (optional) Default polynom to parse on class creation
|
|
9
|
+
*/
|
|
10
|
+
constructor(value?: string);
|
|
11
|
+
parse: (value: string) => this;
|
|
12
|
+
evaluate(values: Record<string, boolean>): boolean;
|
|
13
|
+
get rpn(): {
|
|
14
|
+
token: string;
|
|
15
|
+
tokenType: string;
|
|
16
|
+
}[];
|
|
17
|
+
get tex(): string;
|
|
18
|
+
get variables(): string[];
|
|
19
|
+
vennAB(): string[];
|
|
20
|
+
vennABC(): string[];
|
|
21
|
+
}
|
|
@@ -0,0 +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,UAAW,MAAM,KAAG,IAAI,CAO5B;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IAgDlD,IAAI,GAAG,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAEhD;IAED,IAAI,GAAG,IAAI,MAAM,CAsEhB;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAIxB;IAED,MAAM,IAAI,MAAM,EAAE;IASlB,OAAO,IAAI,MAAM,EAAE;CAiFtB"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
export declare class Monom implements IPiMathObject<Monom>, IExpression<Monom>, IAnalyse<Monom>, IAlgebra<Monom> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(value?: InputValue<Fraction>);
|
|
6
|
+
constructor(value?: Monom);
|
|
7
|
+
/**
|
|
8
|
+
* Parse a string to a monom. The string may include fraction.
|
|
9
|
+
* @param inputStr
|
|
10
|
+
*/
|
|
11
|
+
parse(inputStr: InputAlgebra<Monom>): this;
|
|
12
|
+
/**
|
|
13
|
+
* Clone the current Monom.
|
|
14
|
+
*/
|
|
15
|
+
clone: () => Monom;
|
|
16
|
+
static gcd: (...monoms: Monom[]) => Monom;
|
|
17
|
+
/**
|
|
18
|
+
* Multiply two monoms and return a NEW monom.
|
|
19
|
+
* @param monoms
|
|
20
|
+
*/
|
|
21
|
+
static xMultiply: (...monoms: Monom[]) => Monom;
|
|
22
|
+
/**
|
|
23
|
+
* Add all similar monoms. If they aren't similar, they are simply skipped.
|
|
24
|
+
* @param M (Monom[]) The monoms to add.
|
|
25
|
+
*/
|
|
26
|
+
add: (...M: InputAlgebra<Fraction>[]) => this;
|
|
27
|
+
/**
|
|
28
|
+
* Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
|
|
29
|
+
* @returns {Fraction}
|
|
30
|
+
*/
|
|
31
|
+
get coefficient(): Fraction;
|
|
32
|
+
/**
|
|
33
|
+
* Set the coefficient \\(k\\) value of the monom
|
|
34
|
+
* @param {Fraction | number | string} F
|
|
35
|
+
*/
|
|
36
|
+
set coefficient(F: InputValue<Fraction>);
|
|
37
|
+
containsRationalPower: () => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get the degree of a monom. If no setLetter is given, the result will be the global degree.
|
|
40
|
+
* @param letter (string) Letter to get to degree (power)
|
|
41
|
+
*/
|
|
42
|
+
degree: (letter?: string) => Fraction;
|
|
43
|
+
/**
|
|
44
|
+
* Derivative the monom
|
|
45
|
+
* @param letter
|
|
46
|
+
*/
|
|
47
|
+
derivative: (letter?: string) => Monom;
|
|
48
|
+
/**
|
|
49
|
+
* This display getter is to be used in the polynom display getter
|
|
50
|
+
*/
|
|
51
|
+
get display(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Divide the current monoms by multiple monoms
|
|
54
|
+
* @param M (Monom[])
|
|
55
|
+
*/
|
|
56
|
+
divide: (...M: InputAlgebra<Fraction>[]) => this;
|
|
57
|
+
get dividers(): Monom[];
|
|
58
|
+
/**
|
|
59
|
+
* Evaluate a monom. Each setLetter must be assigned to a Fraction.
|
|
60
|
+
* @param values Dictionary of <setLetter: Fraction>
|
|
61
|
+
* @param asNumeric
|
|
62
|
+
*/
|
|
63
|
+
evaluate: (values: literalType<number | Fraction> | InputValue<Fraction>, asNumeric?: boolean) => Fraction | number;
|
|
64
|
+
/**
|
|
65
|
+
* Determine if a monom contains a setLetter in it's literal part
|
|
66
|
+
* @param letter
|
|
67
|
+
*/
|
|
68
|
+
hasVariable: (letter?: string) => boolean;
|
|
69
|
+
integrate(a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string | undefined): Fraction;
|
|
70
|
+
inverse: () => this;
|
|
71
|
+
isDivisible: (div: Monom) => boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Determine if two monoms are equals
|
|
74
|
+
* @param M
|
|
75
|
+
*/
|
|
76
|
+
isEqual: (M: Monom) => boolean;
|
|
77
|
+
isLiteralSquare: () => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Determine if the monom is one
|
|
80
|
+
*/
|
|
81
|
+
isOne: () => boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Determine if two monoms are similar
|
|
84
|
+
* @param M
|
|
85
|
+
*/
|
|
86
|
+
isSameAs: (M: Monom) => boolean;
|
|
87
|
+
isSquare: () => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Determine if the monom is null
|
|
90
|
+
*/
|
|
91
|
+
isZero: () => boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Get the literal part of \\(x^{n_1}y^{n_2}\\) as dictionary \\[\\begin{array}{ll}x&=n_1\\\\y&=n_2\\end{array}\\]
|
|
94
|
+
* @returns {literalType}
|
|
95
|
+
*/
|
|
96
|
+
get literal(): literalType<Fraction>;
|
|
97
|
+
/**
|
|
98
|
+
* Set the literal part of the monom. Must be a dictionary {x: Fraction, y: Fraction, ...}
|
|
99
|
+
* @param {literalType<Fraction>} L
|
|
100
|
+
*/
|
|
101
|
+
set literal(L: literalType<Fraction>);
|
|
102
|
+
/**
|
|
103
|
+
* Get the literal square roots of the Monom.
|
|
104
|
+
* TODO: remove this getter ? Is it used and is it correct ?
|
|
105
|
+
* @returns {literalType<Fraction>}
|
|
106
|
+
*/
|
|
107
|
+
get literalSqrt(): literalType<Fraction>;
|
|
108
|
+
/**
|
|
109
|
+
* Set the literal part of the monom from a string
|
|
110
|
+
* @param inputStr String like x^2y^3
|
|
111
|
+
*/
|
|
112
|
+
set literalStr(inputStr: string);
|
|
113
|
+
/**
|
|
114
|
+
* Multiple multiple monoms to the current monom
|
|
115
|
+
* @param M (Monom[]) The monoms to multiply to.
|
|
116
|
+
*/
|
|
117
|
+
multiply: (...M: InputAlgebra<Fraction>[]) => this;
|
|
118
|
+
/**
|
|
119
|
+
* Create a one value monom
|
|
120
|
+
*/
|
|
121
|
+
one: () => this;
|
|
122
|
+
/**
|
|
123
|
+
* Get the opposite
|
|
124
|
+
* Returns a monom.
|
|
125
|
+
*/
|
|
126
|
+
opposite: () => this;
|
|
127
|
+
get plotFunction(): string;
|
|
128
|
+
/**
|
|
129
|
+
* Get the pow of a monom.
|
|
130
|
+
* @param nb (number) : Mathematical pow
|
|
131
|
+
*/
|
|
132
|
+
pow: (nb: number | Fraction) => this;
|
|
133
|
+
primitive: (letter?: string) => Monom;
|
|
134
|
+
reduce: () => this;
|
|
135
|
+
removeVariable(letter: string): void;
|
|
136
|
+
/**
|
|
137
|
+
* Get the nth-root of the monom
|
|
138
|
+
*/
|
|
139
|
+
root: () => this;
|
|
140
|
+
/**
|
|
141
|
+
* Set the power of a particular setLetter
|
|
142
|
+
* @param letter (string) Letter to change
|
|
143
|
+
* @param pow (number) Power of the setLetter (must be positive integer.
|
|
144
|
+
*/
|
|
145
|
+
setLetter: (letter: string, pow: InputValue<Fraction>) => this;
|
|
146
|
+
/**
|
|
147
|
+
* Return the square root of a monom
|
|
148
|
+
*/
|
|
149
|
+
sqrt: () => this;
|
|
150
|
+
/**
|
|
151
|
+
* Subtract multiple monoms
|
|
152
|
+
* @param M (Monom[]) The monoms to subtract
|
|
153
|
+
*/
|
|
154
|
+
subtract: (...M: InputAlgebra<Fraction>[]) => this;
|
|
155
|
+
/**
|
|
156
|
+
* Get the tex output of the monom
|
|
157
|
+
*/
|
|
158
|
+
get tex(): string;
|
|
159
|
+
/**
|
|
160
|
+
* Get the variables letters
|
|
161
|
+
*/
|
|
162
|
+
get variables(): string[];
|
|
163
|
+
/**
|
|
164
|
+
* Create a zero value monom
|
|
165
|
+
*/
|
|
166
|
+
zero: () => this;
|
|
167
|
+
private _getLiteralDividers;
|
|
168
|
+
}
|
|
@@ -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,cAAe,KAAK,EAAE,KAAG,KAAK,CAQpD;IAMM,GAAG,SAAU,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBlD;IAMD,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAMD,IAAW,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAE7C;IAEM,qBAAqB,QAAO,OAAO,CAEzC;IAMM,MAAM,YAAa,MAAM,KAAG,QAAQ,CAW1C;IAMM,UAAU,YAAa,MAAM,KAAG,KAAK,CAmB3C;IAMD,IAAW,OAAO,IAAI,MAAM,CA8B3B;IAMM,MAAM,SAAU,YAA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M,QAAO,IAAI,CAWvB;IAEM,cAAc,CAAC,MAAM,EAAE,MAAM;IAS7B,IAAI,QAAO,IAAI,CAErB;IAOM,SAAS,WAAY,MAAM,OAAO,UAAU,CAAC,QAAQ,CAAC,KAAG,IAAI,CAcnE;IAKM,IAAI,QAAO,IAAI,CASrB;IAMM,QAAQ,SAAU,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBvD;IAKD,IAAW,GAAG,IAAI,MAAM,CAiCvB;IAMD,IAAW,SAAS,IAAI,MAAM,EAAE,CAa/B;IAKM,IAAI,QAAO,IAAI,CAIrB;IAgDD,OAAO,CAAC,mBAAmB;CA+G9B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Factor } from './factor';
|
|
4
|
+
import { Polynom } from './polynom';
|
|
5
|
+
export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]);
|
|
8
|
+
parse(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]): this;
|
|
9
|
+
clone(): PolyFactor;
|
|
10
|
+
static gcd(...values: PolyFactor[]): PolyFactor;
|
|
11
|
+
add(...values: PolyFactor[]): this;
|
|
12
|
+
get asPower(): this;
|
|
13
|
+
get asRoot(): this;
|
|
14
|
+
degree(letter?: string): Fraction;
|
|
15
|
+
get denominator(): Factor[];
|
|
16
|
+
derivative(): this;
|
|
17
|
+
develop(): Polynom;
|
|
18
|
+
get display(): string;
|
|
19
|
+
divide(value: PolyFactor): this;
|
|
20
|
+
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
21
|
+
get factors(): Factor[];
|
|
22
|
+
set factors(value: Factor[]);
|
|
23
|
+
fromPolynom(polynom: InputAlgebra<Polynom>, letter?: string): this;
|
|
24
|
+
getZeroes(): ISolution[];
|
|
25
|
+
hasVariable(letter: string): boolean;
|
|
26
|
+
inverse(): this;
|
|
27
|
+
isEqual(value: PolyFactor): boolean;
|
|
28
|
+
isOne(): boolean;
|
|
29
|
+
isZero(): boolean;
|
|
30
|
+
multiply(...values: PolyFactor[]): this;
|
|
31
|
+
get numerator(): Factor[];
|
|
32
|
+
one(): this;
|
|
33
|
+
opposite(): this;
|
|
34
|
+
pow(value: number | Fraction): this;
|
|
35
|
+
primitive(): PolyFactor;
|
|
36
|
+
reduce(): this;
|
|
37
|
+
root(value: number): this;
|
|
38
|
+
sort(): this;
|
|
39
|
+
sqrt(): this;
|
|
40
|
+
subtract(...values: PolyFactor[]): this;
|
|
41
|
+
tableOfSigns(): TABLE_OF_SIGNS & {
|
|
42
|
+
factors: {
|
|
43
|
+
factor: Factor;
|
|
44
|
+
tableOfSigns: TABLE_OF_SIGNS;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
get tex(): string;
|
|
48
|
+
get variables(): string[];
|
|
49
|
+
zero(): this;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EAAE,cAAc,EAE9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,MAAM,EAAiB,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAKjC,qBAAa,UAAW,YAAW,aAAa,CAAC,UAAU,CAAC,EACxD,WAAW,CAA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KAAK,IAAI,OAAO;IAIhB,MAAM,IAAI,OAAO;IAIjB,QAAQ,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAQ9C,IAAI,SAAS,IAAI,MAAM,EAAE,CAExB;IAEM,GAAG,IAAI,IAAI;IASX,QAAQ,IAAI,IAAI;IAahB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAKnC,SAAS,IAAI,UAAU;IAIvB,MAAM,IAAI,IAAI;IAgBd,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,IAAI,IAAI,IAAI;IAMZ,IAAI,IAAI,IAAI;IAKZ,QAAQ,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAIvC,YAAY,IAAI,cAAc,GAAG;QAAE,OAAO,EAAE;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,cAAc,CAAA;SAAC,EAAE,CAAA;KAAE;IA6FrG,IAAW,GAAG,IAAI,MAAM,CA+BvB;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAG/B;IAMM,IAAI,IAAI,IAAI;CAMtB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Monom } from './monom';
|
|
4
|
+
export type PolynomParsingType = InputValue<Polynom> | Monom;
|
|
5
|
+
export interface IEuclidean {
|
|
6
|
+
quotient: Polynom;
|
|
7
|
+
reminder: Polynom;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Polynom class can handle polynoms, reorder, resolve, ...
|
|
11
|
+
* ```
|
|
12
|
+
* let P = new Polynom('3x-4')
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Polynom>, IAnalyse<Polynom>, IAlgebra<Polynom> {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(value: InputValue<Fraction>);
|
|
18
|
+
constructor(value: string);
|
|
19
|
+
constructor(value: Monom);
|
|
20
|
+
constructor(value: Polynom);
|
|
21
|
+
constructor(...values: InputValue<Fraction>[]);
|
|
22
|
+
constructor(...values: InputAlgebra<Polynom>[]);
|
|
23
|
+
/**
|
|
24
|
+
* Parse a string to a polynom.
|
|
25
|
+
* @param inputStr
|
|
26
|
+
* @param values
|
|
27
|
+
*/
|
|
28
|
+
parse: (inputStr: PolynomParsingType, ...values: InputAlgebra<Monom>[]) => this;
|
|
29
|
+
/**
|
|
30
|
+
* Clone the polynom
|
|
31
|
+
*/
|
|
32
|
+
clone: () => Polynom;
|
|
33
|
+
add: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
34
|
+
commonMonom: () => Monom;
|
|
35
|
+
degree: (letter?: string) => Fraction;
|
|
36
|
+
derivative: (letter?: string) => Polynom;
|
|
37
|
+
get display(): string;
|
|
38
|
+
divide: (value: InputAlgebra<Polynom>) => Polynom;
|
|
39
|
+
empty: () => this;
|
|
40
|
+
/**
|
|
41
|
+
* Divide the current polynom by another polynom.
|
|
42
|
+
* @param P
|
|
43
|
+
* returns {quotient: Polynom, reminder: Polynom}
|
|
44
|
+
*/
|
|
45
|
+
euclidean: (P: Polynom) => IEuclidean;
|
|
46
|
+
evaluate: (values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean) => Fraction | number;
|
|
47
|
+
/**
|
|
48
|
+
* Factorize a polynom and store the best results in factors.
|
|
49
|
+
* @param letter
|
|
50
|
+
*/
|
|
51
|
+
factorize: (letter?: string) => Polynom[];
|
|
52
|
+
gcdDenominator: () => number;
|
|
53
|
+
gcdNumerator: () => number;
|
|
54
|
+
getDenominators: () => number[];
|
|
55
|
+
getNumerators: () => number[];
|
|
56
|
+
getZeroes: () => ISolution[];
|
|
57
|
+
hasVariable(letter: string): boolean;
|
|
58
|
+
integrate: (a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string) => Fraction;
|
|
59
|
+
inverse(): Polynom | undefined;
|
|
60
|
+
isDeveloped: (polynomString: string) => boolean;
|
|
61
|
+
isDividableBy: (div: Polynom) => boolean;
|
|
62
|
+
isEqual: (P: Polynom) => boolean;
|
|
63
|
+
get isMultiVariable(): boolean;
|
|
64
|
+
isOne(): boolean;
|
|
65
|
+
isOppositeAt: (P: Polynom) => boolean;
|
|
66
|
+
isReduced: (polynomString: string) => boolean;
|
|
67
|
+
isSameAs: (P: Polynom) => boolean;
|
|
68
|
+
isZero(): boolean;
|
|
69
|
+
lcmDenominator: () => number;
|
|
70
|
+
lcmNumerator: () => number;
|
|
71
|
+
get length(): number;
|
|
72
|
+
letters: () => string[];
|
|
73
|
+
limitToInfinity: (letter?: string) => Fraction;
|
|
74
|
+
limitToNegativeInfinity: (letter?: string) => Fraction;
|
|
75
|
+
monomByDegree: (degree?: Fraction | number, letter?: string) => Monom;
|
|
76
|
+
monomByLetter: (letter: string) => Monom;
|
|
77
|
+
get monoms(): Monom[];
|
|
78
|
+
set monoms(M: Monom[]);
|
|
79
|
+
monomsByDegree: (degree?: number | Fraction, letter?: string) => Monom[];
|
|
80
|
+
multiply: (value: unknown) => Polynom;
|
|
81
|
+
get numberOfVars(): number;
|
|
82
|
+
one: () => this;
|
|
83
|
+
opposite: () => this;
|
|
84
|
+
get plotFunction(): string;
|
|
85
|
+
pow: (nb: number) => Polynom;
|
|
86
|
+
primitive: (letter?: string) => Polynom;
|
|
87
|
+
reduce: () => Polynom;
|
|
88
|
+
reorder: (letter?: string, revert?: boolean) => this;
|
|
89
|
+
/**
|
|
90
|
+
* Replace a variable (letter) by a polynom.
|
|
91
|
+
* @param letter
|
|
92
|
+
* @param P
|
|
93
|
+
*/
|
|
94
|
+
replaceBy: (letter: string, P: Polynom) => this;
|
|
95
|
+
root(): Polynom;
|
|
96
|
+
get roots(): ISolution[];
|
|
97
|
+
set roots(value: ISolution[]);
|
|
98
|
+
sqrt(): Polynom;
|
|
99
|
+
subtract: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
100
|
+
tableOfSigns(rootsArray?: ISolution[]): TABLE_OF_SIGNS;
|
|
101
|
+
get tex(): string;
|
|
102
|
+
get variables(): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Set the polynom to zero.
|
|
105
|
+
* @returns {this}
|
|
106
|
+
*/
|
|
107
|
+
zero: () => this;
|
|
108
|
+
get zeroes(): ISolution[];
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynom.d.ts","sourceRoot":"","sources":["../../src/algebra/polynom.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EAAE,cAAc,EAE9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAGjD,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAK7B,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;AAM5D,MAAM,WAAW,UAAU;IAGvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAA;CAGpB;AAYD,qBAAa,OAAQ,YAAW,aAAa,CAAC,OAAO,CAAC,EAClD,WAAW,CAAC,OAAO,CAAC,EACpB,QAAQ,CAAC,OAAO,CAAC,EACjB,QAAQ,CAAC,OAAO,CAAC;;gBAYL,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;gBAC3B,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,OAAO;gBACd,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;gBACjC,GAAG,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC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