pimath 0.1.19 → 0.1.21

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.
@@ -1,7 +1,6 @@
1
- import { IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
1
+ import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
2
2
  import { Fraction } from '../coefficients/fraction';
3
3
  import { Polynom } from './polynom';
4
- export type EQUATION_SIGN = "=" | "<=" | ">=" | "<" | ">";
5
4
  export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
6
5
  #private;
7
6
  constructor(equation: InputAlgebra<Polynom> | Equation);
@@ -0,0 +1,8 @@
1
+ export * from './equation';
2
+ export * from './equationSolver';
3
+ export * from './factor';
4
+ export * from './linearSystem';
5
+ export * from './logicalset';
6
+ export * from './monom';
7
+ export * from './polyFactor';
8
+ export * from './polynom';
@@ -21,7 +21,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
21
21
  evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
22
22
  get factors(): Factor[];
23
23
  set factors(value: Factor[]);
24
- fromPolynom(polynom: InputAlgebra<Polynom>, letter?: string): this;
24
+ fromPolynom(numerator: InputAlgebra<Polynom>, denominator?: InputAlgebra<Polynom>, letter?: string): this;
25
25
  getFactors(): Factor[];
26
26
  getZeroes(): ISolution[];
27
27
  hasVariable(letter: string): boolean;
@@ -0,0 +1,2 @@
1
+ export * from './fraction';
2
+ export * from './nthRoot';
@@ -1,6 +1,6 @@
1
1
  import { Line } from './line';
2
- import { Fraction } from '../coefficients/fraction';
3
- import { Equation } from '../algebra/equation';
2
+ import { Fraction } from '../coefficients';
3
+ import { Equation } from '../algebra';
4
4
  import { IPiMathObject } from '../pimath.interface';
5
5
  import { Point } from './point';
6
6
  export declare class Circle implements IPiMathObject<Circle> {
@@ -0,0 +1,9 @@
1
+ export * from './geomMath';
2
+ export * from './circle';
3
+ export * from './line';
4
+ export * from './line3';
5
+ export * from './matrix';
6
+ export * from './plane3';
7
+ export * from './point';
8
+ export * from './triangle';
9
+ export * from './vector';
@@ -1,14 +1,8 @@
1
1
  import { Fraction } from '../coefficients/fraction';
2
2
  import { Equation } from '../algebra/equation';
3
3
  import { Vector } from './vector';
4
- import { InputValue, IPiMathObject } from '../pimath.interface';
4
+ import { InputValue, IPiMathObject, LinePropriety } from '../pimath.interface';
5
5
  import { Point } from './point';
6
- export declare enum LinePropriety {
7
- None = "none",
8
- Parallel = "parallel",
9
- Perpendicular = "perpendicular",
10
- Tangent = "tangent"
11
- }
12
6
  export interface LineConfig {
13
7
  points?: Point[];
14
8
  point?: Point;
@@ -1,16 +1,11 @@
1
1
  import { Fraction } from '../coefficients/fraction';
2
2
  import { Vector } from './vector';
3
3
  import { Point } from './point';
4
- export declare enum LinePropriety {
5
- None = "none",
6
- Parallel = "parallel",
7
- Perpendicular = "perpendicular",
8
- Tangent = "tangent"
9
- }
4
+ import { Line3Propriety } from '../pimath.interface';
10
5
  export declare class Line3 {
11
6
  #private;
12
- static PERPENDICULAR: LinePropriety;
13
- static PARALLEL: LinePropriety;
7
+ static PERPENDICULAR: Line3Propriety;
8
+ static PARALLEL: Line3Propriety;
14
9
  /**
15
10
  * Value can be a mix of:
16
11
  *
@@ -1,16 +1,8 @@
1
- import { Equation } from '../algebra/equation';
2
1
  import { Fraction } from '../coefficients/fraction';
3
2
  import { Line3 } from './line3';
4
3
  import { Point } from './point';
5
4
  import { Vector } from './vector';
6
- interface Plane3Config {
7
- point?: Point;
8
- normal?: Vector;
9
- directions?: Vector[];
10
- equation?: Equation;
11
- points?: Point[];
12
- coefficients?: number[];
13
- }
5
+ import { Plane3Config } from '../pimath.interface';
14
6
  export declare class Plane3 {
15
7
  #private;
16
8
  constructor(config?: Plane3Config);
@@ -32,4 +24,3 @@ export declare class Plane3 {
32
24
  intersectWithPlane(plane: Plane3): Line3;
33
25
  isPointOnPlane(pt: Point): boolean;
34
26
  }
35
- export {};
@@ -1,38 +1,7 @@
1
1
  import { Line } from './line';
2
2
  import { Vector } from './vector';
3
3
  import { Point } from './point';
4
- export interface remarquableLines {
5
- 'medians': {
6
- 'A': Line;
7
- 'B': Line;
8
- 'C': Line;
9
- 'intersection': Vector | null;
10
- };
11
- 'mediators': {
12
- 'AB': Line;
13
- 'AC': Line;
14
- 'BC': Line;
15
- 'intersection': Vector | null;
16
- };
17
- 'heights': {
18
- 'A': Line;
19
- 'B': Line;
20
- 'C': Line;
21
- 'intersection': Vector | null;
22
- };
23
- 'bisectors': {
24
- 'A': Line;
25
- 'B': Line;
26
- 'C': Line;
27
- 'intersection': Vector | null;
28
- };
29
- externalBisectors: {
30
- 'A': Line;
31
- 'B': Line;
32
- 'C': Line;
33
- 'intersection': Vector | null;
34
- };
35
- }
4
+ import { remarquableLines } from '../pimath.interface';
36
5
  export declare class Triangle {
37
6
  #private;
38
7
  constructor(...values: unknown[]);
package/dist/index.d.ts CHANGED
@@ -1,21 +1,15 @@
1
- import { Fraction } from './coefficients/fraction';
2
- import { NthRoot } from './coefficients/nthRoot';
3
- import { Monom } from './algebra/monom';
4
- import { Polynom } from './algebra/polynom';
5
- import { Factor } from './algebra/factor';
6
- import { PolyFactor } from './algebra/polyFactor';
7
- import { Equation } from './algebra/equation';
8
- import { LinearSystem } from './algebra/linearSystem';
9
- import { Circle } from './geometry/circle';
10
- import { Line } from './geometry/line';
11
- import { Point } from './geometry/point';
12
- import { Triangle } from './geometry/triangle';
13
- import { Vector } from './geometry/vector';
14
- import { Line3 } from './geometry/line3';
15
- import { Plane3 } from './geometry/plane3';
16
- import { Matrix } from './geometry/matrix';
1
+ import { Fraction, NthRoot } from './coefficients';
2
+ import { Equation, Factor, LinearSystem, LogicalSet, Monom, PolyFactor, Polynom } from './algebra';
3
+ import { Circle, Line, Line3, Matrix, Plane3, Point, Triangle, Vector } from './geometry';
4
+ import { Numeric } from './numeric';
17
5
  import { NumExp } from 'piexpression';
18
- import { LogicalSet } from './algebra/logicalset';
6
+ import { Random } from './randomization/random';
7
+ export * from './coefficients';
8
+ export * from './algebra';
9
+ export * from './geometry';
10
+ export { Numeric };
11
+ export { NumExp };
12
+ export { Random };
19
13
  export type * from './pimath.interface';
20
14
  declare const PiMath: {
21
15
  Numeric: {
@@ -2,10 +2,13 @@ import { Fraction } from './coefficients/fraction';
2
2
  import { NthRoot } from './coefficients/nthRoot';
3
3
  import { Monom } from './algebra/monom';
4
4
  import { Factor } from './algebra/factor';
5
+ import { Line, Point, Vector } from './geometry';
6
+ import { Equation } from './algebra';
5
7
  export type InputValue<T> = T | string | number | Fraction | NthRoot;
6
8
  export type InputAlgebra<T> = InputValue<T> | Monom;
7
9
  export type literalType<T> = Record<string, T>;
8
10
  export type compareSign = '>' | ">=" | "=>" | "geq" | '<' | "<=" | "=<" | "leq" | '=' | "<>" | "neq" | "same";
11
+ export type EQUATION_SIGN = "=" | "<=" | ">=" | "<" | ">";
9
12
  export declare enum PARTICULAR_SOLUTION {
10
13
  real = "\\mathbb{R}",
11
14
  varnothing = "\\varnothing"
@@ -66,3 +69,55 @@ export interface FACTOR_TABLE_OF_SIGNS extends TABLE_OF_SIGNS {
66
69
  export interface POLYFACTOR_TABLE_OF_SIGNS extends TABLE_OF_SIGNS {
67
70
  factors: FACTOR_TABLE_OF_SIGNS[];
68
71
  }
72
+ export declare enum LinePropriety {
73
+ None = "none",
74
+ Parallel = "parallel",
75
+ Perpendicular = "perpendicular",
76
+ Tangent = "tangent"
77
+ }
78
+ export declare enum Line3Propriety {
79
+ None = "none",
80
+ Parallel = "parallel",
81
+ Perpendicular = "perpendicular",
82
+ Tangent = "tangent"
83
+ }
84
+ export interface Plane3Config {
85
+ point?: Point;
86
+ normal?: Vector;
87
+ directions?: Vector[];
88
+ equation?: Equation;
89
+ points?: Point[];
90
+ coefficients?: number[];
91
+ }
92
+ export interface remarquableLines {
93
+ 'medians': {
94
+ 'A': Line;
95
+ 'B': Line;
96
+ 'C': Line;
97
+ 'intersection': Vector | null;
98
+ };
99
+ 'mediators': {
100
+ 'AB': Line;
101
+ 'AC': Line;
102
+ 'BC': Line;
103
+ 'intersection': Vector | null;
104
+ };
105
+ 'heights': {
106
+ 'A': Line;
107
+ 'B': Line;
108
+ 'C': Line;
109
+ 'intersection': Vector | null;
110
+ };
111
+ 'bisectors': {
112
+ 'A': Line;
113
+ 'B': Line;
114
+ 'C': Line;
115
+ 'intersection': Vector | null;
116
+ };
117
+ externalBisectors: {
118
+ 'A': Line;
119
+ 'B': Line;
120
+ 'C': Line;
121
+ 'intersection': Vector | null;
122
+ };
123
+ }