pimath 0.0.133 → 0.1.0

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 (94) hide show
  1. package/dist/pimath.js +2888 -3590
  2. package/package.json +38 -20
  3. package/types/algebra/equation.d.ts +102 -0
  4. package/types/algebra/equation.d.ts.map +1 -0
  5. package/types/algebra/equationSolver.d.ts +10 -0
  6. package/types/algebra/equationSolver.d.ts.map +1 -0
  7. package/types/algebra/factor.d.ts +46 -0
  8. package/types/algebra/factor.d.ts.map +1 -0
  9. package/types/algebra/linearSystem.d.ts +37 -0
  10. package/types/algebra/linearSystem.d.ts.map +1 -0
  11. package/{dist/maths → types}/algebra/monom.d.ts +95 -133
  12. package/types/algebra/monom.d.ts.map +1 -0
  13. package/types/algebra/polyFactor.d.ts +43 -0
  14. package/types/algebra/polyFactor.d.ts.map +1 -0
  15. package/types/algebra/polynom.d.ts +107 -0
  16. package/types/algebra/polynom.d.ts.map +1 -0
  17. package/types/algebra/rational.d.ts +41 -0
  18. package/types/algebra/rational.d.ts.map +1 -0
  19. package/{dist/maths → types}/coefficients/fraction.d.ts +69 -67
  20. package/types/coefficients/fraction.d.ts.map +1 -0
  21. package/{dist/maths → types}/coefficients/nthRoot.d.ts +4 -7
  22. package/types/coefficients/nthRoot.d.ts.map +1 -0
  23. package/{dist/maths → types}/geometry/circle.d.ts +14 -21
  24. package/types/geometry/circle.d.ts.map +1 -0
  25. package/types/geometry/geomMath.d.ts +9 -0
  26. package/types/geometry/geomMath.d.ts.map +1 -0
  27. package/types/geometry/line.d.ts +83 -0
  28. package/types/geometry/line.d.ts.map +1 -0
  29. package/types/geometry/line3.d.ts +58 -0
  30. package/types/geometry/line3.d.ts.map +1 -0
  31. package/types/geometry/matrix.d.ts +12 -0
  32. package/types/geometry/matrix.d.ts.map +1 -0
  33. package/types/geometry/plane3.d.ts +36 -0
  34. package/types/geometry/plane3.d.ts.map +1 -0
  35. package/types/geometry/point.d.ts +12 -0
  36. package/types/geometry/point.d.ts.map +1 -0
  37. package/{dist/maths → types}/geometry/triangle.d.ts +11 -34
  38. package/types/geometry/triangle.d.ts.map +1 -0
  39. package/types/geometry/vector.d.ts +55 -0
  40. package/types/geometry/vector.d.ts.map +1 -0
  41. package/types/geometry/vector3d.d.ts +37 -0
  42. package/types/geometry/vector3d.d.ts.map +1 -0
  43. package/types/helpers.d.ts +3 -0
  44. package/types/helpers.d.ts.map +1 -0
  45. package/types/index.d.ts +59 -0
  46. package/types/index.d.ts.map +1 -0
  47. package/types/numeric.d.ts +39 -0
  48. package/types/pimath.interface.d.ts +57 -0
  49. package/types/pimath.interface.d.ts.map +1 -0
  50. package/types/randomization/algebra/rndEquation.d.ts +4 -0
  51. package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
  52. package/types/randomization/algebra/rndMonom.d.ts +4 -0
  53. package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
  54. package/types/randomization/algebra/rndPolynom.d.ts +5 -0
  55. package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
  56. package/types/randomization/coefficient/rndFraction.d.ts +4 -0
  57. package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
  58. package/types/randomization/geometry/rndCircle.d.ts +4 -0
  59. package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
  60. package/types/randomization/geometry/rndLine.d.ts +4 -0
  61. package/types/randomization/geometry/rndLine.d.ts.map +1 -0
  62. package/types/randomization/geometry/rndLine3.d.ts +4 -0
  63. package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
  64. package/types/randomization/geometry/rndPoint.d.ts +4 -0
  65. package/types/randomization/geometry/rndPoint.d.ts.map +1 -0
  66. package/types/randomization/random.d.ts +20 -0
  67. package/types/randomization/random.d.ts.map +1 -0
  68. package/types/randomization/rndHelpers.d.ts +21 -0
  69. package/types/randomization/rndTypes.d.ts +64 -0
  70. package/types/randomization/rndTypes.d.ts.map +1 -0
  71. package/dist/main.d.ts +0 -39
  72. package/dist/maths/algebra/equation.d.ts +0 -120
  73. package/dist/maths/algebra/linearSystem.d.ts +0 -40
  74. package/dist/maths/algebra/logicalset.d.ts +0 -28
  75. package/dist/maths/algebra/polynom.d.ts +0 -155
  76. package/dist/maths/algebra/rational.d.ts +0 -44
  77. package/dist/maths/algebra/study/rationalStudy.d.ts +0 -14
  78. package/dist/maths/algebra/study.d.ts +0 -140
  79. package/dist/maths/geometry/line.d.ts +0 -102
  80. package/dist/maths/geometry/point.d.ts +0 -36
  81. package/dist/maths/geometry/vector.d.ts +0 -38
  82. package/dist/maths/numeric.d.ts +0 -28
  83. package/dist/maths/numexp.d.ts +0 -19
  84. package/dist/maths/randomization/random.d.ts +0 -26
  85. package/dist/maths/randomization/randomCore.d.ts +0 -7
  86. package/dist/maths/randomization/rndFraction.d.ts +0 -13
  87. package/dist/maths/randomization/rndGeometryCircle.d.ts +0 -13
  88. package/dist/maths/randomization/rndGeometryLine.d.ts +0 -13
  89. package/dist/maths/randomization/rndGeometryPoint.d.ts +0 -13
  90. package/dist/maths/randomization/rndHelpers.d.ts +0 -23
  91. package/dist/maths/randomization/rndMonom.d.ts +0 -13
  92. package/dist/maths/randomization/rndPolynom.d.ts +0 -14
  93. package/dist/maths/randomization/rndTypes.d.ts +0 -40
  94. package/dist/maths/shutingyard.d.ts +0 -59
