pimath 0.0.132 → 0.0.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pimath.js +2444 -3566
- package/package.json +37 -20
- package/types/algebra/equation.d.ts +109 -0
- package/types/algebra/equation.d.ts.map +1 -0
- package/types/algebra/equationSolver.d.ts +16 -0
- package/types/algebra/equationSolver.d.ts.map +1 -0
- package/types/algebra/factor.d.ts +47 -0
- package/types/algebra/factor.d.ts.map +1 -0
- package/{dist/maths → types}/algebra/monom.d.ts +98 -131
- package/types/algebra/monom.d.ts.map +1 -0
- package/types/algebra/polyFactor.d.ts +41 -0
- package/types/algebra/polyFactor.d.ts.map +1 -0
- package/types/algebra/polynom.d.ts +126 -0
- package/types/algebra/polynom.d.ts.map +1 -0
- package/types/algebra/rational.d.ts +41 -0
- package/types/algebra/rational.d.ts.map +1 -0
- package/{dist/maths → types}/coefficients/fraction.d.ts +69 -66
- package/types/coefficients/fraction.d.ts.map +1 -0
- package/{dist/maths → types}/coefficients/nthRoot.d.ts +3 -3
- package/{dist/maths → types}/geometry/circle.d.ts +10 -15
- package/types/geometry/circle.d.ts.map +1 -0
- package/types/geometry/geomMath.d.ts +10 -0
- package/types/geometry/geomMath.d.ts.map +1 -0
- package/{dist/maths → types}/geometry/line.d.ts +25 -35
- package/types/geometry/line.d.ts.map +1 -0
- package/types/geometry/line3.d.ts +50 -0
- package/types/geometry/line3.d.ts.map +1 -0
- package/types/geometry/plane3.d.ts +29 -0
- package/types/geometry/plane3.d.ts.map +1 -0
- package/types/geometry/vector.d.ts +70 -0
- package/types/geometry/vector.d.ts.map +1 -0
- package/types/geometry/vector3d.d.ts +37 -0
- package/types/geometry/vector3d.d.ts.map +1 -0
- package/types/index.d.ts +57 -0
- package/types/index.d.ts.map +1 -0
- package/types/numeric.d.ts +39 -0
- package/types/pimath.interface.d.ts +57 -0
- package/types/pimath.interface.d.ts.map +1 -0
- package/types/randomization/algebra/rndEquation.d.ts +4 -0
- package/types/randomization/algebra/rndEquation.d.ts.map +1 -0
- package/types/randomization/algebra/rndMonom.d.ts +4 -0
- package/types/randomization/algebra/rndMonom.d.ts.map +1 -0
- package/types/randomization/algebra/rndPolynom.d.ts +5 -0
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -0
- package/types/randomization/coefficient/rndFraction.d.ts +4 -0
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -0
- package/types/randomization/geometry/rndCircle.d.ts +4 -0
- package/types/randomization/geometry/rndCircle.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine.d.ts +4 -0
- package/types/randomization/geometry/rndLine.d.ts.map +1 -0
- package/types/randomization/geometry/rndLine3.d.ts +4 -0
- package/types/randomization/geometry/rndLine3.d.ts.map +1 -0
- package/types/randomization/geometry/rndPoint.d.ts +4 -0
- package/types/randomization/geometry/rndPoint.d.ts.map +1 -0
- package/types/randomization/random.d.ts +20 -0
- package/types/randomization/random.d.ts.map +1 -0
- package/types/randomization/rndHelpers.d.ts +21 -0
- package/types/randomization/rndTypes.d.ts +64 -0
- package/types/randomization/rndTypes.d.ts.map +1 -0
- package/dist/main.d.ts +0 -1
- package/dist/maths/algebra/equation.d.ts +0 -120
- package/dist/maths/algebra/linearSystem.d.ts +0 -40
- package/dist/maths/algebra/logicalset.d.ts +0 -28
- package/dist/maths/algebra/polynom.d.ts +0 -155
- package/dist/maths/algebra/rational.d.ts +0 -44
- package/dist/maths/algebra/study/rationalStudy.d.ts +0 -14
- package/dist/maths/algebra/study.d.ts +0 -140
- package/dist/maths/geometry/point.d.ts +0 -36
- package/dist/maths/geometry/triangle.d.ts +0 -92
- package/dist/maths/geometry/vector.d.ts +0 -38
- package/dist/maths/numeric.d.ts +0 -28
- package/dist/maths/numexp.d.ts +0 -19
- package/dist/maths/randomization/random.d.ts +0 -26
- package/dist/maths/randomization/randomCore.d.ts +0 -7
- package/dist/maths/randomization/rndFraction.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryCircle.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryLine.d.ts +0 -13
- package/dist/maths/randomization/rndGeometryPoint.d.ts +0 -13
- package/dist/maths/randomization/rndHelpers.d.ts +0 -23
- package/dist/maths/randomization/rndMonom.d.ts +0 -13
- package/dist/maths/randomization/rndPolynom.d.ts +0 -14
- package/dist/maths/randomization/rndTypes.d.ts +0 -40
- package/dist/maths/shutingyard.d.ts +0 -59
- package/dist/pimath.d.ts +0 -39
- package/lib/main.ts +0 -1
- package/lib/maths/algebra/equation.ts +0 -891
- package/lib/maths/algebra/linearSystem.ts +0 -369
- package/lib/maths/algebra/logicalset.ts +0 -183
- package/lib/maths/algebra/monom.ts +0 -1027
- package/lib/maths/algebra/polynom.ts +0 -1537
- package/lib/maths/algebra/rational.ts +0 -244
- package/lib/maths/algebra/study/rationalStudy.ts +0 -287
- package/lib/maths/algebra/study.ts +0 -506
- package/lib/maths/coefficients/fraction.ts +0 -593
- package/lib/maths/coefficients/nthRoot.ts +0 -148
- package/lib/maths/geometry/circle.ts +0 -379
- package/lib/maths/geometry/line.ts +0 -604
- package/lib/maths/geometry/point.ts +0 -215
- package/lib/maths/geometry/triangle.ts +0 -368
- package/lib/maths/geometry/vector.ts +0 -243
- package/lib/maths/numeric.ts +0 -162
- package/lib/maths/numexp.ts +0 -198
- package/lib/maths/randomization/random.ts +0 -80
- package/lib/maths/randomization/randomCore.ts +0 -19
- package/lib/maths/randomization/rndFraction.ts +0 -47
- package/lib/maths/randomization/rndGeometryCircle.ts +0 -50
- package/lib/maths/randomization/rndGeometryLine.ts +0 -53
- package/lib/maths/randomization/rndGeometryPoint.ts +0 -69
- package/lib/maths/randomization/rndHelpers.ts +0 -107
- package/lib/maths/randomization/rndMonom.ts +0 -57
- package/lib/maths/randomization/rndPolynom.ts +0 -90
- package/lib/maths/randomization/rndTypes.ts +0 -43
- package/lib/maths/shutingyard.ts +0 -496
- package/lib/pimath.ts +0 -40
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, ISolution, literalType } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Monom } from './monom';
|
|
4
|
+
|
|
5
|
+
export type PolynomParsingType = InputValue<Polynom> | Monom;
|
|
6
|
+
export interface IEuclidean {
|
|
7
|
+
quotient: Polynom;
|
|
8
|
+
reminder: Polynom;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Polynom class can handle polynoms, reorder, resolve, ...
|
|
12
|
+
* ```
|
|
13
|
+
* let P = new Polynom('3x-4')
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class Polynom implements IPiMathObject<Polynom>, IExpression<Polynom>, IAnalyse<Polynom>, IAlgebra<Polynom> {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(value: InputValue<Fraction>);
|
|
19
|
+
constructor(value: string);
|
|
20
|
+
constructor(value: Monom);
|
|
21
|
+
constructor(value: Polynom);
|
|
22
|
+
constructor(...values: InputValue<Fraction>[]);
|
|
23
|
+
constructor(...values: InputAlgebra<Polynom>[]);
|
|
24
|
+
/**
|
|
25
|
+
* Parse a string to a polynom.
|
|
26
|
+
* @param inputStr
|
|
27
|
+
* @param values
|
|
28
|
+
*/
|
|
29
|
+
parse: (inputStr: PolynomParsingType, ...values: InputAlgebra<Monom>[]) => this;
|
|
30
|
+
/**
|
|
31
|
+
* Clone the polynom
|
|
32
|
+
*/
|
|
33
|
+
clone: () => Polynom;
|
|
34
|
+
add: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
35
|
+
commonMonom: () => Monom;
|
|
36
|
+
degree: (letter?: string) => Fraction;
|
|
37
|
+
derivative: (letter?: string) => Polynom;
|
|
38
|
+
divide: (value: InputAlgebra<Polynom>) => Polynom;
|
|
39
|
+
empty: () => this;
|
|
40
|
+
/**
|
|
41
|
+
* Divide the current polynom by another polynom.
|
|
42
|
+
* @param P
|
|
43
|
+
* returns {quotient: Polynom, reminder: Polynom}
|
|
44
|
+
*/
|
|
45
|
+
euclidean: (P: Polynom) => IEuclidean;
|
|
46
|
+
evaluate: (values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean) => Fraction | number;
|
|
47
|
+
/**
|
|
48
|
+
* Factorize a polynom and store the best results in factors.
|
|
49
|
+
* @param maxValue Defines the greatest value to search to (default is 20).
|
|
50
|
+
*/
|
|
51
|
+
factorize: (letter?: string) => Polynom[];
|
|
52
|
+
gcdDenominator: () => number;
|
|
53
|
+
gcdNumerator: () => number;
|
|
54
|
+
getDenominators: () => number[];
|
|
55
|
+
getNumerators: () => number[];
|
|
56
|
+
getZeroes: () => ISolution[];
|
|
57
|
+
hasVariable(letter: string): boolean;
|
|
58
|
+
integrate: (a: InputValue<Fraction>, b: InputValue<Fraction>, letter?: string) => Fraction;
|
|
59
|
+
inverse(): Polynom | undefined;
|
|
60
|
+
isDeveloped: (polynomString: string) => boolean;
|
|
61
|
+
isDividableBy: (div: Polynom) => boolean;
|
|
62
|
+
isEqual: (P: Polynom) => boolean;
|
|
63
|
+
isOne(): boolean;
|
|
64
|
+
isOppositeAt: (P: Polynom) => boolean;
|
|
65
|
+
isReduced: (polynomString: string) => boolean;
|
|
66
|
+
isSameAs: (P: Polynom) => boolean;
|
|
67
|
+
isZero(): boolean;
|
|
68
|
+
lcmDenominator: () => number;
|
|
69
|
+
lcmNumerator: () => number;
|
|
70
|
+
letters: () => string[];
|
|
71
|
+
limitToInfinity: (letter?: string) => Fraction;
|
|
72
|
+
limitToNegativeInfinity: (letter?: string) => Fraction;
|
|
73
|
+
monomByDegree: (degree?: Fraction | number, letter?: string) => Monom;
|
|
74
|
+
monomByLetter: (letter: string) => Monom;
|
|
75
|
+
monomsByDegree: (degree?: number | Fraction, letter?: string) => Monom[];
|
|
76
|
+
multiply: (value: unknown) => Polynom;
|
|
77
|
+
one: () => this;
|
|
78
|
+
opposite: () => this;
|
|
79
|
+
pow: (nb: number) => Polynom;
|
|
80
|
+
primitive: (letter?: string) => Polynom;
|
|
81
|
+
reduce: () => Polynom;
|
|
82
|
+
reorder: (letter?: string, revert?: boolean) => this;
|
|
83
|
+
/**
|
|
84
|
+
* Replace a variable (letter) by a polynom.
|
|
85
|
+
* @param letter
|
|
86
|
+
* @param P
|
|
87
|
+
*/
|
|
88
|
+
replaceBy: (letter: string, P: Polynom) => this;
|
|
89
|
+
root(): Polynom;
|
|
90
|
+
sqrt(): Polynom;
|
|
91
|
+
subtract: (...values: InputAlgebra<Polynom>[]) => Polynom;
|
|
92
|
+
/**
|
|
93
|
+
* Set the polynom to zero.
|
|
94
|
+
* @returns {this}
|
|
95
|
+
*/
|
|
96
|
+
zero: () => this;
|
|
97
|
+
get display(): string;
|
|
98
|
+
get isMultiVariable(): boolean;
|
|
99
|
+
get length(): number;
|
|
100
|
+
get monoms(): Monom[];
|
|
101
|
+
set monoms(M: Monom[]);
|
|
102
|
+
get numberOfVars(): number;
|
|
103
|
+
get plotFunction(): string;
|
|
104
|
+
get tex(): string;
|
|
105
|
+
get variables(): string[];
|
|
106
|
+
get zeroes(): ISolution[];
|
|
107
|
+
private _compare;
|
|
108
|
+
private _divideByFraction;
|
|
109
|
+
private _divideByInteger;
|
|
110
|
+
private _evaluateAsNumeric;
|
|
111
|
+
private _factorize2ndDegree;
|
|
112
|
+
private _factorizeByGroups;
|
|
113
|
+
private _getAllPotentialFactors;
|
|
114
|
+
private _multiplyByFraction;
|
|
115
|
+
private _multiplyByInteger;
|
|
116
|
+
private _multiplyByMonom;
|
|
117
|
+
private _multiplyByPolynom;
|
|
118
|
+
private _parseString;
|
|
119
|
+
private _shutingYard_addToken;
|
|
120
|
+
private genDisplay;
|
|
121
|
+
/**
|
|
122
|
+
* Main parse using a shutting yard class
|
|
123
|
+
* @param inputStr
|
|
124
|
+
*/
|
|
125
|
+
private _shutingYardToReducedPolynom;
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynom.d.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CASzB;IAED,OAAO,CAAC,YAAY;IAsDpB,OAAO,CAAC,qBAAqB,CA4E5B;IAED,OAAO,CAAC,UAAU,CA4BjB;IAMD,OAAO,CAAC,4BAA4B,CAoBnC;CAGJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IAlgebra, IAnalyse, IExpression, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Polynom } from './polynom';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Rational class can handle rational polynoms
|
|
7
|
+
*/
|
|
8
|
+
export declare class Rational implements IPiMathObject<Rational>, IExpression<Rational>, IAnalyse<Rational>, IAlgebra<Rational> {
|
|
9
|
+
#private;
|
|
10
|
+
constructor();
|
|
11
|
+
constructor(value: Rational);
|
|
12
|
+
constructor(numerator: InputAlgebra<Polynom>, denominator?: InputAlgebra<Polynom>);
|
|
13
|
+
get tex(): string;
|
|
14
|
+
get display(): string;
|
|
15
|
+
get numerator(): Polynom;
|
|
16
|
+
get denominator(): Polynom;
|
|
17
|
+
clone(): Rational;
|
|
18
|
+
parse(): Rational;
|
|
19
|
+
zero(): this;
|
|
20
|
+
one(): this;
|
|
21
|
+
add(value: InputValue<Rational>): Rational;
|
|
22
|
+
subtract(value: InputValue<Rational>): Rational;
|
|
23
|
+
opposite(): this;
|
|
24
|
+
multiply(value: InputValue<Rational>): this;
|
|
25
|
+
divide(value: InputValue<Rational>): this;
|
|
26
|
+
reduce(): Rational;
|
|
27
|
+
isEqual(value: InputValue<Rational>): boolean;
|
|
28
|
+
isZero(): boolean;
|
|
29
|
+
isOne(): boolean;
|
|
30
|
+
inverse(): this;
|
|
31
|
+
pow(value: number): Rational;
|
|
32
|
+
sqrt(): Rational | undefined;
|
|
33
|
+
root(): Rational | undefined;
|
|
34
|
+
derivative(): Rational | Rational[];
|
|
35
|
+
primitive(): Rational;
|
|
36
|
+
integrate(a: InputValue<Fraction>, b: InputValue<Rational>, letter?: string): Fraction;
|
|
37
|
+
get variables(): string[];
|
|
38
|
+
hasVariable(letter: string): boolean;
|
|
39
|
+
degree(): Fraction;
|
|
40
|
+
evaluate(values: literalType<Fraction | number> | InputValue<Fraction>, asNumeric?: boolean): Fraction | number | boolean;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../src/algebra/rational.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAChI,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,qBAAa,QAAS,YAClB,aAAa,CAAC,QAAQ,CAAC,EACvB,WAAW,CAAC,QAAQ,CAAC,EACrB,QAAQ,CAAC,QAAQ,CAAC,EAClB,QAAQ,CAAC,QAAQ,CAAC;;;gBAMN,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC;IAcjF,IAAI,GAAG,IAAI,MAAM,CAEhB;IACD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,KAAK,IAAI,QAAQ;IAOjB,KAAK,IAAI,QAAQ;IAIjB,IAAI,IAAI,IAAI;IAMZ,GAAG,IAAI,IAAI;IAOX,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAI1C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAI/C,QAAQ,IAAI,IAAI;IAKhB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI;IAW3C,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI;IAIzC,MAAM,IAAI,QAAQ;IAGlB,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,OAAO;IAG7C,MAAM,IAAI,OAAO;IAGjB,KAAK,IAAI,OAAO;IAGhB,OAAO,IAAI,IAAI;IASf,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAe5B,IAAI,IAAI,QAAQ,GAAG,SAAS;IAI5B,IAAI,IAAI,QAAQ,GAAG,SAAS;IAI5B,UAAU,IAAI,QAAQ,GAAG,QAAQ,EAAE;IAGnC,SAAS,IAAI,QAAQ;IAGrB,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ;IAItF,IAAI,SAAS,IAAI,MAAM,EAAE,CAKxB;IAED,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIpC,MAAM,IAAI,QAAQ;IAIlB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO;CAa5H"}
|
|
@@ -1,90 +1,93 @@
|
|
|
1
|
+
import { compareSign, IExpression, InputValue, IPiMathObject } from './../pimath.interface';
|
|
2
|
+
|
|
1
3
|
export type FractionParsingType = number | string | Fraction;
|
|
2
4
|
/**
|
|
3
5
|
* The fraction class make possible to handle
|
|
4
|
-
* TODO: Write the documentation correctly.
|
|
5
6
|
* \\(\frac{a}{b}\\) or \\[\frac{a}{b}\\] values.
|
|
6
7
|
*/
|
|
7
|
-
export declare class Fraction {
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
constructor(value
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
get denominator(): number;
|
|
14
|
-
set denominator(value: number);
|
|
15
|
-
get value(): number;
|
|
16
|
-
get tex(): string;
|
|
17
|
-
get texWithSign(): string;
|
|
18
|
-
get display(): string;
|
|
19
|
-
get frac(): string;
|
|
20
|
-
get dfrac(): string;
|
|
21
|
-
get tfrac(): string;
|
|
22
|
-
static max: (...fractions: (Fraction | number)[]) => Fraction;
|
|
23
|
-
static min: (...fractions: (Fraction | number)[]) => Fraction;
|
|
24
|
-
static average: (...fractions: (Fraction | number)[]) => Fraction;
|
|
25
|
-
static unique: (fractions: Fraction[], sorted?: boolean) => Fraction[];
|
|
26
|
-
static sort: (fractions: Fraction[], reverse?: boolean) => Fraction[];
|
|
27
|
-
isApproximative: () => boolean;
|
|
28
|
-
isExact: () => boolean;
|
|
8
|
+
export declare class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction> {
|
|
9
|
+
#private;
|
|
10
|
+
constructor();
|
|
11
|
+
constructor(value: InputValue<Fraction>);
|
|
12
|
+
constructor(numerator: number, denominator: number);
|
|
13
|
+
constructor(decimal: number, periodLength: number);
|
|
29
14
|
/**
|
|
30
15
|
* Parse the value to get the numerator and denominator
|
|
31
16
|
* @param value : number or string to parse to get the fraction
|
|
32
17
|
* @param denominatorOrPeriodic (optional|number) : length of the periodic part: 2.333333 => 1 or denominator value
|
|
33
18
|
*/
|
|
34
|
-
parse: (value:
|
|
19
|
+
parse: (value: InputValue<Fraction>, denominatorOrPeriodic?: number) => Fraction;
|
|
35
20
|
clone: () => Fraction;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
multiply: (F: Fraction | number) => Fraction;
|
|
44
|
-
xMultiply: (...values: (Fraction | number)[]) => Fraction;
|
|
45
|
-
divide: (F: Fraction | number) => Fraction;
|
|
46
|
-
invert: () => Fraction;
|
|
47
|
-
pow: (p: number | Fraction) => Fraction;
|
|
48
|
-
root: (p: number) => Fraction;
|
|
49
|
-
sqrt: () => Fraction;
|
|
50
|
-
abs: () => Fraction;
|
|
51
|
-
reduce: () => Fraction;
|
|
52
|
-
amplify: (k: number) => Fraction;
|
|
21
|
+
abs: () => this;
|
|
22
|
+
add: (F: InputValue<Fraction>) => Fraction;
|
|
23
|
+
amplify: (k: number) => this;
|
|
24
|
+
/**
|
|
25
|
+
* Simple function to determine if it's a fraction
|
|
26
|
+
*/
|
|
27
|
+
areEquals: (...F: Fraction[]) => boolean;
|
|
53
28
|
/**
|
|
54
29
|
* Compare the current coefficient with another coefficient
|
|
55
|
-
* @param F (Coefficient) The coefficient to
|
|
30
|
+
* @param F (Coefficient) The coefficient to _compare
|
|
56
31
|
* @param sign (string| default is =): authorized values: =, <, <=, >, >= with some variations.
|
|
57
32
|
*/
|
|
58
|
-
compare: (F:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
33
|
+
compare: (F: InputValue<Fraction>, sign?: compareSign) => boolean;
|
|
34
|
+
divide: (F: Fraction | number) => Fraction;
|
|
35
|
+
infinite: () => this;
|
|
36
|
+
invalid: () => this;
|
|
37
|
+
inverse: () => this;
|
|
38
|
+
isApproximative: () => boolean;
|
|
63
39
|
isEqual: (than: Fraction | number) => boolean;
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
isEven: () => boolean;
|
|
41
|
+
isExact: () => boolean;
|
|
42
|
+
isFinite: () => boolean;
|
|
43
|
+
isGeq: (than: Fraction | number) => boolean;
|
|
44
|
+
isGreater: (than: Fraction | number) => boolean;
|
|
45
|
+
isInfinity: () => boolean;
|
|
66
46
|
isInverted: (p: Fraction) => boolean;
|
|
67
|
-
|
|
47
|
+
isLeq: (than: Fraction | number) => boolean;
|
|
48
|
+
isLesser: (than: Fraction | number) => boolean;
|
|
49
|
+
isNaN: () => boolean;
|
|
50
|
+
isNatural: () => boolean;
|
|
51
|
+
isNegative: () => boolean;
|
|
52
|
+
isNegativeOne: () => boolean;
|
|
53
|
+
isNotEqual: (than: Fraction | number) => boolean;
|
|
68
54
|
isNotZero: () => boolean;
|
|
55
|
+
isOdd: () => boolean;
|
|
69
56
|
isOne: () => boolean;
|
|
70
|
-
|
|
57
|
+
isOpposite: (p: Fraction) => boolean;
|
|
71
58
|
isPositive: () => boolean;
|
|
72
|
-
|
|
73
|
-
isStrictlyPositive: () => boolean;
|
|
74
|
-
isStrictlyNegative: () => Boolean;
|
|
75
|
-
isNaN: () => boolean;
|
|
76
|
-
isInfinity: () => boolean;
|
|
77
|
-
isFinite: () => boolean;
|
|
78
|
-
isSquare: () => boolean;
|
|
59
|
+
isRational: () => boolean;
|
|
79
60
|
isReduced: () => boolean;
|
|
80
|
-
isNatural: () => boolean;
|
|
81
61
|
isRelative: () => boolean;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
isSquare: () => boolean;
|
|
63
|
+
isStrictlyNegative: () => boolean;
|
|
64
|
+
isStrictlyPositive: () => boolean;
|
|
65
|
+
isZero: () => boolean;
|
|
66
|
+
multiply: (F: Fraction | number) => this;
|
|
67
|
+
one: () => this;
|
|
68
|
+
opposite: () => this;
|
|
69
|
+
pow: (p: number | Fraction) => Fraction;
|
|
70
|
+
reduce: () => this;
|
|
71
|
+
root: (p: number) => this;
|
|
85
72
|
sign: () => number;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
sqrt: () => this;
|
|
74
|
+
subtract: (F: Fraction | number) => Fraction;
|
|
75
|
+
zero: () => this;
|
|
76
|
+
static average: (...fractions: (InputValue<Fraction>)[]) => Fraction;
|
|
77
|
+
static max: (...fractions: InputValue<Fraction>[]) => Fraction;
|
|
78
|
+
static min: (...fractions: (InputValue<Fraction>)[]) => Fraction;
|
|
79
|
+
static sort: (fractions: (InputValue<Fraction>)[], reverse?: boolean) => Fraction[];
|
|
80
|
+
static unique: (fractions: (InputValue<Fraction>)[]) => Fraction[];
|
|
81
|
+
static xMultiply: (...values: (InputValue<Fraction>)[]) => Fraction;
|
|
82
|
+
get denominator(): number;
|
|
83
|
+
set denominator(value: number);
|
|
84
|
+
get dfrac(): string;
|
|
85
|
+
get display(): string;
|
|
86
|
+
get frac(): string;
|
|
87
|
+
get numerator(): number;
|
|
88
|
+
set numerator(value: number);
|
|
89
|
+
get tex(): string;
|
|
90
|
+
get texWithSign(): string;
|
|
91
|
+
get tfrac(): string;
|
|
92
|
+
get value(): number;
|
|
90
93
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fraction.d.ts","sourceRoot":"","sources":["../../src/coefficients/fraction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAKhG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;AAU5D,qBAAa,QAAS,YAAW,aAAa,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC;;;gBAY/D,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;gBAC3B,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;gBACtC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAuB1C,KAAK,UAAW,WAAW,QAAQ,CAAC,0BAA0B,MAAM,KAAG,QAAQ,CA6ErF;IAEM,KAAK,QAAO,QAAQ,CAK1B;IAEM,GAAG,QAAO,IAAI,CAIpB;IAEM,GAAG,MAAO,WAAW,QAAQ,CAAC,KAAG,QAAQ,CAY/C;IAEM,OAAO,MAAO,MAAM,KAAG,IAAI,CAMjC;IAMM,SAAS,SAAU,QAAQ,EAAE,KAAG,OAAO,CAE7C;IAWM,OAAO,MAAO,WAAW,QAAQ,CAAC,SAAS,WAAW,KAAG,OAAO,CAmCtE;IAEM,MAAM,MAAO,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IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,IAAI,MAAM,CAEzB;CAGJ"}
|
|
@@ -16,8 +16,8 @@ export declare class NthRoot {
|
|
|
16
16
|
get tex(): string;
|
|
17
17
|
get display(): string;
|
|
18
18
|
get value(): number;
|
|
19
|
-
parse: (radical: number, nthroot?: number, coefficient?: number) =>
|
|
20
|
-
reduce: () =>
|
|
21
|
-
multiply: (N: NthRoot) =>
|
|
19
|
+
parse: (radical: number, nthroot?: number, coefficient?: number) => this;
|
|
20
|
+
reduce: () => this;
|
|
21
|
+
multiply: (N: NthRoot) => this;
|
|
22
22
|
hasRadical: () => boolean;
|
|
23
23
|
}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { Equation } from '../algebra/equation';
|
|
2
|
-
import { Fraction } from '../coefficients/fraction';
|
|
3
1
|
import { Line } from './line';
|
|
4
|
-
import {
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
import { Fraction } from '../coefficients/fraction';
|
|
4
|
+
import { Equation } from '../algebra/equation';
|
|
5
5
|
|
|
6
6
|
export declare class Circle {
|
|
7
|
-
private
|
|
8
|
-
private _squareRadius;
|
|
9
|
-
private _cartesian;
|
|
10
|
-
private _exists;
|
|
7
|
+
#private;
|
|
11
8
|
constructor(...values: unknown[]);
|
|
12
|
-
get center():
|
|
9
|
+
get center(): Vector;
|
|
13
10
|
get squareRadius(): Fraction;
|
|
14
11
|
get cartesian(): Equation;
|
|
15
|
-
get exists(): boolean;
|
|
16
12
|
get radius(): {
|
|
17
13
|
tex: string;
|
|
18
14
|
display: string;
|
|
@@ -27,11 +23,11 @@ export declare class Circle {
|
|
|
27
23
|
* @returns {number}
|
|
28
24
|
*/
|
|
29
25
|
relativePosition: (L: Line) => number;
|
|
30
|
-
lineIntersection: (L: Line) =>
|
|
31
|
-
tangents: (P:
|
|
32
|
-
isPointOnCircle: (P:
|
|
33
|
-
getPointsOnCircle: (numberIsInteger?: boolean) =>
|
|
34
|
-
clone():
|
|
26
|
+
lineIntersection: (L: Line) => Vector[];
|
|
27
|
+
tangents: (P: Vector | Fraction) => Line[];
|
|
28
|
+
isPointOnCircle: (P: Vector) => boolean;
|
|
29
|
+
getPointsOnCircle: (numberIsInteger?: boolean) => Vector[];
|
|
30
|
+
clone(): this;
|
|
35
31
|
private _tangentsThroughOnePointOnTheCircle;
|
|
36
32
|
private _tangentsThroughOnePointOutsideTheCircle;
|
|
37
33
|
private _tangentsWithSlope;
|
|
@@ -42,5 +38,4 @@ export declare class Circle {
|
|
|
42
38
|
private _parseCenterAndRadius;
|
|
43
39
|
private _parseCenterAndPointThrough;
|
|
44
40
|
private _parseEquation;
|
|
45
|
-
private _parseThroughtThreePoints;
|
|
46
41
|
}
|
|
@@ -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;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAI9C,qBAAa,MAAM;;gBAKH,GAAG,MAAM,EAAE,OAAO,EAAE;IAMhC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,YAAY,IAAI,QAAQ,CAE3B;IAED,IAAI,SAAS,IAAI,QAAQ,CAIxB;IAED,IAAI,MAAM,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAe5D;IAED,IAAI,GAAG,IAAI,MAAM,CAchB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,OAAO,IAAI,MAAM,CAapB;IAOD,gBAAgB,MAAO,IAAI,KAAG,MAAM,CAYnC;IAED,gBAAgB,MAAO,IAAI,KAAG,MAAM,EAAE,CAwBrC;IAED,QAAQ,MAAO,MAAM,GAAG,QAAQ,KAAG,IAAI,EAAE,CAYxC;IAED,eAAe,MAAO,MAAM,KAAG,OAAO,CAErC;IAED,iBAAiB,qBAAsB,OAAO,KAAG,MAAM,EAAE,CA+BxD;IAED,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,mCAAmC,CAG1C;IAED,OAAO,CAAC,wCAAwC,CAgC/C;IAED,OAAO,CAAC,kBAAkB,CAYzB;IAED,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,KAAK;IAqCb,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,cAAc;CA2CzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
import { Vector3D } from './vector3d';
|
|
4
|
+
|
|
5
|
+
type V = Vector | Vector3D;
|
|
6
|
+
export declare function areVectorsEquals(v1: V, v2: V): boolean;
|
|
7
|
+
export declare function areVectorsColinears(v1: V, v2: V): boolean;
|
|
8
|
+
export declare function dotProduct(v1: V, v2: V): Fraction;
|
|
9
|
+
export declare function determinant(...values: V[]): Fraction;
|
|
10
|
+
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;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,KAAK,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAA;AAC1B,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,CAUzD;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"}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { Equation } from '../algebra/equation';
|
|
2
1
|
import { Fraction } from '../coefficients/fraction';
|
|
3
|
-
import {
|
|
2
|
+
import { Equation } from '../algebra/equation';
|
|
4
3
|
import { Vector } from './vector';
|
|
4
|
+
import { InputValue } from '../pimath.interface';
|
|
5
5
|
|
|
6
6
|
export declare enum LinePropriety {
|
|
7
|
-
None =
|
|
7
|
+
None = "none",
|
|
8
8
|
Parallel = "parallel",
|
|
9
9
|
Perpendicular = "perpendicular",
|
|
10
10
|
Tangent = "tangent"
|
|
11
11
|
}
|
|
12
12
|
export declare class Line {
|
|
13
|
+
#private;
|
|
13
14
|
static PERPENDICULAR: LinePropriety;
|
|
14
15
|
static PARALLEL: LinePropriety;
|
|
15
|
-
private _referencePropriety;
|
|
16
|
-
private _referenceLine;
|
|
17
|
-
private _reduceBeforeDisplay;
|
|
18
|
-
private _a;
|
|
19
|
-
private _b;
|
|
20
|
-
private _c;
|
|
21
|
-
private _OA;
|
|
22
|
-
private _d;
|
|
23
|
-
private _n;
|
|
24
|
-
private _exists;
|
|
25
16
|
/**
|
|
26
17
|
* Value can be a mix of:
|
|
27
18
|
*
|
|
@@ -34,12 +25,11 @@ export declare class Line {
|
|
|
34
25
|
set b(value: Fraction);
|
|
35
26
|
get c(): Fraction;
|
|
36
27
|
set c(value: Fraction);
|
|
37
|
-
get OA():
|
|
38
|
-
set OA(value:
|
|
28
|
+
get OA(): Vector;
|
|
29
|
+
set OA(value: Vector);
|
|
39
30
|
get d(): Vector;
|
|
40
31
|
set d(value: Vector);
|
|
41
32
|
get n(): Vector;
|
|
42
|
-
get exists(): boolean;
|
|
43
33
|
get equation(): Equation;
|
|
44
34
|
get system(): {
|
|
45
35
|
x: Equation;
|
|
@@ -63,40 +53,40 @@ export declare class Line {
|
|
|
63
53
|
get director(): Vector;
|
|
64
54
|
get slope(): Fraction;
|
|
65
55
|
get height(): Fraction;
|
|
66
|
-
randomPoint: (k?: number) =>
|
|
67
|
-
randomNearPoint: (k?: number) =>
|
|
56
|
+
randomPoint: (k?: number) => Vector;
|
|
57
|
+
randomNearPoint: (k?: number) => Vector;
|
|
68
58
|
/**
|
|
69
59
|
* Parse data to a line
|
|
70
60
|
* @param {any} values
|
|
71
61
|
* @returns {Line}
|
|
72
62
|
*/
|
|
73
63
|
parse: (...values: unknown[]) => Line;
|
|
74
|
-
parseEquation: (equ: Equation) =>
|
|
75
|
-
parseByCoefficient: (a: Fraction
|
|
76
|
-
parseByPointAndVector: (P:
|
|
77
|
-
parseByPointAndNormal: (P:
|
|
78
|
-
parseByPointAndLine: (P:
|
|
79
|
-
clone: () =>
|
|
80
|
-
isOnLine: (pt:
|
|
81
|
-
isParallelTo: (line: Line) =>
|
|
82
|
-
isSameAs: (line: Line) =>
|
|
83
|
-
isPerpendicularTo: (line: Line) =>
|
|
84
|
-
isVertical: () =>
|
|
85
|
-
simplify: () =>
|
|
86
|
-
simplifyDirection: () =>
|
|
64
|
+
parseEquation: (equ: Equation) => this;
|
|
65
|
+
parseByCoefficient: (a: InputValue<Fraction>, b: InputValue<Fraction>, c: InputValue<Fraction>) => this;
|
|
66
|
+
parseByPointAndVector: (P: Vector, d: Vector) => this;
|
|
67
|
+
parseByPointAndNormal: (P: Vector, n: Vector) => this;
|
|
68
|
+
parseByPointAndLine: (P: Vector, L: Line, orientation?: LinePropriety) => this;
|
|
69
|
+
clone: () => this;
|
|
70
|
+
isOnLine: (pt: Vector) => boolean;
|
|
71
|
+
isParallelTo: (line: Line) => boolean;
|
|
72
|
+
isSameAs: (line: Line) => boolean;
|
|
73
|
+
isPerpendicularTo: (line: Line) => boolean;
|
|
74
|
+
isVertical: () => boolean;
|
|
75
|
+
simplify: () => this;
|
|
76
|
+
simplifyDirection: () => this;
|
|
87
77
|
intersection: (line: Line) => {
|
|
88
|
-
point:
|
|
78
|
+
point: Vector;
|
|
89
79
|
hasIntersection: boolean;
|
|
90
80
|
isParallel: boolean;
|
|
91
81
|
isSame: boolean;
|
|
92
82
|
};
|
|
93
|
-
distanceTo(pt:
|
|
83
|
+
distanceTo(pt: Vector): {
|
|
94
84
|
value: number;
|
|
95
85
|
fraction: Fraction;
|
|
96
86
|
tex: string;
|
|
97
87
|
};
|
|
98
|
-
hitSegment(A:
|
|
88
|
+
hitSegment(A: Vector, B: Vector): boolean;
|
|
99
89
|
getValueAtX: (value: Fraction | number) => Fraction;
|
|
100
90
|
getValueAtY: (value: Fraction | number) => Fraction;
|
|
101
|
-
canonicalAsFloatCoefficient(decimals
|
|
91
|
+
canonicalAsFloatCoefficient(decimals?: number): string;
|
|
102
92
|
}
|
|
@@ -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,MAAM,qBAAqB,CAAA;AAGrD,oBAAY,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,qBAAa,IAAI;;IAEb,MAAM,CAAC,aAAa,gBAA8B;IAClD,MAAM,CAAC,QAAQ,gBAAyB;gBAe5B,GAAG,MAAM,EAAE,OAAO,EAAE;IAkBhC,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kCzD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Point3D, Vector3D } from './vector3d';
|
|
3
|
+
|
|
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: Point3D, d: Vector3D);
|
|
20
|
+
get OA(): Vector3D;
|
|
21
|
+
set OA(value: Vector3D);
|
|
22
|
+
get point(): Point3D;
|
|
23
|
+
get d(): Vector3D;
|
|
24
|
+
set d(value: Vector3D);
|
|
25
|
+
get tex(): {
|
|
26
|
+
parametric: string;
|
|
27
|
+
system: string;
|
|
28
|
+
};
|
|
29
|
+
get direction(): Vector3D;
|
|
30
|
+
clone: () => this;
|
|
31
|
+
isOnLine: (pt: Vector3D) => boolean;
|
|
32
|
+
isParallelTo: (line: Line3) => boolean;
|
|
33
|
+
isSameAs: (line: Line3) => boolean;
|
|
34
|
+
isPerpendicularTo: (line: Line3) => boolean;
|
|
35
|
+
isVertical: () => boolean;
|
|
36
|
+
simplify: () => this;
|
|
37
|
+
intersection: (line: Line3) => {
|
|
38
|
+
point: Vector3D;
|
|
39
|
+
hasIntersection: boolean;
|
|
40
|
+
isParallel: boolean;
|
|
41
|
+
isSame: boolean;
|
|
42
|
+
};
|
|
43
|
+
distanceTo(pt: Vector3D): {
|
|
44
|
+
value: number;
|
|
45
|
+
fraction: Fraction;
|
|
46
|
+
tex: string;
|
|
47
|
+
};
|
|
48
|
+
hitSegment(A: Vector3D, B: Vector3D): bo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OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAgChH;IAED,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAoC5E,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO;IAsC7C,WAAW,oBAAc,OAAO,CAS/B;CACJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Equation } from '../algebra/equation';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Line3 } from './line3';
|
|
4
|
+
import { Point3D, Vector3D } from './vector3d';
|
|
5
|
+
|
|
6
|
+
interface Plane3Config {
|
|
7
|
+
point?: Point3D;
|
|
8
|
+
normal?: Vector3D;
|
|
9
|
+
directions?: Vector3D[];
|
|
10
|
+
equation?: Equation;
|
|
11
|
+
points?: Point3D[];
|
|
12
|
+
coefficients?: number[];
|
|
13
|
+
}
|
|
14
|
+
export declare class Plane3 {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(config?: Plane3Config);
|
|
17
|
+
get normal(): Vector3D;
|
|
18
|
+
set normal(value: Vector3D);
|
|
19
|
+
get point(): Point3D;
|
|
20
|
+
set point(value: Point3D);
|
|
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
|
+
intersectWithLine(line: Line3): Point3D;
|
|
28
|
+
}
|
|
29
|
+
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,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG9C,UAAU,YAAY;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B;AACD,qBAAa,MAAM;;gBAIH,MAAM,CAAC,EAAE,YAAY;IAQjC,IAAI,MAAM,IAAI,QAAQ,CAErB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,EAEzB;IACD,IAAI,KAAK,IAAI,OAAO,CAEnB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,EAEvB;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;IAmD1B,iBAAiB,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO;CAM1C"}
|