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.
Files changed (114) hide show
  1. package/dist/pimath.js +2444 -3566
  2. package/package.json +37 -20
  3. package/types/algebra/equation.d.ts +109 -0
  4. package/types/algebra/equation.d.ts.map +1 -0
  5. package/types/algebra/equationSolver.d.ts +16 -0
  6. package/types/algebra/equationSolver.d.ts.map +1 -0
  7. package/types/algebra/factor.d.ts +47 -0
  8. package/types/algebra/factor.d.ts.map +1 -0
  9. package/{dist/maths → types}/algebra/monom.d.ts +98 -131
  10. package/types/algebra/monom.d.ts.map +1 -0
  11. package/types/algebra/polyFactor.d.ts +41 -0
  12. package/types/algebra/polyFactor.d.ts.map +1 -0
  13. package/types/algebra/polynom.d.ts +126 -0
  14. package/types/algebra/polynom.d.ts.map +1 -0
  15. package/types/algebra/rational.d.ts +41 -0
  16. package/types/algebra/rational.d.ts.map +1 -0
  17. package/{dist/maths → types}/coefficients/fraction.d.ts +69 -66
  18. package/types/coefficients/fraction.d.ts.map +1 -0
  19. package/{dist/maths → types}/coefficients/nthRoot.d.ts +3 -3
  20. package/{dist/maths → types}/geometry/circle.d.ts +10 -15
  21. package/types/geometry/circle.d.ts.map +1 -0
  22. package/types/geometry/geomMath.d.ts +10 -0
  23. package/types/geometry/geomMath.d.ts.map +1 -0
  24. package/{dist/maths → types}/geometry/line.d.ts +25 -35
  25. package/types/geometry/line.d.ts.map +1 -0
  26. package/types/geometry/line3.d.ts +50 -0
  27. package/types/geometry/line3.d.ts.map +1 -0
  28. package/types/geometry/plane3.d.ts +29 -0
  29. package/types/geometry/plane3.d.ts.map +1 -0
  30. package/types/geometry/vector.d.ts +70 -0
  31. package/types/geometry/vector.d.ts.map +1 -0
  32. package/types/geometry/vector3d.d.ts +37 -0
  33. package/types/geometry/vector3d.d.ts.map +1 -0
  34. package/types/index.d.ts +57 -0
  35. package/types/index.d.ts.map +1 -0
  36. package/types/numeric.d.ts +39 -0
  37. package/types/pimath.interface.d.ts +57 -0
  38. package/types/pimath.interface.d.ts.map +1 -0
  39. package/types/randomization/algebra/rndEquation.d.ts +4 -0
  40. package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
  41. package/types/randomization/algebra/rndMonom.d.ts +4 -0
  42. package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
  43. package/types/randomization/algebra/rndPolynom.d.ts +5 -0
  44. package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
  45. package/types/randomization/coefficient/rndFraction.d.ts +4 -0
  46. package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
  47. package/types/randomization/geometry/rndCircle.d.ts +4 -0
  48. package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
  49. package/types/randomization/geometry/rndLine.d.ts +4 -0
  50. package/types/randomization/geometry/rndLine.d.ts.map +1 -0
  51. package/types/randomization/geometry/rndLine3.d.ts +4 -0
  52. package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
  53. package/types/randomization/geometry/rndPoint.d.ts +4 -0
  54. package/types/randomization/geometry/rndPoint.d.ts.map +1 -0
  55. package/types/randomization/random.d.ts +20 -0
  56. package/types/randomization/random.d.ts.map +1 -0
  57. package/types/randomization/rndHelpers.d.ts +21 -0
  58. package/types/randomization/rndTypes.d.ts +64 -0
  59. package/types/randomization/rndTypes.d.ts.map +1 -0
  60. package/dist/main.d.ts +0 -1
  61. package/dist/maths/algebra/equation.d.ts +0 -120
  62. package/dist/maths/algebra/linearSystem.d.ts +0 -40
  63. package/dist/maths/algebra/logicalset.d.ts +0 -28
  64. package/dist/maths/algebra/polynom.d.ts +0 -155
  65. package/dist/maths/algebra/rational.d.ts +0 -44
  66. package/dist/maths/algebra/study/rationalStudy.d.ts +0 -14
  67. package/dist/maths/algebra/study.d.ts +0 -140
  68. package/dist/maths/geometry/point.d.ts +0 -36
  69. package/dist/maths/geometry/triangle.d.ts +0 -92
  70. package/dist/maths/geometry/vector.d.ts +0 -38
  71. package/dist/maths/numeric.d.ts +0 -28
  72. package/dist/maths/numexp.d.ts +0 -19
  73. package/dist/maths/randomization/random.d.ts +0 -26
  74. package/dist/maths/randomization/randomCore.d.ts +0 -7
  75. package/dist/maths/randomization/rndFraction.d.ts +0 -13
  76. package/dist/maths/randomization/rndGeometryCircle.d.ts +0 -13
  77. package/dist/maths/randomization/rndGeometryLine.d.ts +0 -13
  78. package/dist/maths/randomization/rndGeometryPoint.d.ts +0 -13
  79. package/dist/maths/randomization/rndHelpers.d.ts +0 -23
  80. package/dist/maths/randomization/rndMonom.d.ts +0 -13
  81. package/dist/maths/randomization/rndPolynom.d.ts +0 -14
  82. package/dist/maths/randomization/rndTypes.d.ts +0 -40
  83. package/dist/maths/shutingyard.d.ts +0 -59
  84. package/dist/pimath.d.ts +0 -39
  85. package/lib/main.ts +0 -1
  86. package/lib/maths/algebra/equation.ts +0 -891
  87. package/lib/maths/algebra/linearSystem.ts +0 -369
  88. package/lib/maths/algebra/logicalset.ts +0 -183
  89. package/lib/maths/algebra/monom.ts +0 -1027
  90. package/lib/maths/algebra/polynom.ts +0 -1537
  91. package/lib/maths/algebra/rational.ts +0 -244
  92. package/lib/maths/algebra/study/rationalStudy.ts +0 -287
  93. package/lib/maths/algebra/study.ts +0 -506
  94. package/lib/maths/coefficients/fraction.ts +0 -593
  95. package/lib/maths/coefficients/nthRoot.ts +0 -148
  96. package/lib/maths/geometry/circle.ts +0 -379
  97. package/lib/maths/geometry/line.ts +0 -604
  98. package/lib/maths/geometry/point.ts +0 -215
  99. package/lib/maths/geometry/triangle.ts +0 -368
  100. package/lib/maths/geometry/vector.ts +0 -243
  101. package/lib/maths/numeric.ts +0 -162
  102. package/lib/maths/numexp.ts +0 -198
  103. package/lib/maths/randomization/random.ts +0 -80
  104. package/lib/maths/randomization/randomCore.ts +0 -19
  105. package/lib/maths/randomization/rndFraction.ts +0 -47
  106. package/lib/maths/randomization/rndGeometryCircle.ts +0 -50
  107. package/lib/maths/randomization/rndGeometryLine.ts +0 -53
  108. package/lib/maths/randomization/rndGeometryPoint.ts +0 -69
  109. package/lib/maths/randomization/rndHelpers.ts +0 -107
  110. package/lib/maths/randomization/rndMonom.ts +0 -57
  111. package/lib/maths/randomization/rndPolynom.ts +0 -90
  112. package/lib/maths/randomization/rndTypes.ts +0 -43
  113. package/lib/maths/shutingyard.ts +0 -496
  114. 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";