@@ -0,0 +1,12 @@
1
+ import { Fraction } from '../coefficients/fraction';
2
+ import { InputValue } from '../pimath.interface';
3
+ import { Vector } from './vector';
4
+
5
+ export declare class Point extends Vector {
6
+ constructor();
7
+ constructor(value: Vector);
8
+ constructor(start: Vector, end: Vector);
9
+ constructor(...values: InputValue<Fraction>[]);
10
+ parse(...values: Vector[] | InputValue<Fraction>[]): this;
11
+ clone(): Point;
12
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,qBAAa,KAAM,SAAQ,MAAM;;gBAGjB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;gBAC1B,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;IAU7B,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;IAyCzD,KAAK,IAAI,KAAK;CAOjC"}
@@ -1,50 +1,44 @@
1
1
  import { Line } from './line';
2
2
  import { Vector } from './vector';
3
- import { Point } from './point';
4
3
 
5
4
  export interface remarquableLines {
6
5
  'medians': {
7
6
  'A': Line;
8
7
  'B': Line;
9
8
  'C': Line;
10
- 'intersection': Point;
9
+ 'intersection': Vector | null;
11
10
  };
12
11
  'mediators': {
13
12
  'AB': Line;
14
13
  'AC': Line;
15
14
  'BC': Line;
16
- 'intersection': Point;
15
+ 'intersection': Vector | null;
17
16
  };
18
17
  'heights': {
19
18
  'A': Line;
20
19
  'B': Line;
21
20
  'C': Line;
22
- 'intersection': Point;
21
+ 'intersection': Vector | null;
23
22
  };
24
23
  'bisectors': {
25
24
  'A': Line;
26
25
  'B': Line;
27
26
  'C': Line;
28
- 'intersection': Point;
27
+ 'intersection': Vector | null;
29
28
  };
30
29
  externalBisectors: {
31
30
  'A': Line;
32
31
  'B': Line;
33
32
  'C': Line;
34
- 'intersection': Point;
33
+ 'intersection': Vector | null;
35
34
  };
36
35
  }
37
36
  export declare class Triangle {
38
- private _A;
39
- private _B;
40
- private _C;
41
- private _lines;
42
- private _middles;
43
- private _remarquables;
37
+ #private;
44
38
  constructor(...values: unknown[]);
45
- get A(): Point;
46
- get B(): Point;
47
- get C(): Point;
39
+ get A(): Vector;
40
+ get B(): Vector;
41
+ get C(): Vector;
48
42
  get AB(): Vector;
49
43
  get BA(): Vector;
50
44
  get BC(): Vector;
@@ -62,31 +56,14 @@ export declare class Triangle {
62
56
  get remarquables(): remarquableLines;
63
57
  /**
64
58
  * Parse values to a triangle. Supported formats:
65
- * Point, Point, Point
59
+ * Vector2D, Vector2D, Vector2D
66
60
  * x1, y1, x2, y2, x3, y3
67
61
  * TODO: Something else ?
68
62
  * @param values
69
63
  */
70
- parse: (...values: any) => Triangle;
64
+ parse: (...values: unknown[]) => Triangle;
71
65
  /**
72
66
  * Clone the Triangle class
73
67
  */
74
68
  clone: () => Triangle;
75
- /**
76
- * Generate the Line object for the three segments of the triangle
77
- */
78
- private _updateTriangle;
79
- /**
80
- * Get the Point class for the given name
81
- * @param ptName
82
- */
83
- private getPointByName;
84
- /**
85
- * Get the vector for the segment given by name.
86
- * @param ptName1
87
- * @param ptName2
88
- */
89
- private getSegment;
90
- private _calculateRemarquableLines;
91
- private _calculateBisectors;
92
69
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triangle.d.ts","sourceRoot":"","sources":["../../src/geometry/triangle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE;QACP,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAChC,CAAC;IACF,WAAW,EAAE;QACT,IAAI,EAAE,IAAI,CAAC;QACX,IAAI,EAAE,IAAI,CAAC;QACX,IAAI,EAAE,IAAI,CAAC;QACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAChC,CAAC;IACF,SAAS,EAAE;QACP,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAChC,CAAC;IACF,WAAW,EAAE;QACT,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAChC,CAAC;IACF,iBAAiB,EAAE;QACf,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;QACV,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAChC,CAAA;CACJ;AAED,qBAAa,QAAQ;;gBAQL,GAAG,MAAM,EAAE,OAAO,EAAE;IAahC,IAAI,CAAC,IAAI,MAAM,CAEd;IAED,IAAI,CAAC,IAAI,MAAM,CAEd;IAED,IAAI,CAAC,IAAI,MAAM,CAEd;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,WAAW,IAAI,OAAO,CAYzB;IAED,IAAI,aAAa,IAAI,OAAO,CAG3B;IAED,IAAI,SAAS,IAAI,OAAO,CAIvB;IAED,IAAI,KAAK,IAAI;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAElD;IAED,IAAI,YAAY,IAAI,gBAAgB,CAEnC;IAaD,KAAK,cAAe,OAAO,EAAE,KAAG,QAAQ,CAmEvC;IAKD,KAAK,QAAO,QAAQ,CAMnB;CAuJJ"}
@@ -0,0 +1,55 @@
1
+ import { InputValue, IPiMathObject } from '../pimath.interface';
2
+ import { Fraction } from '../coefficients/fraction';
3
+
4
+ export declare class Vector implements IPiMathObject<Vector> {
5
+ #private;
6
+ constructor(...values: Vector[] | InputValue<Fraction>[]);
7
+ get array(): Fraction[];
8
+ set array(value: 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 normSquare(): Fraction;
18
+ get norm(): number;
19
+ get tex(): string;
20
+ get display(): string;
21
+ setDimension(value?: number): this;
22
+ get dimension(): number;
23
+ get isNull(): boolean;
24
+ static asTex(...values: string[]): string;
25
+ static asDisplay(...values: string[]): string;
26
+ defineAsPoint(value?: boolean): this;
27
+ parse(...values: Vector[] | InputValue<Fraction>[]): this;
28
+ clone(): Vector;
29
+ copy(): Fraction[];
30
+ zero: () => this;
31
+ one: () => this;
32
+ opposite: () => this;
33
+ add: (V: Vector) => this;
34
+ subtract: (V: Vector) => this;
35
+ unit: () => this;
36
+ middleOf(V1: Vector, V2: Vector): this;
37
+ translate(...values: Fraction[]): this;
38
+ dot: (V: Vector) => Fraction;
39
+ cross(value: Vector): Vector;
40
+ normal: () => this;
41
+ isZero(): boolean;
42
+ isOne(): boolean;
43
+ isEqual: (v: Vector) => boolean;
44
+ isColinearTo: (v: Vector) => boolean;
45
+ isNormalTo: (v: Vector) => boolean;
46
+ multiplyByScalar: (k: InputValue<Fraction>) => this;
47
+ divideByScalar: (k: InputValue<Fraction>) => this;
48
+ simplify: () => this;
49
+ angle: (V: Vector, sharp?: boolean, radian?: boolean) => number;
50
+ distanceTo(item: Vector): {
51
+ value: number;
52
+ fraction: Fraction;
53
+ tex: string;
54
+ };
55
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/geometry/vector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,0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I,MAAM;IAOf,IAAI,IAAI,QAAQ,EAAE;IAIzB,IAAI,QAAO,IAAI,CAGd;IAED,GAAG,QAAO,IAAI,CAIb;IAED,QAAQ,QAAO,IAAI,CAGlB;IAED,GAAG,MAAO,MAAM,KAAG,IAAI,CAGtB;IAED,QAAQ,MAAO,MAAM,KAAG,IAAI,CAE3B;IAED,IAAI,QAAO,IAAI,CAOd;IAED,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAWtC,SAAS,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI;IAMtC,GAAG,MAAO,MAAM,KAAG,QAAQ,CAE1B;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAY5B,MAAM,QAAO,IAAI,CAQhB;IAED,MAAM,IAAI,OAAO;IAGjB,KAAK,IAAI,OAAO;IAIhB,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,CAIjD;IAED,cAAc,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAE/C;IAED,QAAQ,QAAO,IAAI,CAYlB;IAED,KAAK,MAAO,MAAM,UAAU,OAAO,WAAW,OAAO,KAAG,MAAM,CAU7D;IA0BD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;CAS/E"}
@@ -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,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;IAiBrF,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED,IAAI,KAAK,IAAI,QAAQ,EAAE,CAEtB;IAGD,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,QAAQ,CAAC,SAAS,KAAI;IAEf,KAAK,IAAI,QAAQ;IAIxB,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9C,OAAO,MAAO,QAAQ,KAAG,OAAO,CAEtC;IAEM,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAO1B,QAAQ,IAAI,IAAI;IAOhB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAO/B,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ;IAI9B,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ;IAQhC,MAAM;CA2BhB;AAED,qBAAa,OAAQ,SAAQ,QAAQ;gBACrB,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,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"}
@@ -0,0 +1,3 @@
1
+ export declare function wrapParenthesis(str: string, tex?: boolean): string;
2
+ export declare function wrapVert(str: string, tex?: boolean): string;
3
+ export declare function wrapNorm(str: string, tex?: boolean): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AACD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AACD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD"}
@@ -0,0 +1,59 @@
1
+ import { Equation } from './algebra/equation';
2
+ import { Factor } from './algebra/factor';
3
+ import { Monom } from './algebra/monom';
4
+ import { PolyFactor } from './algebra/polyFactor';
5
+ import { Polynom } from './algebra/polynom';
6
+ import { Fraction } from './coefficients/fraction';
7
+ import { NthRoot } from './coefficients/nthRoot';
8
+ import { Circle } from './geometry/circle';
9
+ import { Line } from './geometry/line';
10
+ import { Point } from './geometry/point';
11
+ import { Triangle } from './geometry/triangle';
12
+ import { Vector } from './geometry/vector';
13
+
14
+ declare const PiMath: {
15
+ Numeric: {
16
+ decompose: (value: number) => number[][];
17
+ dividers: (value: number) => number[];
18
+ divideNumbersByGCD: (...values: number[]) => number[];
19
+ gcd: (...values: number[]) => number;
20
+ lcm: (...values: number[]) => number;
21
+ numberCorrection: (value: number, number_of_digits?: number) => number;
22
+ periodic: (value: number) => number;
23
+ primes: (nb?: number | undefined) => number[];
24
+ pythagoreanTripletsWithTarget: (target: number, targetIsSquare?: boolean | undefined) => number[][];
25
+ round: (value: number, decimals?: number) => number;
26
+ };
27
+ Fraction: typeof Fraction;
28
+ Root: typeof NthRoot;
29
+ Monom: typeof Monom;
30
+ Polynom: typeof Polynom;
31
+ Equation: typeof Equation;
32
+ Factor: typeof Factor;
33
+ PolyFactor: typeof PolyFactor;
34
+ Random: {
35
+ equation: (config?: import('./randomization/rndTypes').randomEquationConfig | undefined) => Equation;
36
+ polynom: (config?: import('./randomization/rndTypes').randomPolynomConfig | undefined) => Polynom;
37
+ monom: (config?: import('./randomization/rndTypes').randomMonomConfig | undefined) => Monom;
38
+ fraction: (config?: import('./randomization/rndTypes').randomCoefficientConfig | undefined) => Fraction;
39
+ number: (from: number, to: number, exclude?: number[] | undefined) => number;
40
+ numberSym: (max: number, allowZero?: boolean | undefined) => number;
41
+ prime: (max: number) => number;
42
+ bool: (percent?: number | undefined) => boolean;
43
+ array: <T>(arr: T[], number?: number | undefined) => T[];
44
+ item: <T_1>(arr: T_1[]) => T_1;
45
+ shuffle: <T_2>(arr: T_2[]) => T_2[];
46
+ line: (config?: import('./randomization/rndTypes').randomGeometryLineConfig | undefined) => Line;
47
+ line3: (config?: import('./randomization/rndTypes').randomGeometryLine3Config | undefined) => import('./geometry/line3').Line3;
48
+ point: (config?: import('./randomization/rndTypes').randomGeometryPointConfig | undefined) => Point;
49
+ circle: (config?: import('./randomization/rndTypes').randomGeometryCircleConfig | undefined) => Circle;
50
+ };
51
+ Geometry: {
52
+ Vector: typeof Vector;
53
+ Point: typeof Point;
54
+ Line: typeof Line;
55
+ Triangle: typeof Triangle;
56
+ Circle: typeof Circle;
57
+ };
58
+ };
59
+ 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;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGzC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,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;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAa1C,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
+ isEqual(value: InputValue<T>): boolean;
21
+ zero(): T;
22
+ one(): T;
23
+ isZero(): boolean;
24
+ isOne(): boolean;
25
+ add(value: InputValue<T>): T;
26
+ subtract(value: InputValue<T>): T;
27
+ opposite(): T;
28
+ multiply(value: InputValue<T>): T;
29
+ divide(value: InputValue<T>): T | null;
30
+ reduce(): T;
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,KA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AC;CACnF;AAED,MAAM,WAAW,SAAS;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAA;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ import { randomEquationConfig } from '../rndTypes';
2
+ import { Equation } from '../../algebra/equation';
3
+
4
+ export declare function rndEquation(userConfig?: randomEquationConfig): Equation;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rndEquation.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndEquation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGjD,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,oBAAoB,GAAG,QAAQ,CAmCvE"}
@@ -0,0 +1,4 @@
1
+ import { randomMonomConfig } from '../rndTypes';
2
+ import { Monom } from '../../algebra/monom';
3
+
4
+ export declare function rndMonom(userConfig?: randomMonomConfig): Monom;
@@ -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,4 @@
1
+ import { randomCoefficientConfig } from '../rndTypes';
2
+ import { Fraction } from '../../coefficients/fraction';
3
+
4
+ export declare function rndFraction(userConfig?: randomCoefficientConfig): Fraction;
@@ -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,4 @@
1
+ import { Circle } from '../../geometry/circle';
2
+ import { randomGeometryCircleConfig } from '../rndTypes';
3
+
4
+ export declare function rndCircle(userConfig?: randomGeometryCircleConfig): Circle;
@@ -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;AAE9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAG7D,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,0BAA0B,GAAG,MAAM,CAqBzE"}
@@ -0,0 +1,4 @@
1
+ import { Line } from '../../geometry/line';
2
+ import { randomGeometryLineConfig } from '../rndTypes';
3
+
4
+ export declare function rndLine(userConfig?: randomGeometryLineConfig): Line;
@@ -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,4 @@
1
+ import { Line3 } from '../../geometry/line3';
2
+ import { randomGeometryLine3Config } from '../rndTypes';
3
+
4
+ export declare function rndLine3(userConfig?: randomGeometryLine3Config): Line3;
@@ -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;AAI5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5D,wBAAgB,QAAQ,CAAC,UAAU,CAAC,EAAE,yBAAyB,GAAG,KAAK,CAoBtE"}
@@ -0,0 +1,4 @@
1
+ import { randomGeometryPointConfig } from '../rndTypes';
2
+ import { Point } from '../../geometry/point';
3
+
4
+ export declare function rndPoint(userConfig?: randomGeometryPointConfig): Point;
@@ -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,sBAAsB,CAAA;AAE5C,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/point').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,OA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,EAAE,yBAAyB,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B"}
package/dist/main.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
- };