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
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Point } from '../geometry/point';
|
|
2
|
-
import { randomGeometryPointConfig } from './random';
|
|
3
|
-
import { randomCore } from './randomCore';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Create a random monom based on a based configuration
|
|
7
|
-
*/
|
|
8
|
-
export declare class rndGeometryPoint extends randomCore {
|
|
9
|
-
protected _config: randomGeometryPointConfig;
|
|
10
|
-
protected _defaultConfig: randomGeometryPointConfig;
|
|
11
|
-
constructor(userConfig?: randomGeometryPointConfig);
|
|
12
|
-
generate: () => Point;
|
|
13
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare class rndHelpers {
|
|
2
|
-
/**
|
|
3
|
-
* Random boolean with a percent ratio
|
|
4
|
-
* @param percent
|
|
5
|
-
*/
|
|
6
|
-
static randomBool(percent?: number): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Random integer between two values.
|
|
9
|
-
* @param a (number) : From this value to the second value. If the second is ommited, this value is the max value.
|
|
10
|
-
* @param b (number) : To this value. If this is ommited.
|
|
11
|
-
*/
|
|
12
|
-
static randomInt(a: number, b?: number, exclude?: number[]): number;
|
|
13
|
-
/**
|
|
14
|
-
* Random integer between -max and max value.
|
|
15
|
-
* @param max (number) : determine the limits.
|
|
16
|
-
* @param zero (bool) : determine if zero is allowed or not.
|
|
17
|
-
*/
|
|
18
|
-
static randomIntSym(max: number, zero?: boolean): number;
|
|
19
|
-
static randomPrime(max: number): number;
|
|
20
|
-
static randomArray(arr: any[], number?: number): any[];
|
|
21
|
-
static randomItem(arr: any[]): any;
|
|
22
|
-
static shuffleArray(arr: any[]): any[];
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Monom } from '../algebra/monom';
|
|
2
|
-
import { randomMonomConfig } from './rndTypes';
|
|
3
|
-
import { randomCore } from './randomCore';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Create a random monom based on a based configuration
|
|
7
|
-
*/
|
|
8
|
-
export declare class rndMonom extends randomCore {
|
|
9
|
-
protected _config: randomMonomConfig;
|
|
10
|
-
protected _defaultConfig: randomMonomConfig;
|
|
11
|
-
generate: () => Monom;
|
|
12
|
-
constructor(userConfig?: randomMonomConfig);
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Polynom } from '../algebra/polynom';
|
|
2
|
-
import { randomPolynomConfig } from './rndTypes';
|
|
3
|
-
import { randomCore } from './randomCore';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Random polynoms
|
|
7
|
-
*/
|
|
8
|
-
export declare class rndPolynom extends randomCore {
|
|
9
|
-
protected _config: randomPolynomConfig;
|
|
10
|
-
protected _defaultConfig: randomPolynomConfig;
|
|
11
|
-
generate: () => Polynom;
|
|
12
|
-
constructor(userConfig?: randomPolynomConfig);
|
|
13
|
-
factorable: () => Polynom;
|
|
14
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Fraction } from '../coefficients/fraction';
|
|
2
|
-
|
|
3
|
-
export type randomCoefficientConfig = {
|
|
4
|
-
negative?: boolean;
|
|
5
|
-
max?: number;
|
|
6
|
-
reduced?: boolean;
|
|
7
|
-
zero?: boolean;
|
|
8
|
-
natural?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type randomMonomConfig = {
|
|
11
|
-
letters?: string;
|
|
12
|
-
degree?: number;
|
|
13
|
-
fraction?: boolean | randomCoefficientConfig;
|
|
14
|
-
zero?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export type randomPolynomConfig = randomMonomConfig & {
|
|
17
|
-
unit?: boolean;
|
|
18
|
-
factorable?: boolean;
|
|
19
|
-
allowNullMonom?: boolean;
|
|
20
|
-
numberOfMonoms?: number;
|
|
21
|
-
positive?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type randomGeometryLineConfig = {
|
|
24
|
-
A: {
|
|
25
|
-
x: number | Fraction;
|
|
26
|
-
y: number | Fraction;
|
|
27
|
-
};
|
|
28
|
-
slope?: Fraction | string | number;
|
|
29
|
-
};
|
|
30
|
-
export type randomGeometryPointConfig = {
|
|
31
|
-
quadrant?: number;
|
|
32
|
-
axis?: string | boolean;
|
|
33
|
-
fraction?: boolean;
|
|
34
|
-
max?: number;
|
|
35
|
-
};
|
|
36
|
-
export type randomGeometryCircleConfig = {
|
|
37
|
-
center?: randomGeometryPointConfig;
|
|
38
|
-
radius?: number;
|
|
39
|
-
pointsOnCircle?: number;
|
|
40
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export type tokenType = {
|
|
2
|
-
[key: string]: {
|
|
3
|
-
precedence: number;
|
|
4
|
-
associative: string;
|
|
5
|
-
type: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const tokenConstant: {
|
|
9
|
-
[Key: string]: number;
|
|
10
|
-
};
|
|
11
|
-
export declare enum ShutingyardType {
|
|
12
|
-
VARIABLE = "variable",
|
|
13
|
-
COEFFICIENT = "coefficient",
|
|
14
|
-
OPERATION = "operation",
|
|
15
|
-
CONSTANT = "constant",
|
|
16
|
-
FUNCTION = "function",
|
|
17
|
-
MONOM = "monom"
|
|
18
|
-
}
|
|
19
|
-
export declare enum ShutingyardMode {
|
|
20
|
-
EXPRESSION = "expression",
|
|
21
|
-
POLYNOM = "polynom",
|
|
22
|
-
SET = "set",
|
|
23
|
-
NUMERIC = "numeric"
|
|
24
|
-
}
|
|
25
|
-
export type Token = {
|
|
26
|
-
token: string;
|
|
27
|
-
tokenType: string;
|
|
28
|
-
};
|
|
29
|
-
export declare class Shutingyard {
|
|
30
|
-
readonly _mode: ShutingyardMode;
|
|
31
|
-
private _rpn;
|
|
32
|
-
private _tokenConfig;
|
|
33
|
-
private _tokenConstant;
|
|
34
|
-
private _tokenKeys;
|
|
35
|
-
private _uniformize;
|
|
36
|
-
constructor(mode?: ShutingyardMode);
|
|
37
|
-
get rpn(): Token[];
|
|
38
|
-
get rpnToken(): string[];
|
|
39
|
-
/**
|
|
40
|
-
* Determin if the token is a defined operation
|
|
41
|
-
* Defined operations: + - * / ^ sin cos tan
|
|
42
|
-
* @param token
|
|
43
|
-
*/
|
|
44
|
-
tokenConfigInitialization(): tokenType;
|
|
45
|
-
/**
|
|
46
|
-
* Get the next token to analyse.
|
|
47
|
-
* @param expr (string) Expression to analyse
|
|
48
|
-
* @param start (number) CUrrent position in the expr string.
|
|
49
|
-
*/
|
|
50
|
-
NextToken(expr: string, start: number): [string, number, string];
|
|
51
|
-
normalize(expr: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Parse an expression using the shutting yard tree algorithms
|
|
54
|
-
* @param expr (string) Expression to analyse
|
|
55
|
-
* Returns a RPN list of items.
|
|
56
|
-
* @param uniformize
|
|
57
|
-
*/
|
|
58
|
-
parse(expr: string, uniformize?: boolean): Shutingyard;
|
|
59
|
-
}
|
package/dist/pimath.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Circle } from './maths/geometry/circle.ts';
|
|
2
|
-
import { Triangle } from './maths/geometry/triangle.ts';
|
|
3
|
-
import { Line } from './maths/geometry/line.ts';
|
|
4
|
-
import { Point } from './maths/geometry/point.ts';
|
|
5
|
-
import { Vector } from './maths/geometry/vector.ts';
|
|
6
|
-
import { Random } from './maths/randomization/random.ts';
|
|
7
|
-
import { Logicalset } from './maths/algebra/logicalset.ts';
|
|
8
|
-
import { Rational } from './maths/algebra/rational.ts';
|
|
9
|
-
import { LinearSystem } from './maths/algebra/linearSystem.ts';
|
|
10
|
-
import { Equation } from './maths/algebra/equation.ts';
|
|
11
|
-
import { Polynom } from './maths/algebra/polynom.ts';
|
|
12
|
-
import { Monom } from './maths/algebra/monom.ts';
|
|
13
|
-
import { NthRoot } from './maths/coefficients/nthRoot.ts';
|
|
14
|
-
import { Fraction } from './maths/coefficients/fraction.ts';
|
|
15
|
-
import { NumExp } from './maths/numexp.ts';
|
|
16
|
-
import { Numeric } from './maths/numeric.ts';
|
|
17
|
-
import { Shutingyard } from './maths/shutingyard.ts';
|
|
18
|
-
|
|
19
|
-
export declare const PiMath: {
|
|
20
|
-
ShutingYard: typeof Shutingyard;
|
|
21
|
-
Numeric: typeof Numeric;
|
|
22
|
-
NumExp: typeof NumExp;
|
|
23
|
-
Fraction: typeof Fraction;
|
|
24
|
-
Root: typeof NthRoot;
|
|
25
|
-
Monom: typeof Monom;
|
|
26
|
-
Polynom: typeof Polynom;
|
|
27
|
-
Equation: typeof Equation;
|
|
28
|
-
LinearSystem: typeof LinearSystem;
|
|
29
|
-
Rational: typeof Rational;
|
|
30
|
-
Logicalset: typeof Logicalset;
|
|
31
|
-
Random: typeof Random;
|
|
32
|
-
Geometry: {
|
|
33
|
-
Vector: typeof Vector;
|
|
34
|
-
Point: typeof Point;
|
|
35
|
-
Line: typeof Line;
|
|
36
|
-
Triangle: typeof Triangle;
|
|
37
|
-
Circle: typeof Circle;
|
|
38
|
-
};
|
|
39
|
-
};
|
package/lib/main.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {PiMath} from "./pimath.ts";
|