pimath 0.0.132 → 0.0.134
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 +2444 -3566
- package/package.json +37 -20
- package/types/algebra/equation.d.ts +109 -0
- package/types/algebra/equation.d.ts.map +1 -0
- package/types/algebra/equationSolver.d.ts +16 -0
- package/types/algebra/equationSolver.d.ts.map +1 -0
- package/types/algebra/factor.d.ts +47 -0
- package/types/algebra/factor.d.ts.map +1 -0
- package/{dist/maths → types}/algebra/monom.d.ts +98 -131
- package/types/algebra/monom.d.ts.map +1 -0
- package/types/algebra/polyFactor.d.ts +41 -0
- package/types/algebra/polyFactor.d.ts.map +1 -0
- package/types/algebra/polynom.d.ts +126 -0
- package/types/algebra/polynom.d.ts.map +1 -0
- package/types/algebra/rational.d.ts +41 -0
- package/types/algebra/rational.d.ts.map +1 -0
- package/{dist/maths → types}/coefficients/fraction.d.ts +69 -66
- package/types/coefficients/fraction.d.ts.map +1 -0
- package/{dist/maths → types}/coefficients/nthRoot.d.ts +3 -3
- package/{dist/maths → types}/geometry/circle.d.ts +10 -15
- package/types/geometry/circle.d.ts.map +1 -0
- package/types/geometry/geomMath.d.ts +10 -0
- package/types/geometry/geomMath.d.ts.map +1 -0
- package/{dist/maths → types}/geometry/line.d.ts +25 -35
- package/types/geometry/line.d.ts.map +1 -0
- package/types/geometry/line3.d.ts +50 -0
- package/types/geometry/line3.d.ts.map +1 -0
- package/types/geometry/plane3.d.ts +29 -0
- package/types/geometry/plane3.d.ts.map +1 -0
- package/types/geometry/vector.d.ts +70 -0
- package/types/geometry/vector.d.ts.map +1 -0
- package/types/geometry/vector3d.d.ts +37 -0
- package/types/geometry/vector3d.d.ts.map +1 -0
- package/types/index.d.ts +57 -0
- package/types/index.d.ts.map +1 -0
- package/types/numeric.d.ts +39 -0
- package/types/pimath.interface.d.ts +57 -0
- package/types/pimath.interface.d.ts.map +1 -0
- package/types/randomization/algebra/rndEquation.d.ts +4 -0
- package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
- package/types/randomization/algebra/rndMonom.d.ts +4 -0
- package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
- package/types/randomization/algebra/rndPolynom.d.ts +5 -0
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
- package/types/randomization/coefficient/rndFraction.d.ts +4 -0
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
- package/types/randomization/geometry/rndCircle.d.ts +4 -0
- package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine.d.ts +4 -0
- package/types/randomization/geometry/rndLine.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine3.d.ts +4 -0
- package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
- package/types/randomization/geometry/rndPoint.d.ts +4 -0
- package/types/randomization/geometry/rndPoint.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/rndTypes.d.ts +64 -0
- package/types/randomization/rndTypes.d.ts.map +1 -0
- package/dist/main.d.ts +0 -1
- package/dist/maths/algebra/equation.d.ts +0 -120
- package/dist/maths/algebra/linearSystem.d.ts +0 -40
- package/dist/maths/algebra/logicalset.d.ts +0 -28
- package/dist/maths/algebra/polynom.d.ts +0 -155
- package/dist/maths/algebra/rational.d.ts +0 -44
- package/dist/maths/algebra/study/rationalStudy.d.ts +0 -14
- package/dist/maths/algebra/study.d.ts +0 -140
- package/dist/maths/geometry/point.d.ts +0 -36
- package/dist/maths/geometry/triangle.d.ts +0 -92
- package/dist/maths/geometry/vector.d.ts +0 -38
- package/dist/maths/numeric.d.ts +0 -28
- package/dist/maths/numexp.d.ts +0 -19
- package/dist/maths/randomization/random.d.ts +0 -26
- package/dist/maths/randomization/randomCore.d.ts +0 -7
- package/dist/maths/randomization/rndFraction.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryCircle.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryLine.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryPoint.d.ts +0 -13
- package/dist/maths/randomization/rndHelpers.d.ts +0 -23
- package/dist/maths/randomization/rndMonom.d.ts +0 -13
- package/dist/maths/randomization/rndPolynom.d.ts +0 -14
- package/dist/maths/randomization/rndTypes.d.ts +0 -40
- package/dist/maths/shutingyard.d.ts +0 -59
- package/dist/pimath.d.ts +0 -39
- package/lib/main.ts +0 -1
- package/lib/maths/algebra/equation.ts +0 -891
- package/lib/maths/algebra/linearSystem.ts +0 -369
- package/lib/maths/algebra/logicalset.ts +0 -183
- package/lib/maths/algebra/monom.ts +0 -1027
- package/lib/maths/algebra/polynom.ts +0 -1537
- package/lib/maths/algebra/rational.ts +0 -244
- package/lib/maths/algebra/study/rationalStudy.ts +0 -287
- package/lib/maths/algebra/study.ts +0 -506
- package/lib/maths/coefficients/fraction.ts +0 -593
- package/lib/maths/coefficients/nthRoot.ts +0 -148
- package/lib/maths/geometry/circle.ts +0 -379
- package/lib/maths/geometry/line.ts +0 -604
- package/lib/maths/geometry/point.ts +0 -215
- package/lib/maths/geometry/triangle.ts +0 -368
- package/lib/maths/geometry/vector.ts +0 -243
- package/lib/maths/numeric.ts +0 -162
- package/lib/maths/numexp.ts +0 -198
- package/lib/maths/randomization/random.ts +0 -80
- package/lib/maths/randomization/randomCore.ts +0 -19
- package/lib/maths/randomization/rndFraction.ts +0 -47
- package/lib/maths/randomization/rndGeometryCircle.ts +0 -50
- package/lib/maths/randomization/rndGeometryLine.ts +0 -53
- package/lib/maths/randomization/rndGeometryPoint.ts +0 -69
- package/lib/maths/randomization/rndHelpers.ts +0 -107
- package/lib/maths/randomization/rndMonom.ts +0 -57
- package/lib/maths/randomization/rndPolynom.ts +0 -90
- package/lib/maths/randomization/rndTypes.ts +0 -43
- package/lib/maths/shutingyard.ts +0 -496
- package/lib/pimath.ts +0 -40
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { InputValue } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
|
|
4
|
+
export declare class Vector {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
constructor(Vector2D: Vector);
|
|
8
|
+
constructor(start: Vector, end: Vector);
|
|
9
|
+
constructor(a: InputValue<Fraction>, b: InputValue<Fraction>);
|
|
10
|
+
get x(): Fraction;
|
|
11
|
+
set x(value: Fraction | number | string);
|
|
12
|
+
get y(): Fraction;
|
|
13
|
+
set y(value: Fraction | number | string);
|
|
14
|
+
get asPoint(): boolean;
|
|
15
|
+
set asPoint(value: boolean);
|
|
16
|
+
get normSquare(): Fraction;
|
|
17
|
+
get norm(): number;
|
|
18
|
+
get tex(): string;
|
|
19
|
+
get display(): string;
|
|
20
|
+
get array(): Fraction[];
|
|
21
|
+
get dimension(): number;
|
|
22
|
+
get isNull(): boolean;
|
|
23
|
+
static asTex(x: string, y: string): string;
|
|
24
|
+
static scalarProduct: (v1: Vector, v2: Vector) => Fraction;
|
|
25
|
+
static determinant: (v1: Vector, v2: Vector) => Fraction;
|
|
26
|
+
parse: (start: Vector | InputValue<Fraction> | {
|
|
27
|
+
x: Fraction | number;
|
|
28
|
+
y: Fraction | number;
|
|
29
|
+
}, end?: Vector | InputValue<Fraction> | {
|
|
30
|
+
x: Fraction | number;
|
|
31
|
+
y: Fraction;
|
|
32
|
+
}) => Vector;
|
|
33
|
+
clone(): Vector;
|
|
34
|
+
zero: () => this;
|
|
35
|
+
one: () => this;
|
|
36
|
+
opposite: () => this;
|
|
37
|
+
add: (V: Vector) => this;
|
|
38
|
+
subtract: (V: Vector) => this;
|
|
39
|
+
unit: () => this;
|
|
40
|
+
middleOf: (V1: Vector, V2: Vector) => this;
|
|
41
|
+
translate(value: Vector): this;
|
|
42
|
+
translate(value: {
|
|
43
|
+
x: number | Fraction;
|
|
44
|
+
y: number | Fraction;
|
|
45
|
+
}): this;
|
|
46
|
+
distanceTo(item: Vector): {
|
|
47
|
+
value: number;
|
|
48
|
+
fraction: Fraction;
|
|
49
|
+
tex: string;
|
|
50
|
+
};
|
|
51
|
+
dotProduct: (V: Vector) => Fraction;
|
|
52
|
+
determinantWith: (V: Vector) => Fraction;
|
|
53
|
+
normal: () => this;
|
|
54
|
+
isEqual: (v: Vector) => boolean;
|
|
55
|
+
isColinearTo: (v: Vector) => boolean;
|
|
56
|
+
isNormalTo: (v: Vector) => boolean;
|
|
57
|
+
multiplyByScalar: (k: InputValue<Fraction>) => this;
|
|
58
|
+
divideByScalar: (k: InputValue<Fraction>) => this;
|
|
59
|
+
simplify: () => this;
|
|
60
|
+
angleWith: (V: Vector, sharp?: boolean, radian?: boolean) => number;
|
|
61
|
+
private _parseString;
|
|
62
|
+
}
|
|
63
|
+
export declare class Point extends Vector {
|
|
64
|
+
constructor();
|
|
65
|
+
constructor(Point2D: Point);
|
|
66
|
+
constructor(x: InputValue<Fraction>, y: InputValue<Fraction>);
|
|
67
|
+
clone(): Point;
|
|
68
|
+
get tex(): string;
|
|
69
|
+
get display(): string;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/geometry/vector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAInD,qBAAa,MAAM;;;gBAMH,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;gBAC1B,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAU5D,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,C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AE,MAAM,GAAG,IAAI;IAC9B,SAAS,CAAC,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI;IAOtE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAY5E,UAAU,MAAO,MAAM,KAAG,QAAQ,CAEjC;IAED,eAAe,MAAO,MAAM,KAAG,QAAQ,CAEtC;IAED,MAAM,QAAO,IAAI,CAMhB;IAED,OAAO,MAAO,MAAM,KAAG,OAAO,CAE7B;IAED,YAAY,MAAO,MAAM,KAAG,OAAO,CAElC;IAED,UAAU,MAAO,MAAM,KAAG,OAAO,CAEhC;IAED,gBAAgB,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAKjD;IAED,cAAc,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAE/C;IAED,QAAQ,QAAO,IAAI,CASlB;IAED,SAAS,MAAO,MAAM,UAAU,OAAO,WAAW,OAAO,KAAG,MAAM,CAUjE;IAED,OAAO,CAAC,YAAY,CAuBnB;CACJ;AAED,qBAAa,KAAM,SAAQ,MAAM;;gBAEjB,OAAO,EAAE,KAAK;gBACd,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAW5C,KAAK,IAAI,KAAK;IAI9B,IAAa,GAAG,IAAI,MAAM,CAEzB;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;CAEJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InputValue } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
|
|
4
|
+
export declare class Vector3D {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
constructor(A: Point3D, B: Point3D);
|
|
8
|
+
constructor(x: InputValue<Fraction>, y: InputValue<Fraction>, z: InputValue<Fraction>);
|
|
9
|
+
get x(): Fraction;
|
|
10
|
+
set x(value: Fraction | number | string);
|
|
11
|
+
get y(): Fraction;
|
|
12
|
+
set y(value: Fraction | number | string);
|
|
13
|
+
get z(): Fraction;
|
|
14
|
+
set z(value: Fraction | number | string);
|
|
15
|
+
get asPoint(): boolean;
|
|
16
|
+
set asPoint(value: boolean);
|
|
17
|
+
get array(): Fraction[];
|
|
18
|
+
get tex(): string;
|
|
19
|
+
get display(): string;
|
|
20
|
+
readonly dimension = 3;
|
|
21
|
+
clone(): Vector3D;
|
|
22
|
+
static asTex(x: string, y: string, z: string): string;
|
|
23
|
+
isEqual: (v: Vector3D) => boolean;
|
|
24
|
+
add(value: Vector3D): this;
|
|
25
|
+
opposite(): this;
|
|
26
|
+
subtract(value: Vector3D): this;
|
|
27
|
+
multiply(value: Fraction): this;
|
|
28
|
+
dot(value: Vector3D): Fraction;
|
|
29
|
+
cross(value: Vector3D): Vector3D;
|
|
30
|
+
reduce(): this;
|
|
31
|
+
}
|
|
32
|
+
export declare class Point3D extends Vector3D {
|
|
33
|
+
constructor(x: InputValue<Fraction>, y: InputValue<Fraction>, z: InputValue<Fraction>);
|
|
34
|
+
clone(): Point3D;
|
|
35
|
+
get tex(): string;
|
|
36
|
+
get display(): string;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector3d.d.ts","sourceRoot":"","sources":["../../src/geometry/vector3d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAKnD,qBAAa,QAAQ;;;gBAOL,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO;gBACtB,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,U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,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAMrE,KAAK,IAAI,OAAO;IAIhC,IAAa,GAAG,IAAI,MAAM,CAEzB;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;CACJ"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Equation } from './algebra/equation';
|
|
2
|
+
import { Monom } from './algebra/monom';
|
|
3
|
+
import { Polynom } from './algebra/polynom';
|
|
4
|
+
import { Rational } from './algebra/rational';
|
|
5
|
+
import { Fraction } from './coefficients/fraction';
|
|
6
|
+
import { NthRoot } from './coefficients/nthRoot';
|
|
7
|
+
import { Circle } from './geometry/circle';
|
|
8
|
+
import { Line } from './geometry/line';
|
|
9
|
+
import { Vector } from './geometry/vector';
|
|
10
|
+
import { Vector3D } from './geometry/vector3d';
|
|
11
|
+
|
|
12
|
+
declare const PiMath: {
|
|
13
|
+
Numeric: {
|
|
14
|
+
decompose: (value: number) => number[][];
|
|
15
|
+
dividers: (value: number) => number[];
|
|
16
|
+
divideNumbersByGCD: (...values: number[]) => number[];
|
|
17
|
+
gcd: (...values: number[]) => number;
|
|
18
|
+
lcm: (...values: number[]) => number;
|
|
19
|
+
numberCorrection: (value: number, number_of_digits?: number) => number;
|
|
20
|
+
periodic: (value: number) => number;
|
|
21
|
+
primes: (nb?: number | undefined) => number[];
|
|
22
|
+
pythagoreanTripletsWithTarget: (target: number, targetIsSquare?: boolean | undefined) => number[][];
|
|
23
|
+
round: (value: number, decimals?: number) => number;
|
|
24
|
+
};
|
|
25
|
+
Fraction: typeof Fraction;
|
|
26
|
+
Root: typeof NthRoot;
|
|
27
|
+
Monom: typeof Monom;
|
|
28
|
+
Polynom: typeof Polynom;
|
|
29
|
+
Equation: typeof Equation;
|
|
30
|
+
Rational: typeof Rational;
|
|
31
|
+
Random: {
|
|
32
|
+
equation: (config?: import('./randomization/rndTypes').randomEquationConfig | undefined) => Equation;
|
|
33
|
+
polynom: (config?: import('./randomization/rndTypes').randomPolynomConfig | undefined) => Polynom;
|
|
34
|
+
monom: (config?: import('./randomization/rndTypes').randomMonomConfig | undefined) => Monom;
|
|
35
|
+
fraction: (config?: import('./randomization/rndTypes').randomCoefficientConfig | undefined) => Fraction;
|
|
36
|
+
number: (from: number, to: number, exclude?: number[] | undefined) => number;
|
|
37
|
+
numberSym: (max: number, allowZero?: boolean | undefined) => number;
|
|
38
|
+
prime: (max: number) => number;
|
|
39
|
+
bool: (percent?: number | undefined) => boolean;
|
|
40
|
+
array: <T>(arr: T[], number?: number | undefined) => T[];
|
|
41
|
+
item: <T_1>(arr: T_1[]) => T_1;
|
|
42
|
+
shuffle: <T_2>(arr: T_2[]) => T_2[];
|
|
43
|
+
line: (config?: import('./randomization/rndTypes').randomGeometryLineConfig | undefined) => Line;
|
|
44
|
+
line3: (config?: import('./randomization/rndTypes').randomGeometryLine3Config | undefined) => import('./geometry/line3').Line3;
|
|
45
|
+
point: (config?: import('./randomization/rndTypes').randomGeometryPointConfig | undefined) => import('./geometry/vector').Point;
|
|
46
|
+
circle: (config?: import('./randomization/rndTypes').randomGeometryCircleConfig | undefined) => Circle;
|
|
47
|
+
};
|
|
48
|
+
Geometry: {
|
|
49
|
+
Vector: typeof Vector;
|
|
50
|
+
Line: typeof Line;
|
|
51
|
+
Circle: typeof Circle;
|
|
52
|
+
};
|
|
53
|
+
Geometry3D: {
|
|
54
|
+
Vector3D: typeof Vector3D;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export default PiMath;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAgB9C,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaX,CAAA;AAGD,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare function decompose(value: number): number[][];
|
|
2
|
+
declare function divideNumbersByGCD(...values: number[]): number[];
|
|
3
|
+
/**
|
|
4
|
+
* Get the list of all dividers of a number.
|
|
5
|
+
* @param value
|
|
6
|
+
*/
|
|
7
|
+
declare function dividers(value: number): number[];
|
|
8
|
+
/**
|
|
9
|
+
* Great Common Divisor
|
|
10
|
+
* @param values : number values
|
|
11
|
+
*/
|
|
12
|
+
declare function greatestCommonDivisor(...values: number[]): number;
|
|
13
|
+
/**
|
|
14
|
+
* Least Common Multiple
|
|
15
|
+
* @param values: list of numbers
|
|
16
|
+
*/
|
|
17
|
+
declare function leastCommonMultiple(...values: number[]): number;
|
|
18
|
+
declare function numberCorrection(value: number, number_of_digits?: number): number;
|
|
19
|
+
declare function periodic(value: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Get the list of the nth first prime numbers.
|
|
22
|
+
* @param nb : number of primes to choose from
|
|
23
|
+
*/
|
|
24
|
+
declare function primes(nb?: number): number[];
|
|
25
|
+
declare function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): number[][];
|
|
26
|
+
declare function round(value: number, decimals?: number): number;
|
|
27
|
+
export declare const Numeric: {
|
|
28
|
+
decompose: typeof decompose;
|
|
29
|
+
dividers: typeof dividers;
|
|
30
|
+
divideNumbersByGCD: typeof divideNumbersByGCD;
|
|
31
|
+
gcd: typeof greatestCommonDivisor;
|
|
32
|
+
lcm: typeof leastCommonMultiple;
|
|
33
|
+
numberCorrection: typeof numberCorrection;
|
|
34
|
+
periodic: typeof periodic;
|
|
35
|
+
primes: typeof primes;
|
|
36
|
+
pythagoreanTripletsWithTarget: typeof pythagoreanTripletsWithTarget;
|
|
37
|
+
round: typeof round;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fraction } from './coefficients/fraction';
|
|
2
|
+
import { NthRoot } from './coefficients/nthRoot';
|
|
3
|
+
import { Monom } from './algebra/monom';
|
|
4
|
+
|
|
5
|
+
export type InputValue<T> = T | string | number | Fraction | NthRoot;
|
|
6
|
+
export type InputAlgebra<T> = InputValue<T> | Monom;
|
|
7
|
+
export type literalType<T> = Record<string, T>;
|
|
8
|
+
export type compareSign = '>' | ">=" | "=>" | "geq" | '<' | "<=" | "=<" | "leq" | '=' | "<>" | "neq" | "same";
|
|
9
|
+
export declare enum PARTICULAR_SOLUTION {
|
|
10
|
+
real = "\\mathbb{R}",
|
|
11
|
+
varnothing = "\\varnothing"
|
|
12
|
+
}
|
|
13
|
+
export interface IPiMathObject<T> {
|
|
14
|
+
readonly tex: string;
|
|
15
|
+
readonly display: string;
|
|
16
|
+
clone(): T;
|
|
17
|
+
parse(value: unknown): T;
|
|
18
|
+
}
|
|
19
|
+
export interface IExpression<T> {
|
|
20
|
+
zero(): T;
|
|
21
|
+
one(): T;
|
|
22
|
+
add(value: InputValue<T>): T;
|
|
23
|
+
subtract(value: InputValue<T>): T;
|
|
24
|
+
opposite(): T;
|
|
25
|
+
multiply(value: InputValue<T>): T;
|
|
26
|
+
divide(value: InputValue<T>): T | null;
|
|
27
|
+
reduce(): T;
|
|
28
|
+
isEqual(value: InputValue<T>): boolean;
|
|
29
|
+
isZero(): boolean;
|
|
30
|
+
isOne(): boolean;
|
|
31
|
+
inverse(): T | undefined;
|
|
32
|
+
sqrt(): T | undefined;
|
|
33
|
+
pow(value: number): T;
|
|
34
|
+
root(value: number): T | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface IEquation<T> {
|
|
37
|
+
reduce(): T;
|
|
38
|
+
solve(): ISolution[];
|
|
39
|
+
}
|
|
40
|
+
export interface IAlgebra<T> {
|
|
41
|
+
readonly variables: string[];
|
|
42
|
+
hasVariable(letter: string): boolean;
|
|
43
|
+
degree(letter?: string): Fraction;
|
|
44
|
+
evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean): Fraction | number | boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface IAnalyse<T> {
|
|
47
|
+
derivative(): T | T[];
|
|
48
|
+
primitive(): T;
|
|
49
|
+
integrate(a: InputValue<Fraction>, b: InputValue<T>, letter?: string): Fraction;
|
|
50
|
+
}
|
|
51
|
+
export interface ISolution {
|
|
52
|
+
variable: string;
|
|
53
|
+
display: string;
|
|
54
|
+
exact: Fraction | boolean;
|
|
55
|
+
tex: string;
|
|
56
|
+
value: number;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pimath.interface.d.ts","sourceRoot":"","sources":["../src/pimath.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACrE,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;AACnD,MAAM,MAAM,WAAW,CAAC,CAA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AO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGjD,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,oBAAoB,GAAG,QAAQ,CAmCvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndMonom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndMonom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAI3C,wBAAgB,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAiC9D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { randomPolynomConfig } from '../rndTypes';
|
|
2
|
+
import { Polynom } from '../../algebra/polynom';
|
|
3
|
+
|
|
4
|
+
export declare function rndPolynom(userConfig?: randomPolynomConfig): Polynom;
|
|
5
|
+
export declare function rndFactorablePolynom(userConfig?: randomPolynomConfig): Polynom;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndPolynom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndPolynom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAgB/C,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CA8CpE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAiB9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndFraction.d.ts","sourceRoot":"","sources":["../../../src/randomization/coefficient/rndFraction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGtD,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,uBAAuB,GAAG,QAAQ,CAiC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndCircle.d.ts","sourceRoot":"","sources":["../../../src/randomization/geometry/rndCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAE7D,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,0BAA0B,GAAG,MAAM,CAqBzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndLine.d.ts","sourceRoot":"","sources":["../../../src/randomization/geometry/rndLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAG1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D,wBAAgB,OAAO,CAAC,UAAU,CAAC,EAAE,wBAAwB,GAAG,IAAI,CA+BnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndLine3.d.ts","sourceRoot":"","sources":["../../../src/randomization/geometry/rndLine3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAG5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,wBAAgB,QAAQ,CAAC,UAAU,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAoBtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndPoint.d.ts","sourceRoot":"","sources":["../../../src/randomization/geometry/rndPoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAG5D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,wBAAgB,QAAQ,CAAC,UAAU,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAwDtE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { randomCoefficientConfig, randomEquationConfig, randomGeometryCircleConfig, randomGeometryLine3Config, randomGeometryLineConfig, randomGeometryPointConfig, randomMonomConfig, randomPolynomConfig } from './rndTypes';
|
|
2
|
+
|
|
3
|
+
export type * from './rndTypes';
|
|
4
|
+
export declare const Random: {
|
|
5
|
+
equation: (config?: randomEquationConfig) => import('../algebra/equation').Equation;
|
|
6
|
+
polynom: (config?: randomPolynomConfig) => import('../algebra/polynom').Polynom;
|
|
7
|
+
monom: (config?: randomMonomConfig) => import('../algebra/monom').Monom;
|
|
8
|
+
fraction: (config?: randomCoefficientConfig) => import('../coefficients/fraction').Fraction;
|
|
9
|
+
number: (from: number, to: number, exclude?: number[]) => number;
|
|
10
|
+
numberSym: (max: number, allowZero?: boolean) => number;
|
|
11
|
+
prime: (max: number) => number;
|
|
12
|
+
bool: (percent?: number) => boolean;
|
|
13
|
+
array: <T>(arr: T[], number?: number) => T[];
|
|
14
|
+
item: <T_1>(arr: T_1[]) => T_1;
|
|
15
|
+
shuffle: <T_2>(arr: T_2[]) => T_2[];
|
|
16
|
+
line: (config?: randomGeometryLineConfig) => import('../geometry/line').Line;
|
|
17
|
+
line3: (config?: randomGeometryLine3Config) => import('../geometry/line3').Line3;
|
|
18
|
+
point: (config?: randomGeometryPointConfig) => import('../geometry/vector').Point;
|
|
19
|
+
circle: (config?: randomGeometryCircleConfig) => import('../geometry/circle').Circle;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/randomization/random.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACtB,MAAM,YAAY,CAAA;AAWnB,mBAAmB,YAAY,CAAA;AAE/B,eAAO,MAAM,MAAM;wBACK,oBAAoB;uBAIrB,mBAAmB;qBAIrB,iBAAiB;wBAId,uBAAuB;mBAI5B,MAAM,MAAM,MAAM,YAAY,MAAM,EAAE,KAAG,MAAM;qBAI7C,MAAM,cAAc,OAAO,KAAG,MAAM;iBAIxC,MAAM,KAAG,MAAM;qBAIX,MAAM,KAAG,OAAO;oBAIjB,CAAC,EAAE,WAAW,MAAM,KAAG,CAAC,EAAE;;;oBAY1B,wBAAwB;qBAIvB,yBAAyB;qBAIzB,yBAAyB;sBAIxB,0BAA0B;CAG/C,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random boolean with a percent ratio
|
|
3
|
+
* @param percent
|
|
4
|
+
*/
|
|
5
|
+
export declare function randomBool(percent?: number): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Random integer between two values.
|
|
8
|
+
* @param a (number) : From this value to the second value. If the second is ommited, this value is the max value.
|
|
9
|
+
* @param b (number) : To this value. If this is ommited.
|
|
10
|
+
*/
|
|
11
|
+
export declare function randomInt(a: number, b?: number, exclude?: number[]): number;
|
|
12
|
+
/**
|
|
13
|
+
* Random integer between -max and max value.
|
|
14
|
+
* @param max (number) : determine the limits.
|
|
15
|
+
* @param zero (bool) : determine if zero is allowed or not.
|
|
16
|
+
*/
|
|
17
|
+
export declare function randomIntSym(max: number, zero?: boolean): number;
|
|
18
|
+
export declare function randomPrime(max?: number): number;
|
|
19
|
+
export declare function randomArray<T>(arr: T[], number?: number): T[];
|
|
20
|
+
export declare function randomItem<T>(arr: T[]): T;
|
|
21
|
+
export declare function shuffleArray<T>(arr: T[]): T[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
|
|
3
|
+
export interface randomCoefficientConfig {
|
|
4
|
+
negative?: boolean;
|
|
5
|
+
max?: number;
|
|
6
|
+
reduced?: boolean;
|
|
7
|
+
zero?: boolean;
|
|
8
|
+
natural?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface randomMonomConfig {
|
|
11
|
+
letters?: string;
|
|
12
|
+
degree?: number;
|
|
13
|
+
fraction?: boolean | randomCoefficientConfig;
|
|
14
|
+
zero?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface randomPolynomConfig {
|
|
17
|
+
letters?: string;
|
|
18
|
+
degree?: number;
|
|
19
|
+
fraction?: boolean | randomCoefficientConfig;
|
|
20
|
+
zero?: boolean;
|
|
21
|
+
unit?: boolean;
|
|
22
|
+
factorable?: boolean;
|
|
23
|
+
allowNullMonom?: boolean;
|
|
24
|
+
numberOfMonoms?: number;
|
|
25
|
+
positive?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface randomEquationConfig extends randomPolynomConfig {
|
|
28
|
+
solution?: {
|
|
29
|
+
allowZero?: boolean;
|
|
30
|
+
fraction?: boolean;
|
|
31
|
+
nothing?: boolean;
|
|
32
|
+
everything?: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface randomGeometryLineConfig {
|
|
36
|
+
A: {
|
|
37
|
+
x: number | Fraction;
|
|
38
|
+
y: number | Fraction;
|
|
39
|
+
};
|
|
40
|
+
slope?: Fraction | string | number;
|
|
41
|
+
}
|
|
42
|
+
export interface randomGeometryLine3Config {
|
|
43
|
+
A?: {
|
|
44
|
+
x: number | Fraction;
|
|
45
|
+
y: number | Fraction;
|
|
46
|
+
z: number | Fraction;
|
|
47
|
+
};
|
|
48
|
+
direction?: {
|
|
49
|
+
x: number | Fraction;
|
|
50
|
+
y: number | Fraction;
|
|
51
|
+
z: number | Fraction;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface randomGeometryPointConfig {
|
|
55
|
+
quadrant?: number | null;
|
|
56
|
+
axis?: 'x' | 'y' | 'z' | null;
|
|
57
|
+
fraction?: boolean;
|
|
58
|
+
max?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface randomGeometryCircleConfig {
|
|
61
|
+
center?: randomGeometryPointConfig;
|
|
62
|
+
radius?: number;
|
|
63
|
+
pointsOnCircle?: number;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rndTypes.d.ts","sourceRoot":"","sources":["../../src/randomization/rndTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,UAAU,CAAC,EAAE,OAAO,CAAC;KACxB,CAAA;CACJ;AAID,MAAM,WAAW,wBAAwB;IACrC,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IAClD,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,yBAAyB;IACtC,CAAC,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IACzE,SAAS,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;CACpF;AAGD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,0BAA0B;IACvC,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B"}
|
package/dist/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PiMath } from './pimath.ts';
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Fraction } from '../coefficients/fraction';
|
|
2
|
-
import { literalType } from './monom';
|
|
3
|
-
import { Polynom } from './polynom';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Equation is a class to manage equations...
|
|
7
|
-
*/
|
|
8
|
-
export interface ISolution {
|
|
9
|
-
tex: string;
|
|
10
|
-
display: string;
|
|
11
|
-
value: number;
|
|
12
|
-
exact: unknown;
|
|
13
|
-
}
|
|
14
|
-
export declare enum PARTICULAR_SOLUTION {
|
|
15
|
-
real = "\\mathbb{R}",
|
|
16
|
-
varnothing = "\\varnothing"
|
|
17
|
-
}
|
|
18
|
-
export declare class Equation {
|
|
19
|
-
private _polynom;
|
|
20
|
-
private _varnothing;
|
|
21
|
-
private _real;
|
|
22
|
-
private _left;
|
|
23
|
-
private _right;
|
|
24
|
-
private _sign;
|
|
25
|
-
private _solutions;
|
|
26
|
-
private _randomizeDefaults;
|
|
27
|
-
/**
|
|
28
|
-
* Create an Equation using two polynoms.
|
|
29
|
-
* Markdown *support* is cool
|
|
30
|
-
* @param equations
|
|
31
|
-
*/
|
|
32
|
-
constructor(...equations: unknown[]);
|
|
33
|
-
get left(): Polynom;
|
|
34
|
-
set left(value: Polynom);
|
|
35
|
-
get right(): Polynom;
|
|
36
|
-
set right(value: Polynom);
|
|
37
|
-
get sign(): string;
|
|
38
|
-
set sign(value: string);
|
|
39
|
-
get solutions(): ISolution[];
|
|
40
|
-
get isEquation(): boolean;
|
|
41
|
-
get solution(): string;
|
|
42
|
-
get isReal(): boolean;
|
|
43
|
-
get isVarnothing(): boolean;
|
|
44
|
-
get signAsTex(): string;
|
|
45
|
-
get tex(): string;
|
|
46
|
-
get display(): string;
|
|
47
|
-
get raw(): string;
|
|
48
|
-
get variables(): string[];
|
|
49
|
-
get numberOfVars(): number;
|
|
50
|
-
get randomizeDefaults(): {
|
|
51
|
-
[key: string]: number | string | boolean;
|
|
52
|
-
};
|
|
53
|
-
set randomizeDefaults(value: {
|
|
54
|
-
[key: string]: number | string | boolean;
|
|
55
|
-
});
|
|
56
|
-
static makeSolutionsUnique(solutions: ISolution[], sorted?: boolean): ISolution[];
|
|
57
|
-
hasVariable: (letter: string) => boolean;
|
|
58
|
-
parse: (equationString: string) => Equation;
|
|
59
|
-
create: (left: Polynom, right: Polynom, sign?: string) => Equation;
|
|
60
|
-
clone: () => Equation;
|
|
61
|
-
randomize: (opts?: {}, sign?: string) => Equation;
|
|
62
|
-
/**
|
|
63
|
-
* Reorder will move all monoms containing a letter on the left, all the other on the right.
|
|
64
|
-
*/
|
|
65
|
-
moveLeft: () => Equation;
|
|
66
|
-
reorder: (allLeft?: boolean) => Equation;
|
|
67
|
-
/**
|
|
68
|
-
* Multiply by the lcm denominator and divide by the gcm numerators.
|
|
69
|
-
*/
|
|
70
|
-
simplify: () => Equation;
|
|
71
|
-
/**
|
|
72
|
-
* Reorder the polynom to have only one letter on the left, the rest on the right.
|
|
73
|
-
* @param letter
|
|
74
|
-
*/
|
|
75
|
-
isolate: (letter?: string) => Equation | false;
|
|
76
|
-
replaceBy: (letter: string, P: Polynom) => Equation;
|
|
77
|
-
/**
|
|
78
|
-
* Multiple an equation by a fraction value.
|
|
79
|
-
* @param value
|
|
80
|
-
*/
|
|
81
|
-
multiply: (value: unknown) => Equation;
|
|
82
|
-
/**
|
|
83
|
-
* divide an equation by a given value (transformed as a fraction)
|
|
84
|
-
*
|
|
85
|
-
* ```
|
|
86
|
-
* 8x+10=6x \vert 2
|
|
87
|
-
* 4x+5=3x
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* |>Alternatively with $3x-4$ maybe it's working ?
|
|
91
|
-
* $$\frac{3x}{5}$$
|
|
92
|
-
*
|
|
93
|
-
* @param value
|
|
94
|
-
* @returns {Equation}
|
|
95
|
-
*/
|
|
96
|
-
divide: (value: unknown) => Equation;
|
|
97
|
-
/**
|
|
98
|
-
* Get the degree of the equation
|
|
99
|
-
* @param letter
|
|
100
|
-
*/
|
|
101
|
-
degree: (letter?: string) => Fraction;
|
|
102
|
-
/**
|
|
103
|
-
* Determine if the equation contains more than one letter/variable.
|
|
104
|
-
*/
|
|
105
|
-
isMultiVariable: () => boolean;
|
|
106
|
-
letters: () => string[];
|
|
107
|
-
solve: () => Equation;
|
|
108
|
-
test: (values: literalType) => Boolean;
|
|
109
|
-
isSameAs: (equ: Equation) => Boolean;
|
|
110
|
-
isLinearTo: (equ: Equation) => Boolean;
|
|
111
|
-
private _findSign;
|
|
112
|
-
private _formatSign;
|
|
113
|
-
private _reverseSign;
|
|
114
|
-
private isGreater;
|
|
115
|
-
private isStrictEqual;
|
|
116
|
-
private isAlsoEqual;
|
|
117
|
-
private _solveDegree1;
|
|
118
|
-
private _solveDegree2;
|
|
119
|
-
private _solveDegree3plus;
|
|
120
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Fraction } from '../coefficients/fraction';
|
|
2
|
-
import { Equation } from './equation';
|
|
3
|
-
|
|
4
|
-
export declare class LinearSystem {
|
|
5
|
-
private _equations;
|
|
6
|
-
private _letters;
|
|
7
|
-
private _resolutionSteps;
|
|
8
|
-
private _solutions;
|
|
9
|
-
constructor(...equationStrings: (string | Equation)[]);
|
|
10
|
-
get equations(): Equation[];
|
|
11
|
-
set equations(value: Equation[]);
|
|
12
|
-
get letters(): string;
|
|
13
|
-
set letters(value: string);
|
|
14
|
-
get isSolvable(): boolean;
|
|
15
|
-
get variables(): string[];
|
|
16
|
-
get tex(): string;
|
|
17
|
-
get solution(): string;
|
|
18
|
-
get solutionAsDisplay(): string;
|
|
19
|
-
get resolutionSteps(): {
|
|
20
|
-
[p: string]: {
|
|
21
|
-
equations: Equation[];
|
|
22
|
-
operations: string[][];
|
|
23
|
-
}[];
|
|
24
|
-
};
|
|
25
|
-
buildTex: (equations: Equation[], operators?: (string[])[]) => string;
|
|
26
|
-
stepTex: (letter: string) => string;
|
|
27
|
-
parse: (...equations: (string | Equation)[]) => LinearSystem;
|
|
28
|
-
clone: () => LinearSystem;
|
|
29
|
-
reorder: () => LinearSystem;
|
|
30
|
-
solve: (withResolution?: boolean) => LinearSystem;
|
|
31
|
-
mergeEquations: (eq1: Equation, eq2: Equation, factor1: Fraction, factor2: Fraction) => Equation;
|
|
32
|
-
private _findLetters;
|
|
33
|
-
private _linearReduction;
|
|
34
|
-
/**
|
|
35
|
-
* Linear reduction of the equations to have only one letter
|
|
36
|
-
* @param letter letter to isolate
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
private _solveOneLetter;
|
|
40
|
-
}
|