pimath 0.1.24 → 0.1.25
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/README.md +4 -7
- package/dist/algebra/factor.d.ts +4 -3
- package/dist/algebra/monom.d.ts +0 -1
- package/dist/algebra/polyFactor.d.ts +9 -3
- package/dist/algebra/polynom.d.ts +6 -4
- package/dist/geometry/triangle.d.ts +0 -1
- package/dist/pimath.interface.d.ts +2 -5
- package/dist/pimath.js +1066 -991
- package/dist/pimath.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
PI - javascript math in your hands
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
Each class has a tex output, designed to be used in any LaTeX document.
|
|
4
|
+
PiMath is a script designed to create and generate mathematical exercises.
|
|
6
5
|
|
|
7
|
-
Fraction will create... fraction !
|
|
8
6
|
|
|
9
7
|
```
|
|
10
|
-
let A = new
|
|
8
|
+
let A = new PiMath.Fraction('2/3');
|
|
11
9
|
console.log(A.tex) // -> \frac{ 2 }{ 3 }
|
|
12
10
|
|
|
13
11
|
// Add another fraction
|
|
14
|
-
let B = new
|
|
12
|
+
let B = new PiMath.Fraction('2/5');
|
|
15
13
|
A.add(B);
|
|
16
14
|
console.log(A.frac) // -> \frac{ 16 }{ 15 }
|
|
17
|
-
```
|
|
18
|
-
New version today
|
|
15
|
+
```
|
package/dist/algebra/factor.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject,
|
|
1
|
+
import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients/fraction';
|
|
3
3
|
import { Polynom } from './polynom';
|
|
4
4
|
export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor>, IAlgebra<Factor> {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(value
|
|
6
|
+
constructor(value?: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
|
|
7
7
|
parse(): Factor;
|
|
8
8
|
clone(): Factor;
|
|
9
|
+
fromPolynom(polynom: InputValue<Polynom>): this;
|
|
9
10
|
get tex(): string;
|
|
10
11
|
get display(): string;
|
|
11
12
|
add(): Factor;
|
|
@@ -34,7 +35,7 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
|
|
|
34
35
|
root(value: number): this;
|
|
35
36
|
sqrt(): this;
|
|
36
37
|
subtract(): Factor;
|
|
37
|
-
tableOfSigns(
|
|
38
|
+
tableOfSigns(): TABLE_OF_SIGNS;
|
|
38
39
|
get variables(): string[];
|
|
39
40
|
get withPower(): this;
|
|
40
41
|
get withRoot(): this;
|
package/dist/algebra/monom.d.ts
CHANGED
|
@@ -101,7 +101,6 @@ export declare class Monom implements IPiMathObject<Monom>, IExpression<Monom>,
|
|
|
101
101
|
set literal(L: literalType<Fraction>);
|
|
102
102
|
/**
|
|
103
103
|
* Get the literal square roots of the Monom.
|
|
104
|
-
* TODO: remove this getter ? Is it used and is it correct ?
|
|
105
104
|
* @returns {literalType<Fraction>}
|
|
106
105
|
*/
|
|
107
106
|
get literalSqrt(): literalType<Fraction>;
|
|
@@ -4,8 +4,8 @@ import { Factor } from './factor';
|
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
5
|
export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
|
|
6
6
|
#private;
|
|
7
|
-
constructor(...values: (Factor |
|
|
8
|
-
parse(...values: (Factor |
|
|
7
|
+
constructor(...values: (Factor | PolyFactor)[]);
|
|
8
|
+
parse(...values: (Factor | PolyFactor)[]): this;
|
|
9
9
|
clone(): PolyFactor;
|
|
10
10
|
get tex(): string;
|
|
11
11
|
get display(): string;
|
|
@@ -38,7 +38,13 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
38
38
|
primitive(): PolyFactor;
|
|
39
39
|
reduce(): this;
|
|
40
40
|
root(value: number): this;
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Reoarder the factors using :
|
|
43
|
+
* 1. number of monoms
|
|
44
|
+
* 2. degree of polynom
|
|
45
|
+
* 3. power of polyfactor
|
|
46
|
+
*/
|
|
47
|
+
sort(letter?: string): this;
|
|
42
48
|
sqrt(): this;
|
|
43
49
|
subtract(...values: PolyFactor[]): this;
|
|
44
50
|
tableOfSigns(): POLYFACTOR_TABLE_OF_SIGNS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType, TABLE_OF_SIGNS } from '../pimath.interface';
|
|
2
|
-
import { Fraction } from '../coefficients
|
|
2
|
+
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Monom } from './monom';
|
|
4
4
|
export type PolynomParsingType = InputValue<Polynom> | Monom;
|
|
5
5
|
export interface IEuclidean {
|
|
@@ -30,11 +30,12 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
30
30
|
* Clone the polynom
|
|
31
31
|
*/
|
|
32
32
|
clone: () => Polynom;
|
|
33
|
+
get tex(): string;
|
|
34
|
+
get display(): string;
|
|
33
35
|
add: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
34
36
|
commonMonom: () => Monom;
|
|
35
37
|
degree: (letter?: string) => Fraction;
|
|
36
38
|
derivative: (letter?: string) => Polynom;
|
|
37
|
-
get display(): string;
|
|
38
39
|
divide: (value: InputAlgebra<Polynom>) => Polynom;
|
|
39
40
|
empty: () => this;
|
|
40
41
|
/**
|
|
@@ -49,8 +50,10 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
49
50
|
* @param letter
|
|
50
51
|
*/
|
|
51
52
|
factorize: (letter?: string) => Polynom[];
|
|
53
|
+
fromCoefficients(...values: InputValue<Fraction>[]): this;
|
|
52
54
|
gcdDenominator: () => number;
|
|
53
55
|
gcdNumerator: () => number;
|
|
56
|
+
getCoefficients(): Fraction[];
|
|
54
57
|
getDenominators: () => number[];
|
|
55
58
|
getNumerators: () => number[];
|
|
56
59
|
getZeroes: () => ISolution[];
|
|
@@ -97,8 +100,7 @@ export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Poly
|
|
|
97
100
|
set roots(value: ISolution[]);
|
|
98
101
|
sqrt(): Polynom;
|
|
99
102
|
subtract: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
100
|
-
tableOfSigns(
|
|
101
|
-
get tex(): string;
|
|
103
|
+
tableOfSigns(): TABLE_OF_SIGNS;
|
|
102
104
|
get variables(): string[];
|
|
103
105
|
/**
|
|
104
106
|
* Set the polynom to zero.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Fraction } from './coefficients
|
|
2
|
-
import {
|
|
3
|
-
import { Monom } from './algebra/monom';
|
|
4
|
-
import { Factor } from './algebra/factor';
|
|
1
|
+
import { Fraction, NthRoot } from './coefficients';
|
|
2
|
+
import { Monom, Factor, Equation } from './algebra';
|
|
5
3
|
import { Line, Point, Vector } from './geometry';
|
|
6
|
-
import { Equation } from './algebra';
|
|
7
4
|
export type InputValue<T> = T | string | number | Fraction | NthRoot;
|
|
8
5
|
export type InputAlgebra<T> = InputValue<T> | Monom;
|
|
9
6
|
export type literalType<T> = Record<string, T>;
|