pimath 0.1.10 → 0.1.12
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 +4220 -0
- package/package.json +1 -1
- package/types/algebra/equation.d.ts +101 -0
- package/types/algebra/equation.d.ts.map +1 -0
- package/types/algebra/equationSolver.d.ts +9 -0
- package/types/algebra/equationSolver.d.ts.map +1 -0
- package/types/algebra/factor.d.ts +46 -0
- package/types/algebra/factor.d.ts.map +1 -0
- package/types/algebra/linearSystem.d.ts +32 -0
- package/types/algebra/linearSystem.d.ts.map +1 -0
- package/types/algebra/logicalset.d.ts +21 -0
- package/types/algebra/logicalset.d.ts.map +1 -0
- package/types/algebra/monom.d.ts +168 -0
- package/types/algebra/monom.d.ts.map +1 -0
- package/types/algebra/polyFactor.d.ts +50 -0
- package/types/algebra/polyFactor.d.ts.map +1 -0
- package/types/algebra/polynom.d.ts +109 -0
- package/types/algebra/polynom.d.ts.map +1 -0
- package/types/coefficients/fraction.d.ts +91 -0
- package/types/coefficients/fraction.d.ts.map +1 -0
- package/types/coefficients/nthRoot.d.ts +20 -0
- package/types/coefficients/nthRoot.d.ts.map +1 -0
- package/types/geometry/circle.d.ts +38 -0
- package/types/geometry/circle.d.ts.map +1 -0
- package/types/geometry/geomMath.d.ts +8 -0
- package/types/geometry/geomMath.d.ts.map +1 -0
- package/types/geometry/line.d.ts +90 -0
- package/types/geometry/line.d.ts.map +1 -0
- package/types/geometry/line3.d.ts +57 -0
- package/types/geometry/line3.d.ts.map +1 -0
- package/types/geometry/matrix.d.ts +11 -0
- package/types/geometry/matrix.d.ts.map +1 -0
- package/types/geometry/plane3.d.ts +35 -0
- package/types/geometry/plane3.d.ts.map +1 -0
- package/types/geometry/point.d.ts +11 -0
- package/types/geometry/point.d.ts.map +1 -0
- package/types/geometry/triangle.d.ts +69 -0
- package/types/geometry/triangle.d.ts.map +1 -0
- package/types/geometry/vector.d.ts +55 -0
- package/types/geometry/vector.d.ts.map +1 -0
- package/types/helpers.d.ts +4 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts +27 -28
- package/types/numeric.d.ts +39 -0
- package/types/numeric.d.ts.map +1 -0
- package/types/pimath.interface.d.ts +61 -0
- package/types/pimath.interface.d.ts.map +1 -0
- package/types/randomization/algebra/rndEquation.d.ts +3 -0
- package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
- package/types/randomization/algebra/rndMonom.d.ts +3 -0
- package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
- package/types/randomization/algebra/rndPolynom.d.ts +4 -0
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
- package/types/randomization/coefficient/rndFraction.d.ts +3 -0
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
- package/types/randomization/geometry/rndCircle.d.ts +3 -0
- package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine.d.ts +3 -0
- package/types/randomization/geometry/rndLine.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine3.d.ts +3 -0
- package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
- package/types/randomization/geometry/rndVector.d.ts +3 -0
- package/types/randomization/geometry/rndVector.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/rndHelpers.d.ts.map +1 -0
- package/types/randomization/rndTypes.d.ts +63 -0
- package/types/randomization/rndTypes.d.ts.map +1 -0
- package/dist/index.js +0 -47
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { compareSign, IExpression, InputValue, IPiMathObject } from '../pimath.interface';
|
|
2
|
+
/**
|
|
3
|
+
* The fraction class make possible to handle
|
|
4
|
+
* \\(\frac{a}{b}\\) or \\[\frac{a}{b}\\] values.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction> {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
constructor(value: InputValue<Fraction>);
|
|
10
|
+
constructor(numerator: number, denominator: number);
|
|
11
|
+
constructor(decimal: number, periodLength: number);
|
|
12
|
+
/**
|
|
13
|
+
* Parse the value to get the numerator and denominator
|
|
14
|
+
* @param value : number or string to parse to get the fraction
|
|
15
|
+
* @param denominatorOrPeriodic (optional|number) : length of the periodic part: 2.333333 => 1 or denominator value
|
|
16
|
+
*/
|
|
17
|
+
parse: (value: InputValue<Fraction>, denominatorOrPeriodic?: number) => Fraction;
|
|
18
|
+
clone: () => Fraction;
|
|
19
|
+
static average: (...fractions: (InputValue<Fraction>)[]) => Fraction;
|
|
20
|
+
static max: (...fractions: InputValue<Fraction>[]) => Fraction;
|
|
21
|
+
static min: (...fractions: (InputValue<Fraction>)[]) => Fraction;
|
|
22
|
+
static sort: (fractions: (InputValue<Fraction>)[], reverse?: boolean) => Fraction[];
|
|
23
|
+
static unique: (fractions: (InputValue<Fraction>)[]) => Fraction[];
|
|
24
|
+
static xMultiply: (...values: (InputValue<Fraction>)[]) => Fraction;
|
|
25
|
+
abs: () => this;
|
|
26
|
+
add: (F: InputValue<Fraction>) => Fraction;
|
|
27
|
+
amplify: (k: number) => this;
|
|
28
|
+
/**
|
|
29
|
+
* Simple function to determine if it's a fraction
|
|
30
|
+
*/
|
|
31
|
+
areEquals: (...F: Fraction[]) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Compare the current coefficient with another coefficient
|
|
34
|
+
* @param F (Coefficient) The coefficient to _compare
|
|
35
|
+
* @param sign (string| default is =): authorized values: =, <, <=, >, >= with some variations.
|
|
36
|
+
*/
|
|
37
|
+
compare: (F: InputValue<Fraction>, sign?: compareSign) => boolean;
|
|
38
|
+
get denominator(): number;
|
|
39
|
+
set denominator(value: number);
|
|
40
|
+
get dfrac(): this;
|
|
41
|
+
get display(): string;
|
|
42
|
+
divide: (F: Fraction | number) => Fraction;
|
|
43
|
+
get frac(): this;
|
|
44
|
+
infinite: () => this;
|
|
45
|
+
invalid: () => this;
|
|
46
|
+
inverse: () => this;
|
|
47
|
+
isApproximative: () => boolean;
|
|
48
|
+
isEqual: (than: Fraction | number) => boolean;
|
|
49
|
+
isEven: () => boolean;
|
|
50
|
+
isExact: () => boolean;
|
|
51
|
+
isFinite: () => boolean;
|
|
52
|
+
isGeq: (than: Fraction | number) => boolean;
|
|
53
|
+
isGreater: (than: Fraction | number) => boolean;
|
|
54
|
+
isInfinity: () => boolean;
|
|
55
|
+
isInverted: (p: Fraction) => boolean;
|
|
56
|
+
isLeq: (than: Fraction | number) => boolean;
|
|
57
|
+
isLesser: (than: Fraction | number) => boolean;
|
|
58
|
+
isNaN: () => boolean;
|
|
59
|
+
isNatural: () => boolean;
|
|
60
|
+
isNegative: () => boolean;
|
|
61
|
+
isNegativeOne: () => boolean;
|
|
62
|
+
isNotEqual: (than: Fraction | number) => boolean;
|
|
63
|
+
isNotZero: () => boolean;
|
|
64
|
+
isOdd: () => boolean;
|
|
65
|
+
isOne: () => boolean;
|
|
66
|
+
isOpposite: (p: Fraction) => boolean;
|
|
67
|
+
isPositive: () => boolean;
|
|
68
|
+
isRational: () => boolean;
|
|
69
|
+
isReduced: () => boolean;
|
|
70
|
+
isRelative: () => boolean;
|
|
71
|
+
isSquare: () => boolean;
|
|
72
|
+
isStrictlyNegative: () => boolean;
|
|
73
|
+
isStrictlyPositive: () => boolean;
|
|
74
|
+
isZero: () => boolean;
|
|
75
|
+
multiply: (F: Fraction | number) => this;
|
|
76
|
+
get numerator(): number;
|
|
77
|
+
set numerator(value: number);
|
|
78
|
+
one: () => this;
|
|
79
|
+
opposite: () => this;
|
|
80
|
+
pow: (p: number | Fraction) => Fraction;
|
|
81
|
+
reduce: () => this;
|
|
82
|
+
root: (p: number) => this;
|
|
83
|
+
sign: () => number;
|
|
84
|
+
sqrt: () => this;
|
|
85
|
+
subtract: (F: Fraction | number) => Fraction;
|
|
86
|
+
get tex(): string;
|
|
87
|
+
get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+
set radical(value: number);
|
|
9
|
+
get nth(): number;
|
|
10
|
+
set nth(value: number);
|
|
11
|
+
get coefficient(): number;
|
|
12
|
+
set coefficient(value: number);
|
|
13
|
+
get tex(): string;
|
|
14
|
+
get display(): string;
|
|
15
|
+
get value(): number;
|
|
16
|
+
parse: (radical: number, nthroot?: number, coefficient?: number) => this;
|
|
17
|
+
reduce: () => this;
|
|
18
|
+
multiply: (N: NthRoot) => this;
|
|
19
|
+
hasRadical: () => boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nthRoot.d.ts","sourceRoot":"","sources":["../../src/coefficients/nthRoot.ts"],"names":[],"mappings":"AAIA,qBAAa,OAAO;;gBAMJ,GAAG,MAAM,EAAE,MAAM,EAAE;IAc/B,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAExB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAQpB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAI,GAAG,IAAI,MAAM,CAoBhB;IAED,IAAI,OAAO,IAAI,MAAM,CAoBpB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAKD,KAAK,YAAa,MAAM,YAAY,MAAM,gBAAgB,MAAM,KAAG,IAAI,CAStE;IAKD,MAAM,QAAO,IAAI,CAgBhB;IAED,QAAQ,MAAO,OAAO,KAAG,IAAI,CAG5B;IAKD,UAAU,QAAO,OAAO,CAEvB;CACJ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Line } from './line';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Equation } from '../algebra/equation';
|
|
4
|
+
import { IPiMathObject } from '../pimath.interface';
|
|
5
|
+
import { Point } from './point';
|
|
6
|
+
export declare class Circle implements IPiMathObject<Circle> {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
constructor(equation: string | Equation);
|
|
10
|
+
constructor(circle: Circle);
|
|
11
|
+
constructor(center: Point, radius: Fraction | number, square?: boolean);
|
|
12
|
+
constructor(center: Point, pointThrough: Point);
|
|
13
|
+
constructor(A: Point, B: Point, C: Point);
|
|
14
|
+
get center(): Point;
|
|
15
|
+
get squareRadius(): Fraction;
|
|
16
|
+
get cartesian(): Equation;
|
|
17
|
+
get radius(): {
|
|
18
|
+
tex: string;
|
|
19
|
+
display: string;
|
|
20
|
+
value: number;
|
|
21
|
+
};
|
|
22
|
+
get tex(): string;
|
|
23
|
+
get developed(): string;
|
|
24
|
+
get display(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the relative position between circle and line. It corresponds to the number of intersection.
|
|
27
|
+
* @param {Line} L
|
|
28
|
+
* @returns {number}
|
|
29
|
+
*/
|
|
30
|
+
relativePosition: (L: Line) => number;
|
|
31
|
+
lineIntersection: (L: Line) => Point[];
|
|
32
|
+
tangents: (P: Point | Fraction) => Line[];
|
|
33
|
+
isPointOnCircle: (P: Point) => boolean;
|
|
34
|
+
getPointsOnCircle: (numberIsInteger?: boolean) => Point[];
|
|
35
|
+
clone(): Circle;
|
|
36
|
+
setRadius(radius: Fraction | number, square?: boolean): this;
|
|
37
|
+
parse(...values: unknown[]): this;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../src/geometry/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,QAAQ,CAAA;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAG9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SA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V = Vector;
|
|
4
|
+
export declare function areVectorsEquals(v1: V, v2: V): boolean;
|
|
5
|
+
export declare function areVectorsColinears(v1: V, v2: V): boolean;
|
|
6
|
+
export declare function dotProduct(v1: V, v2: V): Fraction;
|
|
7
|
+
export declare function determinant(...values: V[]): Fraction;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geomMath.d.ts","sourceRoot":"","sources":["../../src/geometry/geomMath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,KAAK,CAAC,GAAG,MAAM,CAAA;AACf,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAMtD;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CASzD;AAGD,wBAAgB,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,CAUjD;AAED,wBAAgB,WAAW,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,QAAQ,CAqCpD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Equation } from '../algebra/equation';
|
|
3
|
+
import { Vector } from './vector';
|
|
4
|
+
import { InputValue, IPiMathObject } from '../pimath.interface';
|
|
5
|
+
import { Point } from './point';
|
|
6
|
+
export declare enum LinePropriety {
|
|
7
|
+
None = "none",
|
|
8
|
+
Parallel = "parallel",
|
|
9
|
+
Perpendicular = "perpendicular",
|
|
10
|
+
Tangent = "tangent"
|
|
11
|
+
}
|
|
12
|
+
export interface LineConfig {
|
|
13
|
+
points?: Point[];
|
|
14
|
+
point?: Point;
|
|
15
|
+
direction?: Vector;
|
|
16
|
+
normal?: Vector;
|
|
17
|
+
}
|
|
18
|
+
export declare class Line implements IPiMathObject<Line> {
|
|
19
|
+
#private;
|
|
20
|
+
static PERPENDICULAR: LinePropriety;
|
|
21
|
+
static PARALLEL: LinePropriety;
|
|
22
|
+
/**
|
|
23
|
+
* Value can be a mix of:
|
|
24
|
+
*
|
|
25
|
+
* @param values
|
|
26
|
+
*/
|
|
27
|
+
constructor(...values: unknown[]);
|
|
28
|
+
get a(): Fraction;
|
|
29
|
+
set a(value: Fraction);
|
|
30
|
+
get b(): Fraction;
|
|
31
|
+
set b(value: Fraction);
|
|
32
|
+
get c(): Fraction;
|
|
33
|
+
set c(value: Fraction);
|
|
34
|
+
get OA(): Vector;
|
|
35
|
+
set OA(value: Vector);
|
|
36
|
+
get d(): Vector;
|
|
37
|
+
set d(value: Vector);
|
|
38
|
+
get n(): Vector;
|
|
39
|
+
getEquation(): Equation;
|
|
40
|
+
get canonical(): this;
|
|
41
|
+
get equation(): this;
|
|
42
|
+
get mxh(): this;
|
|
43
|
+
get parametric(): this;
|
|
44
|
+
get system(): this;
|
|
45
|
+
get tex(): string;
|
|
46
|
+
get reduceBeforeDisplay(): boolean;
|
|
47
|
+
set reduceBeforeDisplay(value: boolean);
|
|
48
|
+
get display(): string;
|
|
49
|
+
get normal(): Vector;
|
|
50
|
+
get director(): Vector;
|
|
51
|
+
get slope(): Fraction;
|
|
52
|
+
get height(): Fraction;
|
|
53
|
+
randomPoint: (k?: number) => Point;
|
|
54
|
+
randomNearPoint: (k?: number) => Point;
|
|
55
|
+
/**
|
|
56
|
+
* Parse data to a line
|
|
57
|
+
* @param {any} values
|
|
58
|
+
* @returns {Line}
|
|
59
|
+
*/
|
|
60
|
+
parse: (...values: unknown[]) => this;
|
|
61
|
+
fromPoints(pt1: Point, pt2: Point): this;
|
|
62
|
+
fromEquation: (equ: Equation) => this;
|
|
63
|
+
fromCoefficient: (a: InputValue<Fraction>, b: InputValue<Fraction>, c: InputValue<Fraction>) => this;
|
|
64
|
+
fromPointAndDirection: (P: Point, d: Vector) => this;
|
|
65
|
+
fromPointAndNormal: (P: Point, n: Vector) => this;
|
|
66
|
+
fromPointAndLine: (P: Vector, L: Line, orientation?: LinePropriety) => this;
|
|
67
|
+
clone: () => this;
|
|
68
|
+
isOnLine: (pt: Vector) => boolean;
|
|
69
|
+
isParallelTo: (line: Line) => boolean;
|
|
70
|
+
isSameAs: (line: Line) => boolean;
|
|
71
|
+
isPerpendicularTo: (line: Line) => boolean;
|
|
72
|
+
isVertical: () => boolean;
|
|
73
|
+
simplify: () => this;
|
|
74
|
+
simplifyDirection: () => this;
|
|
75
|
+
intersection: (line: Line) => {
|
|
76
|
+
point: Point;
|
|
77
|
+
hasIntersection: boolean;
|
|
78
|
+
isParallel: boolean;
|
|
79
|
+
isSame: boolean;
|
|
80
|
+
};
|
|
81
|
+
distanceTo(pt: Point): {
|
|
82
|
+
value: number;
|
|
83
|
+
fraction: Fraction;
|
|
84
|
+
tex: string;
|
|
85
|
+
};
|
|
86
|
+
hitSegment(A: Point, B: Point): boolean;
|
|
87
|
+
getValueAtX: (value: Fraction | number) => Fraction;
|
|
88
|
+
getValueAtY: (value: Fraction | number) => Fraction;
|
|
89
|
+
canonicalAsFloatCoefficient(decimals?: number): string;
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../src/geometry/line.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEpE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,oBAAY,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,aAAa,kBAA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,GAAG,EAAE,MAAM,CAAA;KAAE;IAkCzE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO;IAevC,WAAW,UAAW,QAAQ,GAAG,MAAM,KAAG,QAAQ,CAQjD;IAED,WAAW,UAAW,QAAQ,GAAG,MAAM,KAAG,QAAQ,CASjD;IAKD,2BAA2B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;CAkCzD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
import { Point } from './point';
|
|
4
|
+
export declare enum LinePropriety {
|
|
5
|
+
None = "none",
|
|
6
|
+
Parallel = "parallel",
|
|
7
|
+
Perpendicular = "perpendicular",
|
|
8
|
+
Tangent = "tangent"
|
|
9
|
+
}
|
|
10
|
+
export declare class Line3 {
|
|
11
|
+
#private;
|
|
12
|
+
static PERPENDICULAR: LinePropriety;
|
|
13
|
+
static PARALLEL: LinePropriety;
|
|
14
|
+
/**
|
|
15
|
+
* Value can be a mix of:
|
|
16
|
+
*
|
|
17
|
+
* @param values
|
|
18
|
+
*/
|
|
19
|
+
constructor(A: Point, B: Point);
|
|
20
|
+
constructor(A: Point, d: Vector);
|
|
21
|
+
get OA(): Point;
|
|
22
|
+
set OA(value: Point);
|
|
23
|
+
get point(): Point;
|
|
24
|
+
get d(): Vector;
|
|
25
|
+
set d(value: Vector);
|
|
26
|
+
get tex(): {
|
|
27
|
+
parametric: string;
|
|
28
|
+
system: string;
|
|
29
|
+
cartesian: string;
|
|
30
|
+
};
|
|
31
|
+
get display(): {
|
|
32
|
+
parametric: string;
|
|
33
|
+
system: string;
|
|
34
|
+
cartesian: string;
|
|
35
|
+
};
|
|
36
|
+
get direction(): Vector;
|
|
37
|
+
clone: () => this;
|
|
38
|
+
isOnLine: (pt: Point) => boolean;
|
|
39
|
+
isParallelTo: (line: Line3) => boolean;
|
|
40
|
+
isSameAs: (line: Line3) => boolean;
|
|
41
|
+
isPerpendicularTo: (line: Line3) => boolean;
|
|
42
|
+
isVertical: () => boolean;
|
|
43
|
+
simplify: () => this;
|
|
44
|
+
intersection: (line: Line3) => {
|
|
45
|
+
point: Vector;
|
|
46
|
+
hasIntersection: boolean;
|
|
47
|
+
isParallel: boolean;
|
|
48
|
+
isSame: boolean;
|
|
49
|
+
};
|
|
50
|
+
distanceTo(pt: Point): {
|
|
51
|
+
value: number;
|
|
52
|
+
fraction: Fraction;
|
|
53
|
+
tex: string;
|
|
54
|
+
};
|
|
55
|
+
hitSegment(A: Point, B: Point): boolean;
|
|
56
|
+
randomPoint: (max?: number) => Point;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line3.d.ts","sourceRoot":"","sources":["../../src/geometry/line3.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAInD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,oBAAY,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,qBAAa,KAAK;;IAEd,MAAM,CAAC,aAAa,gBAA8B;IAClD,MAAM,CAAC,QAAQ,gBAAyB;gBAU5B,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;gBAClB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM;IAO/B,IAAI,EAAE,IAAI,KAAK,CAEd;IAED,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAElB;IACD,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,IAAI,CAAC,IAAI,MAAM,CAEd;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAElB;IAED,IAAI,GAAG,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAmBnE;IAED,IAAI,OAAO,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAcvE;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,KAAK,QAAO,IAAI,CAKf;IAID,QAAQ,OAAQ,KAAK,KAAG,OAAO,CAE9B;IAED,YAAY,SAAU,KAAK,KAAG,OAAO,CAGpC;IACD,QAAQ,SAAU,KAAK,KAAG,OAAO,CAEhC;IACD,iBAAiB,SAAU,KAAK,KAAG,OAAO,CAEzC;IACD,UAAU,QAAO,OAAO,CAEvB;IACD,QAAQ,QAAO,IAAI,CAYlB;IAED,YAAY,SAAU,KAAK,KAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAgC9G;IAED,UAAU,CAAC,EAAE,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAkBzE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO;IAsCvC,WAAW,oBAAc,KAAK,CAS7B;CACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
export declare class Matrix {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(...values: Vector[]);
|
|
6
|
+
get values(): Vector[];
|
|
7
|
+
get array(): Fraction[][];
|
|
8
|
+
get dimension(): number[];
|
|
9
|
+
isSquare(): boolean;
|
|
10
|
+
determinant(): Fraction;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/geometry/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGtC,qBAAa,MAAM;;gBAEH,GAAG,MAAM,EAAE,MAAM,EAAE;IAM/B,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;IAED,IAAI,KAAK,IAAI,QAAQ,EAAE,EAAE,CAExB;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAExB;IAED,QAAQ,IAAI,OAAO;IAInB,WAAW,IAAI,QAAQ;CAO1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Equation } from '../algebra/equation';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Line3 } from './line3';
|
|
4
|
+
import { Point } from './point';
|
|
5
|
+
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
|
+
}
|
|
14
|
+
export declare class Plane3 {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(config?: Plane3Config);
|
|
17
|
+
get normal(): Vector;
|
|
18
|
+
set normal(value: Vector);
|
|
19
|
+
get point(): Point;
|
|
20
|
+
set point(value: Point);
|
|
21
|
+
get a(): Fraction;
|
|
22
|
+
get b(): Fraction;
|
|
23
|
+
get c(): Fraction;
|
|
24
|
+
get d(): Fraction;
|
|
25
|
+
get tex(): string;
|
|
26
|
+
parse(config: Plane3Config): void;
|
|
27
|
+
angle(vector: Vector, sharp?: boolean, radian?: boolean): number;
|
|
28
|
+
angle(line: Line3, sharp?: boolean, radian?: boolean): number;
|
|
29
|
+
angle(plane: Plane3, sharp?: boolean, radian?: boolean): number;
|
|
30
|
+
distanceTo(point: Vector): number;
|
|
31
|
+
intersectWithLine(line: Line3): Point;
|
|
32
|
+
intersectWithPlane(plane: Plane3): Line3;
|
|
33
|
+
isPointOnPlane(pt: Point): boolean;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plane3.d.ts","sourceRoot":"","sources":["../../src/geometry/plane3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,UAAU,YAAY;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B;AACD,qBAAa,MAAM;;gBAIH,MAAM,CAAC,EAAE,YAAY;IAQjC,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAGvB;IACD,IAAI,KAAK,IAAI,KAAK,CAEjB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAGrB;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,IAAI,QAAQ,CAEhB;IACD,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,GAAG,IAAI,MAAM,CAMhB;IAED,KAAK,CAAC,MAAM,EAAE,YAAY;IAyD1B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAChE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAqB/D,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIjC,iBAAiB,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK;IAMrC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK;IAUxC,cAAc,CAAC,EAAE,EAAE,KAAK,GAAG,OAAO;CAGrC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { InputValue } from '../pimath.interface';
|
|
3
|
+
import { Vector } from './vector';
|
|
4
|
+
export declare class Point extends Vector {
|
|
5
|
+
constructor();
|
|
6
|
+
constructor(value: Vector);
|
|
7
|
+
constructor(start: Vector, end: Vector);
|
|
8
|
+
constructor(...values: InputValue<Fraction>[]);
|
|
9
|
+
parse(...values: Vector[] | InputValue<Fraction>[]): this;
|
|
10
|
+
clone(): Point;
|
|
11
|
+
}
|
|
@@ -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;IAkCzD,KAAK,IAAI,KAAK;CAOjC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Line } from './line';
|
|
2
|
+
import { Vector } from './vector';
|
|
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
|
+
}
|
|
36
|
+
export declare class Triangle {
|
|
37
|
+
#private;
|
|
38
|
+
constructor(...values: unknown[]);
|
|
39
|
+
get A(): Point;
|
|
40
|
+
get B(): Point;
|
|
41
|
+
get C(): Point;
|
|
42
|
+
get AB(): Vector;
|
|
43
|
+
get BA(): Vector;
|
|
44
|
+
get BC(): Vector;
|
|
45
|
+
get CB(): Vector;
|
|
46
|
+
get AC(): Vector;
|
|
47
|
+
get CA(): Vector;
|
|
48
|
+
get isRectangle(): boolean;
|
|
49
|
+
get isEquilateral(): boolean;
|
|
50
|
+
get isIsocele(): boolean;
|
|
51
|
+
get lines(): {
|
|
52
|
+
'AB': Line;
|
|
53
|
+
'BC': Line;
|
|
54
|
+
'AC': Line;
|
|
55
|
+
};
|
|
56
|
+
get remarquables(): remarquableLines;
|
|
57
|
+
/**
|
|
58
|
+
* Parse values to a triangle. Supported formats:
|
|
59
|
+
* Vector2D, Vector2D, Vector2D
|
|
60
|
+
* x1, y1, x2, y2, x3, y3
|
|
61
|
+
* TODO: Something else ?
|
|
62
|
+
* @param values
|
|
63
|
+
*/
|
|
64
|
+
parse: (...values: unknown[]) => Triangle;
|
|
65
|
+
/**
|
|
66
|
+
* Clone the Triangle class
|
|
67
|
+
*/
|
|
68
|
+
clone: () => Triangle;
|
|
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;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,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,EAA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
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
export declare class Vector implements IPiMathObject<Vector> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(...values: Vector[] | InputValue<Fraction>[]);
|
|
6
|
+
get array(): Fraction[];
|
|
7
|
+
set array(value: Fraction[]);
|
|
8
|
+
get x(): Fraction;
|
|
9
|
+
set x(value: Fraction | number | string);
|
|
10
|
+
get y(): Fraction;
|
|
11
|
+
set y(value: Fraction | number | string);
|
|
12
|
+
get z(): Fraction;
|
|
13
|
+
set z(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
|
+
setDimension(value?: number): this;
|
|
21
|
+
get dimension(): number;
|
|
22
|
+
get isNull(): boolean;
|
|
23
|
+
static asTex(...values: string[]): string;
|
|
24
|
+
static asDisplay(...values: string[]): string;
|
|
25
|
+
defineAsPoint(value?: boolean): this;
|
|
26
|
+
parse(...values: Vector[] | InputValue<Fraction>[]): this;
|
|
27
|
+
clone(): Vector;
|
|
28
|
+
copy(): Fraction[];
|
|
29
|
+
zero: () => this;
|
|
30
|
+
one: () => this;
|
|
31
|
+
opposite: () => this;
|
|
32
|
+
add: (V: Vector) => this;
|
|
33
|
+
subtract: (V: Vector) => this;
|
|
34
|
+
unit: () => this;
|
|
35
|
+
middleOf(V1: Vector, V2: Vector): this;
|
|
36
|
+
translate(...values: Fraction[]): this;
|
|
37
|
+
dot: (V: Vector) => Fraction;
|
|
38
|
+
cross(value: Vector): Vector;
|
|
39
|
+
normal: () => this;
|
|
40
|
+
isZero(): boolean;
|
|
41
|
+
isOne(): boolean;
|
|
42
|
+
isEqual: (v: Vector) => boolean;
|
|
43
|
+
isColinearTo: (v: Vector) => boolean;
|
|
44
|
+
isNormalTo: (v: Vector) => boolean;
|
|
45
|
+
multiplyByScalar: (k: InputValue<Fraction>) => this;
|
|
46
|
+
divideByScalar: (k: InputValue<Fraction>) => this;
|
|
47
|
+
simplify: () => this;
|
|
48
|
+
angle: (V: Vector, sharp?: boolean, radian?: boolean) => number;
|
|
49
|
+
fromString: (value: string) => this;
|
|
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,0BAA0B,CAAA;AAInD,qBAAa,MAAO,YAChB,aAAa,CAAC,MAAM,CAAC;;gBAIT,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE;IASxD,IAAI,KAAK,IAAI,QAAQ,EAAE,CAEtB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,EAE1B;IAED,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,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAGhB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAGtC;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAGD,IAAI,UAAU,IAAI,QAAQ,CAGzB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IA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I,CAIjD;IAED,cAAc,MAAO,UAAU,CAAC,QAAQ,CAAC,KAAG,IAAI,CAE/C;IAED,QAAQ,QAAO,IAAI,CAYlB;IAED,KAAK,MAAO,MAAM,UAAU,OAAO,WAAW,OAAO,KAAG,MAAM,CAU7D;IAGD,UAAU,UAAW,MAAM,KAAG,IAAI,CAuBjC;IAED,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,4 @@
|
|
|
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;
|
|
4
|
+
export declare function replace_in_array<T>(haystack: string[], search: string, target: string, start?: number, end?: number): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAUvH"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Fraction } from
|
|
2
|
-
import { NthRoot } from
|
|
3
|
-
import { Monom } from
|
|
4
|
-
import { Polynom } from
|
|
5
|
-
import { Factor } from
|
|
6
|
-
import { PolyFactor } from
|
|
7
|
-
import { Equation } from
|
|
8
|
-
import { LinearSystem } from
|
|
9
|
-
import { Circle } from
|
|
10
|
-
import { Line } from
|
|
11
|
-
import { Point } from
|
|
12
|
-
import { Triangle } from
|
|
13
|
-
import { Vector } from
|
|
14
|
-
import { Line3 } from
|
|
15
|
-
import { Plane3 } from
|
|
16
|
-
import { Matrix } from
|
|
17
|
-
import { NumExp } from
|
|
18
|
-
import { LogicalSet } from
|
|
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';
|
|
17
|
+
import { NumExp } from 'piexpression';
|
|
18
|
+
import { LogicalSet } from './algebra/logicalset';
|
|
19
19
|
declare const PiMath: {
|
|
20
20
|
Numeric: {
|
|
21
21
|
decompose: (value: number) => number[][];
|
|
@@ -40,10 +40,10 @@ declare const PiMath: {
|
|
|
40
40
|
PolyFactor: typeof PolyFactor;
|
|
41
41
|
LogicalSet: typeof LogicalSet;
|
|
42
42
|
Random: {
|
|
43
|
-
equation: (config?: import(
|
|
44
|
-
polynom: (config?: import(
|
|
45
|
-
monom: (config?: import(
|
|
46
|
-
fraction: (config?: import(
|
|
43
|
+
equation: (config?: import('./randomization/rndTypes').randomEquationConfig) => Equation;
|
|
44
|
+
polynom: (config?: import('./randomization/rndTypes').randomPolynomConfig) => Polynom;
|
|
45
|
+
monom: (config?: import('./randomization/rndTypes').randomMonomConfig) => Monom;
|
|
46
|
+
fraction: (config?: import('./randomization/rndTypes').randomCoefficientConfig) => Fraction;
|
|
47
47
|
number: (from: number, to: number, exclude?: number[]) => number;
|
|
48
48
|
numberSym: (max: number, allowZero?: boolean) => number;
|
|
49
49
|
prime: (max: number) => number;
|
|
@@ -51,11 +51,11 @@ declare const PiMath: {
|
|
|
51
51
|
array: <T>(arr: T[], number?: number) => T[];
|
|
52
52
|
item: <T>(arr: T[]) => T;
|
|
53
53
|
shuffle: <T>(arr: T[]) => T[];
|
|
54
|
-
line: (config?: import(
|
|
55
|
-
line3: (config?: import(
|
|
56
|
-
vector: (config?: import(
|
|
57
|
-
point: (config?: import(
|
|
58
|
-
circle: (config?: import(
|
|
54
|
+
line: (config?: import('./randomization/rndTypes').randomGeometryLineConfig) => Line;
|
|
55
|
+
line3: (config?: import('./randomization/rndTypes').randomGeometryLine3Config) => Line3;
|
|
56
|
+
vector: (config?: import('./randomization/rndTypes').randomGeometryPointConfig) => Point;
|
|
57
|
+
point: (config?: import('./randomization/rndTypes').randomGeometryPointConfig) => Point;
|
|
58
|
+
circle: (config?: import('./randomization/rndTypes').randomGeometryCircleConfig) => Circle;
|
|
59
59
|
};
|
|
60
60
|
Geometry: {
|
|
61
61
|
Vector: typeof Vector;
|
|
@@ -69,4 +69,3 @@ declare const PiMath: {
|
|
|
69
69
|
NumExp: typeof NumExp;
|
|
70
70
|
};
|
|
71
71
|
export default PiMath;
|
|
72
|
-
//# sourceMappingURL=index.d.ts.map
|