pimath 0.0.128 → 0.0.129
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/main.d.ts +39 -0
- package/dist/maths/algebra/equation.d.ts +120 -0
- package/dist/maths/algebra/linearSystem.d.ts +40 -0
- package/dist/maths/algebra/logicalset.d.ts +28 -0
- package/dist/maths/algebra/monom.d.ts +207 -0
- package/dist/maths/algebra/polynom.d.ts +155 -0
- package/dist/maths/algebra/rational.d.ts +44 -0
- package/dist/maths/algebra/study/rationalStudy.d.ts +14 -0
- package/dist/maths/algebra/study.d.ts +140 -0
- package/dist/maths/coefficients/fraction.d.ts +90 -0
- package/dist/maths/coefficients/nthRoot.d.ts +23 -0
- package/dist/maths/geometry/circle.d.ts +46 -0
- package/dist/maths/geometry/line.d.ts +102 -0
- package/dist/maths/geometry/point.d.ts +36 -0
- package/dist/maths/geometry/triangle.d.ts +92 -0
- package/dist/maths/geometry/vector.d.ts +38 -0
- package/dist/maths/numeric.d.ts +28 -0
- package/dist/maths/numexp.d.ts +19 -0
- package/dist/maths/randomization/random.d.ts +26 -0
- package/dist/maths/randomization/randomCore.d.ts +7 -0
- package/dist/maths/randomization/rndFraction.d.ts +13 -0
- package/dist/maths/randomization/rndGeometryCircle.d.ts +13 -0
- package/dist/maths/randomization/rndGeometryLine.d.ts +13 -0
- package/dist/maths/randomization/rndGeometryPoint.d.ts +13 -0
- package/dist/maths/randomization/rndHelpers.d.ts +23 -0
- package/dist/maths/randomization/rndMonom.d.ts +13 -0
- package/dist/maths/randomization/rndPolynom.d.ts +14 -0
- package/dist/maths/randomization/rndTypes.d.ts +40 -0
- package/dist/maths/shutingyard.d.ts +59 -0
- package/dist/pimath.js +85 -85
- package/package.json +10 -12
- package/.eslintrc.js +0 -24
- package/.idea/$CACHE_FILE$ +0 -6
- package/.idea/PI.iml +0 -14
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -19
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30_[Default_Changelist]/shelved.patch +0 -192
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30_[Default_Changelist]1/shelved.patch +0 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_07_11_2023_08_30__Default_Changelist_.xml +0 -4
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_10_43_[Default_Changelist]/shelved.patch +0 -2404
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_10_43__Default_Changelist_.xml +0 -4
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01_[Default_Changelist]/shelved.patch +0 -1362
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_09_11_2023_11_01__Default_Changelist_.xml +0 -4
- package/.idea/shelf/Uncommitted_changes_before_Update_at_24_07_2023_15_31_[Default_Changelist]/shelved.patch +0 -90
- package/.idea/shelf/Uncommitted_changes_before_Update_at_24_07_2023_15_31__Default_Changelist_.xml +0 -4
- package/.idea/vcs.xml +0 -6
- package/dist/demo/exercises.html +0 -283
- package/dist/demo/matrices.html +0 -39
- package/dist/demo/playground.html +0 -20
- package/dist/demo.css +0 -3
- package/dist/pimath.umd.cjs +0 -15
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -78
- package/docs/assets/main.js +0 -59
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1383
- package/docs/classes/Logicalset.Logicalset.html +0 -217
- package/docs/classes/Polynom.Rational.html +0 -397
- package/docs/classes/Vector-1.Vector.html +0 -490
- package/docs/classes/Vector.Point.html +0 -337
- package/docs/classes/algebra_equation.Equation.html +0 -790
- package/docs/classes/algebra_linearSystem.LinearSystem.html +0 -404
- package/docs/classes/algebra_monom.Monom.html +0 -962
- package/docs/classes/algebra_polynom.Polynom.html +0 -1275
- package/docs/classes/coefficients_fraction.Fraction.html +0 -934
- package/docs/classes/geometry_circle.Circle.html +0 -472
- package/docs/classes/geometry_line.Line.html +0 -774
- package/docs/classes/geometry_triangle.Triangle.html +0 -429
- package/docs/classes/numeric.Numeric.html +0 -265
- package/docs/classes/shutingyard.Shutingyard.html +0 -250
- package/docs/enums/algebra_equation.PARTICULAR_SOLUTION.html +0 -83
- package/docs/enums/geometry_line.LinePropriety.html +0 -97
- package/docs/enums/shutingyard.ShutingyardMode.html +0 -97
- package/docs/enums/shutingyard.ShutingyardType.html +0 -111
- package/docs/index.html +0 -63
- package/docs/interfaces/algebra_equation.ISolution.html +0 -105
- package/docs/interfaces/algebra_polynom.IEuclidian.html +0 -87
- package/docs/interfaces/geometry_triangle.remarquableLines.html +0 -163
- package/docs/modules/Logicalset.html +0 -65
- package/docs/modules/Polynom.html +0 -65
- package/docs/modules/Vector-1.html +0 -65
- package/docs/modules/Vector.html +0 -65
- package/docs/modules/algebra_equation.html +0 -69
- package/docs/modules/algebra_linearSystem.html +0 -61
- package/docs/modules/algebra_monom.html +0 -65
- package/docs/modules/algebra_polynom.html +0 -69
- package/docs/modules/coefficients_fraction.html +0 -65
- package/docs/modules/geometry_circle.html +0 -61
- package/docs/modules/geometry_line.html +0 -65
- package/docs/modules/geometry_triangle.html +0 -65
- package/docs/modules/numeric.html +0 -61
- package/docs/modules/shutingyard.html +0 -75
- package/docs/types/algebra_monom.literalType.html +0 -61
- package/docs/types/algebra_polynom.PolynomParsingType.html +0 -56
- package/docs/types/coefficients_fraction.FractionParsingType.html +0 -56
- package/docs/types/shutingyard.Token.html +0 -63
- package/docs/types/shutingyard.tokenType.html +0 -68
- package/docs/variables/shutingyard.tokenConstant.html +0 -61
- package/index.html +0 -15
- package/public/demo/exercises.html +0 -283
- package/public/demo/matrices.html +0 -39
- package/public/demo/playground.html +0 -20
- package/public/demo.css +0 -3
- package/src/demo/exercises.ts +0 -0
- package/src/demo/matrices.ts +0 -61
- package/src/demo/playground.ts +0 -153
- package/src/main.ts +0 -42
- package/src/maths/algebra/equation.ts +0 -897
- package/src/maths/algebra/linearSystem.ts +0 -370
- package/src/maths/algebra/logicalset.ts +0 -183
- package/src/maths/algebra/monom.ts +0 -1028
- package/src/maths/algebra/polynom.ts +0 -1537
- package/src/maths/algebra/rational.ts +0 -244
- package/src/maths/algebra/study/rationalStudy.ts +0 -287
- package/src/maths/algebra/study.ts +0 -506
- package/src/maths/coefficients/fraction.ts +0 -593
- package/src/maths/coefficients/nthRoot.ts +0 -148
- package/src/maths/geometry/circle.ts +0 -382
- package/src/maths/geometry/line.ts +0 -604
- package/src/maths/geometry/point.ts +0 -215
- package/src/maths/geometry/triangle.ts +0 -368
- package/src/maths/geometry/vector.ts +0 -242
- package/src/maths/numeric.ts +0 -162
- package/src/maths/numexp.ts +0 -184
- package/src/maths/randomization/random.ts +0 -80
- package/src/maths/randomization/randomCore.ts +0 -19
- package/src/maths/randomization/rndFraction.ts +0 -47
- package/src/maths/randomization/rndGeometryCircle.ts +0 -50
- package/src/maths/randomization/rndGeometryLine.ts +0 -53
- package/src/maths/randomization/rndGeometryPoint.ts +0 -69
- package/src/maths/randomization/rndHelpers.ts +0 -107
- package/src/maths/randomization/rndMonom.ts +0 -57
- package/src/maths/randomization/rndPolynom.ts +0 -90
- package/src/maths/randomization/rndTypes.ts +0 -43
- package/src/maths/shutingyard.ts +0 -496
- package/tests/algebra/equation.test.ts +0 -64
- package/tests/algebra/linear.test.ts +0 -58
- package/tests/algebra/monom.test.ts +0 -78
- package/tests/algebra/polynom.test.ts +0 -343
- package/tests/algebra/rationnal.test.ts +0 -64
- package/tests/algebra/study.test.ts +0 -48
- package/tests/coefficients/fraction.test.ts +0 -131
- package/tests/custom.test.ts +0 -33
- package/tests/geometry/circle.test.ts +0 -404
- package/tests/geometry/line.test.ts +0 -36
- package/tests/numeric.test.ts +0 -43
- package/tests/numexp.test.ts +0 -89
- package/tests/shutingyard.test.ts +0 -58
- package/tsconfig.json +0 -52
- package/tsconfig.testing.json +0 -28
- package/typedoc.katex.js +0 -11
- package/vite.config.js +0 -23
- package/webpack-production-min.config.js +0 -26
- package/webpack-production.config.js +0 -26
- package/webpack.config.js +0 -26
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Polynom } from './polynom';
|
|
2
|
+
import { ISolution } from './equation';
|
|
3
|
+
import { Rational } from './rational';
|
|
4
|
+
|
|
5
|
+
export type StudyableFunction = Rational;
|
|
6
|
+
export declare enum ZEROTYPE {
|
|
7
|
+
ZERO = "z",
|
|
8
|
+
DEFENCE = "d",
|
|
9
|
+
NOTHING = "t"
|
|
10
|
+
}
|
|
11
|
+
export interface IZero extends ISolution {
|
|
12
|
+
extrema: FUNCTION_EXTREMA;
|
|
13
|
+
type: ZEROTYPE;
|
|
14
|
+
}
|
|
15
|
+
export declare enum ASYMPTOTE {
|
|
16
|
+
VERTICAL = "av",
|
|
17
|
+
HORIZONTAL = "ah",
|
|
18
|
+
SLOPE = "ao",
|
|
19
|
+
HOLE = "hole"
|
|
20
|
+
}
|
|
21
|
+
export declare enum ASYMPTOTE_POSITION {
|
|
22
|
+
"LT" = "LT",
|
|
23
|
+
"RT" = "RT",
|
|
24
|
+
"LB" = "LB",
|
|
25
|
+
"RB" = "RB"
|
|
26
|
+
}
|
|
27
|
+
export interface IAsymptote {
|
|
28
|
+
deltaX: StudyableFunction;
|
|
29
|
+
display: string;
|
|
30
|
+
fx: Polynom;
|
|
31
|
+
limits: string;
|
|
32
|
+
position: ASYMPTOTE_POSITION[];
|
|
33
|
+
tableOfSign: ITableOfSigns;
|
|
34
|
+
tex: string;
|
|
35
|
+
type: ASYMPTOTE;
|
|
36
|
+
zero: IZero;
|
|
37
|
+
}
|
|
38
|
+
export declare enum FUNCTION_EXTREMA {
|
|
39
|
+
MIN = "min",
|
|
40
|
+
MAX = "max",
|
|
41
|
+
FLAT = "flat",
|
|
42
|
+
NOTHING = ""
|
|
43
|
+
}
|
|
44
|
+
export interface IExtrema {
|
|
45
|
+
tex: {
|
|
46
|
+
x: string;
|
|
47
|
+
y: string;
|
|
48
|
+
};
|
|
49
|
+
type: FUNCTION_EXTREMA;
|
|
50
|
+
value: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface ITableOfSigns {
|
|
56
|
+
extremes: {
|
|
57
|
+
[Key: string]: IExtrema;
|
|
58
|
+
};
|
|
59
|
+
factors: Polynom[];
|
|
60
|
+
fx: StudyableFunction;
|
|
61
|
+
signs: (string[])[];
|
|
62
|
+
tex: string;
|
|
63
|
+
type: TABLE_OF_SIGNS;
|
|
64
|
+
zeroes: IZero[];
|
|
65
|
+
}
|
|
66
|
+
export declare enum TABLE_OF_SIGNS {
|
|
67
|
+
SIGNS = "signs",
|
|
68
|
+
GROWS = "grows",
|
|
69
|
+
VARIATIONS = "variatins"
|
|
70
|
+
}
|
|
71
|
+
export interface StudyConfig {
|
|
72
|
+
asymptotes?: boolean;
|
|
73
|
+
derivative?: boolean;
|
|
74
|
+
domain?: boolean;
|
|
75
|
+
name?: string;
|
|
76
|
+
variable?: string;
|
|
77
|
+
signs?: boolean;
|
|
78
|
+
variations?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The study class is a "function study" class that will get:
|
|
82
|
+
* fx : get the function
|
|
83
|
+
* domain : string
|
|
84
|
+
* zeroes : Object (tex, IZero)
|
|
85
|
+
* signs : table of signs + tex output using tkz-tab
|
|
86
|
+
* av : vertical asymptotic
|
|
87
|
+
* ah : horizontal asymptotic
|
|
88
|
+
* ao : obliques
|
|
89
|
+
* deltaX : position relative
|
|
90
|
+
* dx : derivative
|
|
91
|
+
* grows : growing table + tex output using tkz-tab
|
|
92
|
+
* ddx : dérivée seconde
|
|
93
|
+
* variations : variation table + tex output using tkz-tab
|
|
94
|
+
*/
|
|
95
|
+
export declare class Study {
|
|
96
|
+
fx: StudyableFunction;
|
|
97
|
+
private _asymptotes;
|
|
98
|
+
private _derivative;
|
|
99
|
+
private _signs;
|
|
100
|
+
private _variations;
|
|
101
|
+
private _zeroes;
|
|
102
|
+
private _config;
|
|
103
|
+
private _name;
|
|
104
|
+
constructor(fx: StudyableFunction, config?: StudyConfig | string);
|
|
105
|
+
get name(): string;
|
|
106
|
+
set name(value: string);
|
|
107
|
+
get config(): StudyConfig;
|
|
108
|
+
set config(value: StudyConfig);
|
|
109
|
+
get zeroes(): IZero[];
|
|
110
|
+
get domain(): string;
|
|
111
|
+
get signs(): ITableOfSigns;
|
|
112
|
+
get asymptotes(): IAsymptote[];
|
|
113
|
+
get derivative(): ITableOfSigns;
|
|
114
|
+
get texSigns(): string;
|
|
115
|
+
get texGrows(): string;
|
|
116
|
+
get texVariations(): string;
|
|
117
|
+
makeStudy: () => void;
|
|
118
|
+
indexOfZero: (zeroes: IZero[], zero: IZero | ISolution) => number;
|
|
119
|
+
makeOneLineForSigns: (factor: Polynom, zeroes: IZero[], zeroSign: ZEROTYPE) => string[];
|
|
120
|
+
makeSignsResult: (signs: (string[])[]) => string[];
|
|
121
|
+
makeGrowsResult: (tos: ITableOfSigns) => {
|
|
122
|
+
growsLine: string[];
|
|
123
|
+
extremes: {
|
|
124
|
+
[Key: string]: IExtrema;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
makeVariationsResult: (tos: ITableOfSigns) => {
|
|
128
|
+
varsLine: string[];
|
|
129
|
+
extremes: {
|
|
130
|
+
[Key: string]: IExtrema;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
makeZeroes(): IZero[];
|
|
134
|
+
makeSigns(): ITableOfSigns;
|
|
135
|
+
makeAsymptotes(): IAsymptote[];
|
|
136
|
+
makeDerivative(): ITableOfSigns;
|
|
137
|
+
makeVariation(): ITableOfSigns;
|
|
138
|
+
drawCode: () => string;
|
|
139
|
+
private _makeTexFromTableOfSigns;
|
|
140
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type FractionParsingType = number | string | Fraction;
|
|
2
|
+
/**
|
|
3
|
+
* The fraction class make possible to handle
|
|
4
|
+
* TODO: Write the documentation correctly.
|
|
5
|
+
* \\(\frac{a}{b}\\) or \\[\frac{a}{b}\\] values.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Fraction {
|
|
8
|
+
private _denominator;
|
|
9
|
+
private _numerator;
|
|
10
|
+
constructor(value?: unknown, denominatorOrPeriodic?: number);
|
|
11
|
+
get numerator(): number;
|
|
12
|
+
set numerator(value: number);
|
|
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;
|
|
29
|
+
/**
|
|
30
|
+
* Parse the value to get the numerator and denominator
|
|
31
|
+
* @param value : number or string to parse to get the fraction
|
|
32
|
+
* @param denominatorOrPeriodic (optional|number) : length of the periodic part: 2.333333 => 1 or denominator value
|
|
33
|
+
*/
|
|
34
|
+
parse: (value: unknown, denominatorOrPeriodic?: number) => Fraction;
|
|
35
|
+
clone: () => Fraction;
|
|
36
|
+
zero: () => Fraction;
|
|
37
|
+
one: () => Fraction;
|
|
38
|
+
infinite: () => Fraction;
|
|
39
|
+
invalid: () => Fraction;
|
|
40
|
+
opposed: () => Fraction;
|
|
41
|
+
add: (F: Fraction | number) => Fraction;
|
|
42
|
+
subtract: (F: Fraction | number) => Fraction;
|
|
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;
|
|
53
|
+
/**
|
|
54
|
+
* Compare the current coefficient with another coefficient
|
|
55
|
+
* @param F (Coefficient) The coefficient to compare
|
|
56
|
+
* @param sign (string| default is =): authorized values: =, <, <=, >, >= with some variations.
|
|
57
|
+
*/
|
|
58
|
+
compare: (F: unknown, sign?: string) => boolean;
|
|
59
|
+
lesser: (than: Fraction | number) => Boolean;
|
|
60
|
+
leq: (than: Fraction | number) => Boolean;
|
|
61
|
+
greater: (than: Fraction | number) => Boolean;
|
|
62
|
+
geq: (than: Fraction | number) => Boolean;
|
|
63
|
+
isEqual: (than: Fraction | number) => boolean;
|
|
64
|
+
isNotEqual: (than: Fraction | number) => boolean;
|
|
65
|
+
isOpposed: (p: Fraction) => boolean;
|
|
66
|
+
isInverted: (p: Fraction) => boolean;
|
|
67
|
+
isZero: () => boolean;
|
|
68
|
+
isNotZero: () => boolean;
|
|
69
|
+
isOne: () => boolean;
|
|
70
|
+
isNegativeOne: () => boolean;
|
|
71
|
+
isPositive: () => boolean;
|
|
72
|
+
isNegative: () => boolean;
|
|
73
|
+
isStrictlyPositive: () => boolean;
|
|
74
|
+
isStrictlyNegative: () => Boolean;
|
|
75
|
+
isNaN: () => boolean;
|
|
76
|
+
isInfinity: () => boolean;
|
|
77
|
+
isFinite: () => boolean;
|
|
78
|
+
isSquare: () => boolean;
|
|
79
|
+
isReduced: () => boolean;
|
|
80
|
+
isNatural: () => boolean;
|
|
81
|
+
isRelative: () => boolean;
|
|
82
|
+
isRational: () => boolean;
|
|
83
|
+
isEven: () => boolean;
|
|
84
|
+
isOdd: () => boolean;
|
|
85
|
+
sign: () => number;
|
|
86
|
+
/**
|
|
87
|
+
* Simple function to determine if it's a fraction
|
|
88
|
+
*/
|
|
89
|
+
areEquals: (...F: Fraction[]) => boolean;
|
|
90
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NthRoot is something like "a+b\sqrt{3}
|
|
3
|
+
*/
|
|
4
|
+
export declare class NthRoot {
|
|
5
|
+
private _radical;
|
|
6
|
+
private _nth;
|
|
7
|
+
private _coefficient;
|
|
8
|
+
private _isValid;
|
|
9
|
+
constructor(...values: number[]);
|
|
10
|
+
get radical(): number;
|
|
11
|
+
set radical(value: number);
|
|
12
|
+
get nth(): number;
|
|
13
|
+
set nth(value: number);
|
|
14
|
+
get coefficient(): number;
|
|
15
|
+
set coefficient(value: number);
|
|
16
|
+
get tex(): string;
|
|
17
|
+
get display(): string;
|
|
18
|
+
get value(): number;
|
|
19
|
+
parse: (radical: number, nthroot?: number, coefficient?: number) => NthRoot;
|
|
20
|
+
reduce: () => NthRoot;
|
|
21
|
+
multiply: (N: NthRoot) => NthRoot;
|
|
22
|
+
hasRadical: () => boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Equation } from '../algebra/equation';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Line } from './line';
|
|
4
|
+
import { Point } from './point';
|
|
5
|
+
|
|
6
|
+
export declare class Circle {
|
|
7
|
+
private _center;
|
|
8
|
+
private _squareRadius;
|
|
9
|
+
private _cartesian;
|
|
10
|
+
private _exists;
|
|
11
|
+
constructor(...values: unknown[]);
|
|
12
|
+
get center(): Point;
|
|
13
|
+
get squareRadius(): Fraction;
|
|
14
|
+
get cartesian(): Equation;
|
|
15
|
+
get exists(): boolean;
|
|
16
|
+
get radius(): {
|
|
17
|
+
tex: string;
|
|
18
|
+
display: string;
|
|
19
|
+
value: number;
|
|
20
|
+
};
|
|
21
|
+
get tex(): string;
|
|
22
|
+
get developed(): string;
|
|
23
|
+
get display(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the relative position between circle and line. It corresponds to the number of intersection.
|
|
26
|
+
* @param {Line} L
|
|
27
|
+
* @returns {number}
|
|
28
|
+
*/
|
|
29
|
+
relativePosition: (L: Line) => number;
|
|
30
|
+
lineIntersection: (L: Line) => Point[];
|
|
31
|
+
tangents: (P: Point | Fraction) => Line[];
|
|
32
|
+
isPointOnCircle: (P: Point) => Boolean;
|
|
33
|
+
getPointsOnCircle: (numberIsInteger?: boolean) => Point[];
|
|
34
|
+
clone(): Circle;
|
|
35
|
+
private _tangentsThroughOnePointOnTheCircle;
|
|
36
|
+
private _tangentsThroughOnePointOutsideTheCircle;
|
|
37
|
+
private _tangentsWithSlope;
|
|
38
|
+
private _reset;
|
|
39
|
+
private parse;
|
|
40
|
+
private _calculateCartesian;
|
|
41
|
+
private _parseCopyCircle;
|
|
42
|
+
private _parseCenterAndRadius;
|
|
43
|
+
private _parseCenterAndPointThrough;
|
|
44
|
+
private _parseEquation;
|
|
45
|
+
private _parseThroughtThreePoints;
|
|
46
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Equation } from '../algebra/equation';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
import { Point } from './point';
|
|
4
|
+
import { Vector } from './vector';
|
|
5
|
+
|
|
6
|
+
export declare enum LinePropriety {
|
|
7
|
+
None = 0,
|
|
8
|
+
Parallel = "parallel",
|
|
9
|
+
Perpendicular = "perpendicular",
|
|
10
|
+
Tangent = "tangent"
|
|
11
|
+
}
|
|
12
|
+
export declare class Line {
|
|
13
|
+
static PERPENDICULAR: LinePropriety;
|
|
14
|
+
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
|
+
/**
|
|
26
|
+
* Value can be a mix of:
|
|
27
|
+
*
|
|
28
|
+
* @param values
|
|
29
|
+
*/
|
|
30
|
+
constructor(...values: unknown[]);
|
|
31
|
+
get a(): Fraction;
|
|
32
|
+
set a(value: Fraction);
|
|
33
|
+
get b(): Fraction;
|
|
34
|
+
set b(value: Fraction);
|
|
35
|
+
get c(): Fraction;
|
|
36
|
+
set c(value: Fraction);
|
|
37
|
+
get OA(): Point;
|
|
38
|
+
set OA(value: Point);
|
|
39
|
+
get d(): Vector;
|
|
40
|
+
set d(value: Vector);
|
|
41
|
+
get n(): Vector;
|
|
42
|
+
get exists(): boolean;
|
|
43
|
+
get equation(): Equation;
|
|
44
|
+
get system(): {
|
|
45
|
+
x: Equation;
|
|
46
|
+
y: Equation;
|
|
47
|
+
};
|
|
48
|
+
get tex(): {
|
|
49
|
+
canonical: string;
|
|
50
|
+
mxh: string;
|
|
51
|
+
parametric: string;
|
|
52
|
+
equation: string;
|
|
53
|
+
system: string;
|
|
54
|
+
};
|
|
55
|
+
get reduceBeforeDisplay(): boolean;
|
|
56
|
+
set reduceBeforeDisplay(value: boolean);
|
|
57
|
+
get display(): {
|
|
58
|
+
canonical: string;
|
|
59
|
+
mxh: string;
|
|
60
|
+
parametric: string;
|
|
61
|
+
};
|
|
62
|
+
get normal(): Vector;
|
|
63
|
+
get director(): Vector;
|
|
64
|
+
get slope(): Fraction;
|
|
65
|
+
get height(): Fraction;
|
|
66
|
+
randomPoint: (k?: number) => Point;
|
|
67
|
+
randomNearPoint: (k?: number) => Point;
|
|
68
|
+
/**
|
|
69
|
+
* Parse data to a line
|
|
70
|
+
* @param {any} values
|
|
71
|
+
* @returns {Line}
|
|
72
|
+
*/
|
|
73
|
+
parse: (...values: unknown[]) => Line;
|
|
74
|
+
parseEquation: (equ: Equation) => Line;
|
|
75
|
+
parseByCoefficient: (a: Fraction | number, b: Fraction | number, c: Fraction | number) => Line;
|
|
76
|
+
parseByPointAndVector: (P: Point, d: Vector) => Line;
|
|
77
|
+
parseByPointAndNormal: (P: Point, n: Vector) => Line;
|
|
78
|
+
parseByPointAndLine: (P: Point, L: Line, orientation?: LinePropriety) => Line;
|
|
79
|
+
clone: () => Line;
|
|
80
|
+
isOnLine: (pt: Point) => Boolean;
|
|
81
|
+
isParallelTo: (line: Line) => Boolean;
|
|
82
|
+
isSameAs: (line: Line) => Boolean;
|
|
83
|
+
isPerpendicularTo: (line: Line) => Boolean;
|
|
84
|
+
isVertical: () => Boolean;
|
|
85
|
+
simplify: () => Line;
|
|
86
|
+
simplifyDirection: () => Line;
|
|
87
|
+
intersection: (line: Line) => {
|
|
88
|
+
point: Point;
|
|
89
|
+
hasIntersection: boolean;
|
|
90
|
+
isParallel: boolean;
|
|
91
|
+
isSame: boolean;
|
|
92
|
+
};
|
|
93
|
+
distanceTo(pt: Point): {
|
|
94
|
+
value: number;
|
|
95
|
+
fraction: Fraction;
|
|
96
|
+
tex: string;
|
|
97
|
+
};
|
|
98
|
+
hitSegment(A: Point, B: Point): boolean;
|
|
99
|
+
getValueAtX: (value: Fraction | number) => Fraction;
|
|
100
|
+
getValueAtY: (value: Fraction | number) => Fraction;
|
|
101
|
+
canonicalAsFloatCoefficient(decimals: number): string;
|
|
102
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
import { Line } from './line';
|
|
4
|
+
|
|
5
|
+
export declare class Point {
|
|
6
|
+
private _x;
|
|
7
|
+
private _y;
|
|
8
|
+
private _exist;
|
|
9
|
+
constructor(...values: unknown[]);
|
|
10
|
+
get x(): Fraction;
|
|
11
|
+
set x(value: Fraction);
|
|
12
|
+
get y(): Fraction;
|
|
13
|
+
set y(value: Fraction);
|
|
14
|
+
get tex(): string;
|
|
15
|
+
get display(): string;
|
|
16
|
+
get asVector(): Vector;
|
|
17
|
+
get key(): string;
|
|
18
|
+
static pmatrix: (a: any, b: any, c?: any) => string;
|
|
19
|
+
parse: (...values: unknown[]) => Point;
|
|
20
|
+
clone: () => Point;
|
|
21
|
+
zero: () => Point;
|
|
22
|
+
origin: () => Point;
|
|
23
|
+
middleOf: (P1: Point, P2: Point) => Point;
|
|
24
|
+
translate: (value: {
|
|
25
|
+
x: number | Fraction;
|
|
26
|
+
y: number | Fraction;
|
|
27
|
+
}) => Point;
|
|
28
|
+
texValues: (numberOfDigits: number) => string;
|
|
29
|
+
distanceTo: (item: Point | Line) => {
|
|
30
|
+
value: number;
|
|
31
|
+
fraction: Fraction;
|
|
32
|
+
tex: string;
|
|
33
|
+
};
|
|
34
|
+
isInListOfPoints: (list: Point[]) => boolean;
|
|
35
|
+
isEqual: (pt: Point) => boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Line } from './line';
|
|
2
|
+
import { Vector } from './vector';
|
|
3
|
+
import { Point } from './point';
|
|
4
|
+
|
|
5
|
+
export interface remarquableLines {
|
|
6
|
+
'medians': {
|
|
7
|
+
'A': Line;
|
|
8
|
+
'B': Line;
|
|
9
|
+
'C': Line;
|
|
10
|
+
'intersection': Point;
|
|
11
|
+
};
|
|
12
|
+
'mediators': {
|
|
13
|
+
'AB': Line;
|
|
14
|
+
'AC': Line;
|
|
15
|
+
'BC': Line;
|
|
16
|
+
'intersection': Point;
|
|
17
|
+
};
|
|
18
|
+
'heights': {
|
|
19
|
+
'A': Line;
|
|
20
|
+
'B': Line;
|
|
21
|
+
'C': Line;
|
|
22
|
+
'intersection': Point;
|
|
23
|
+
};
|
|
24
|
+
'bisectors': {
|
|
25
|
+
'A': Line;
|
|
26
|
+
'B': Line;
|
|
27
|
+
'C': Line;
|
|
28
|
+
'intersection': Point;
|
|
29
|
+
};
|
|
30
|
+
externalBisectors: {
|
|
31
|
+
'A': Line;
|
|
32
|
+
'B': Line;
|
|
33
|
+
'C': Line;
|
|
34
|
+
'intersection': Point;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare class Triangle {
|
|
38
|
+
private _A;
|
|
39
|
+
private _B;
|
|
40
|
+
private _C;
|
|
41
|
+
private _lines;
|
|
42
|
+
private _middles;
|
|
43
|
+
private _remarquables;
|
|
44
|
+
constructor(...values: unknown[]);
|
|
45
|
+
get A(): Point;
|
|
46
|
+
get B(): Point;
|
|
47
|
+
get C(): Point;
|
|
48
|
+
get AB(): Vector;
|
|
49
|
+
get BA(): Vector;
|
|
50
|
+
get BC(): Vector;
|
|
51
|
+
get CB(): Vector;
|
|
52
|
+
get AC(): Vector;
|
|
53
|
+
get CA(): Vector;
|
|
54
|
+
get isRectangle(): boolean;
|
|
55
|
+
get isEquilateral(): boolean;
|
|
56
|
+
get isIsocele(): boolean;
|
|
57
|
+
get lines(): {
|
|
58
|
+
'AB': Line;
|
|
59
|
+
'BC': Line;
|
|
60
|
+
'AC': Line;
|
|
61
|
+
};
|
|
62
|
+
get remarquables(): remarquableLines;
|
|
63
|
+
/**
|
|
64
|
+
* Parse values to a triangle. Supported formats:
|
|
65
|
+
* Point, Point, Point
|
|
66
|
+
* x1, y1, x2, y2, x3, y3
|
|
67
|
+
* TODO: Something else ?
|
|
68
|
+
* @param values
|
|
69
|
+
*/
|
|
70
|
+
parse: (...values: any) => Triangle;
|
|
71
|
+
/**
|
|
72
|
+
* Clone the Triangle class
|
|
73
|
+
*/
|
|
74
|
+
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
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Point } from './point';
|
|
2
|
+
import { Fraction } from '../coefficients/fraction';
|
|
3
|
+
|
|
4
|
+
export declare class Vector {
|
|
5
|
+
private _x;
|
|
6
|
+
private _y;
|
|
7
|
+
constructor(...values: unknown[]);
|
|
8
|
+
get x(): Fraction;
|
|
9
|
+
set x(value: Fraction | number | string);
|
|
10
|
+
get y(): Fraction;
|
|
11
|
+
set y(value: Fraction | number | string);
|
|
12
|
+
get normSquare(): Fraction;
|
|
13
|
+
get norm(): number;
|
|
14
|
+
get tex(): string;
|
|
15
|
+
get asPoint(): Point;
|
|
16
|
+
get isNull(): boolean;
|
|
17
|
+
static scalarProduct: (v1: Vector, v2: Vector) => Fraction;
|
|
18
|
+
static determinant: (v1: Vector, v2: Vector) => Fraction;
|
|
19
|
+
parse: (...values: any) => Vector;
|
|
20
|
+
clone: () => Vector;
|
|
21
|
+
reset: () => Vector;
|
|
22
|
+
zero: () => Vector;
|
|
23
|
+
one: () => Vector;
|
|
24
|
+
opposed: () => Vector;
|
|
25
|
+
add: (V: Vector) => Vector;
|
|
26
|
+
subtract: (V: Vector) => Vector;
|
|
27
|
+
scalarProductWithVector: (V: Vector) => Fraction;
|
|
28
|
+
determinantWithVector: (V: Vector) => Fraction;
|
|
29
|
+
normal: () => Vector;
|
|
30
|
+
isColinearTo: (v: Vector) => boolean;
|
|
31
|
+
isNormalTo: (v: Vector) => boolean;
|
|
32
|
+
multiplyByScalar: (k: any) => Vector;
|
|
33
|
+
divideByScalar: (k: any) => Vector;
|
|
34
|
+
simplify: () => Vector;
|
|
35
|
+
simplifyDirection: () => Vector;
|
|
36
|
+
angleWith: (V: Vector, sharp?: Boolean, radian?: Boolean) => number;
|
|
37
|
+
private _parseString;
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class Numeric {
|
|
2
|
+
static round(value: number, decimals?: number): number;
|
|
3
|
+
/**
|
|
4
|
+
* Get the list of the nth first prime numbers.
|
|
5
|
+
* @param nb : number of primes to choose from
|
|
6
|
+
*/
|
|
7
|
+
static primes(nb?: number): number[];
|
|
8
|
+
/**
|
|
9
|
+
* Get the list of all dividers of a number.
|
|
10
|
+
* @param value
|
|
11
|
+
*/
|
|
12
|
+
static dividers(value: number): number[];
|
|
13
|
+
/**
|
|
14
|
+
* Great Common Divisor
|
|
15
|
+
* @param values : number values
|
|
16
|
+
*/
|
|
17
|
+
static gcd(...values: number[]): number;
|
|
18
|
+
static divideNumbersByGCD(...values: number[]): number[];
|
|
19
|
+
/**
|
|
20
|
+
* Least Common Multiple
|
|
21
|
+
* @param values: list of numbers
|
|
22
|
+
*/
|
|
23
|
+
static lcm(...values: number[]): number;
|
|
24
|
+
static pythagoricianTripletsWithTarget(target: number, targetIsSquare?: boolean): number[][];
|
|
25
|
+
static numberCorrection(value: number, epsilonDigit?: number, epsilonNumberOfDigits?: number, number_of_digits?: number): number;
|
|
26
|
+
static periodic(value: number): number;
|
|
27
|
+
static decompose(value: number): number[][];
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class NumExp {
|
|
2
|
+
private _rpn;
|
|
3
|
+
private _expression;
|
|
4
|
+
private _isValid;
|
|
5
|
+
constructor(value: string, uniformize?: boolean);
|
|
6
|
+
get rpn(): {
|
|
7
|
+
token: string;
|
|
8
|
+
tokenType: string;
|
|
9
|
+
}[];
|
|
10
|
+
get isValid(): boolean;
|
|
11
|
+
set isValid(value: boolean);
|
|
12
|
+
get expression(): string;
|
|
13
|
+
evaluate(values?: {
|
|
14
|
+
[Key: string]: number;
|
|
15
|
+
}): number;
|
|
16
|
+
private _extractDecimalPart;
|
|
17
|
+
private _numberCorrection;
|
|
18
|
+
private _addToStack;
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Circle } from '../geometry/circle';
|
|
2
|
+
import { Point } from '../geometry/point';
|
|
3
|
+
import { Line } from '../geometry/line';
|
|
4
|
+
import { Fraction } from '../coefficients/fraction';
|
|
5
|
+
import { Monom } from '../algebra/monom';
|
|
6
|
+
import { Polynom } from '../algebra/polynom';
|
|
7
|
+
import { randomCoefficientConfig, randomGeometryCircleConfig, randomGeometryLineConfig, randomGeometryPointConfig, randomMonomConfig, randomPolynomConfig } from './rndTypes';
|
|
8
|
+
|
|
9
|
+
export * from './rndTypes';
|
|
10
|
+
export declare namespace Random {
|
|
11
|
+
function polynom(config?: randomPolynomConfig): Polynom;
|
|
12
|
+
function monom(config?: randomMonomConfig): Monom;
|
|
13
|
+
function fraction(config?: randomCoefficientConfig): Fraction;
|
|
14
|
+
function number(from: number, to: number, exclude?: number[]): number;
|
|
15
|
+
function numberSym(max: number, allowZero?: boolean): number;
|
|
16
|
+
function prime(max: number): number;
|
|
17
|
+
function bool(percent?: number): boolean;
|
|
18
|
+
function array(arr: any[], number?: number): any[];
|
|
19
|
+
function item(arr: any[]): any;
|
|
20
|
+
function shuffle(arr: any[]): any[];
|
|
21
|
+
namespace Geometry {
|
|
22
|
+
function line(config?: randomGeometryLineConfig): Line;
|
|
23
|
+
function point(config?: randomGeometryPointConfig): Point;
|
|
24
|
+
function circle(config?: randomGeometryCircleConfig): Circle;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Fraction } from '../coefficients/fraction';
|
|
2
|
+
import { randomCoefficientConfig } from './rndTypes';
|
|
3
|
+
import { randomCore } from './randomCore';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a random monom based on a based configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare class rndFraction extends randomCore {
|
|
9
|
+
protected _config: randomCoefficientConfig;
|
|
10
|
+
protected _defaultConfig: randomCoefficientConfig;
|
|
11
|
+
constructor(userConfig?: randomCoefficientConfig);
|
|
12
|
+
generate: () => Fraction;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Circle } from '../geometry/circle';
|
|
2
|
+
import { randomGeometryCircleConfig } from './random';
|
|
3
|
+
import { randomCore } from './randomCore';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a random monom based on a based configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare class rndGeometryCircle extends randomCore {
|
|
9
|
+
protected _config: randomGeometryCircleConfig;
|
|
10
|
+
protected _defaultConfig: randomGeometryCircleConfig;
|
|
11
|
+
generate: () => Circle;
|
|
12
|
+
constructor(userConfig?: randomGeometryCircleConfig);
|
|
13
|
+
}
|