pimath 0.1.39 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pimath.js +3127 -2865
- package/dist/pimath.js.map +1 -1
- package/package.json +16 -12
- package/src/algebra/equation.ts +558 -0
- package/src/algebra/equationSolver.ts +488 -0
- package/src/algebra/factor.ts +338 -0
- package/src/algebra/index.ts +11 -0
- package/src/algebra/linearSystem.ts +439 -0
- package/src/algebra/logicalset.ts +255 -0
- package/src/algebra/matrix.ts +474 -0
- package/src/algebra/monom.ts +977 -0
- package/src/algebra/operations.ts +23 -0
- package/src/algebra/polyFactor.ts +668 -0
- package/src/algebra/polynom.ts +1247 -0
- package/src/analyze/index.ts +4 -0
- package/src/analyze/solution.ts +178 -0
- package/src/analyze/tableOfSigns.ts +30 -0
- package/src/coefficients/fraction.ts +718 -0
- package/src/coefficients/index.ts +4 -0
- package/src/coefficients/root.ts +346 -0
- package/src/geometry/TupleN.ts +128 -0
- package/src/geometry/circle.ts +456 -0
- package/src/geometry/geomMath.ts +71 -0
- package/src/geometry/index.ts +11 -0
- package/src/geometry/line.ts +653 -0
- package/src/geometry/line3.ts +211 -0
- package/src/geometry/plane3.ts +179 -0
- package/src/geometry/point.ts +104 -0
- package/src/geometry/sphere3.ts +214 -0
- package/src/geometry/triangle.ts +482 -0
- package/src/geometry/vector.ts +225 -0
- package/src/helpers.ts +35 -0
- package/src/index.ts +61 -0
- package/src/numeric.ts +196 -0
- package/src/pimath.interface.ts +162 -0
- package/src/randomization/algebra/rndEquation.ts +41 -0
- package/src/randomization/algebra/rndMonom.ts +39 -0
- package/src/randomization/algebra/rndPolynom.ts +100 -0
- package/src/randomization/coefficient/rndFraction.ts +38 -0
- package/src/randomization/geometry/rndCircle.ts +27 -0
- package/src/randomization/geometry/rndLine.ts +35 -0
- package/src/randomization/geometry/rndLine3.ts +27 -0
- package/src/randomization/geometry/rndVector.ts +63 -0
- package/src/randomization/random.ts +89 -0
- package/src/randomization/rndHelpers.ts +102 -0
- package/src/randomization/rndTypes.ts +67 -0
- package/types/algebra/equation.d.ts +18 -17
- package/types/algebra/equation.d.ts.map +1 -1
- package/types/algebra/equationSolver.d.ts +7 -3
- package/types/algebra/equationSolver.d.ts.map +1 -1
- package/types/algebra/factor.d.ts +1 -1
- package/types/algebra/factor.d.ts.map +1 -1
- package/types/algebra/linearSystem.d.ts +23 -6
- package/types/algebra/linearSystem.d.ts.map +1 -1
- package/types/algebra/logicalset.d.ts +1 -1
- package/types/algebra/logicalset.d.ts.map +1 -1
- package/types/algebra/monom.d.ts +1 -6
- package/types/algebra/monom.d.ts.map +1 -1
- package/types/algebra/operations.d.ts.map +1 -1
- package/types/algebra/polyFactor.d.ts +9 -4
- package/types/algebra/polyFactor.d.ts.map +1 -1
- package/types/algebra/polynom.d.ts +10 -7
- package/types/algebra/polynom.d.ts.map +1 -1
- package/types/analyze/index.d.ts +2 -0
- package/types/analyze/index.d.ts.map +1 -0
- package/types/analyze/solution.d.ts +27 -0
- package/types/analyze/solution.d.ts.map +1 -0
- package/types/analyze/tableOfSigns.d.ts +9 -0
- package/types/analyze/tableOfSigns.d.ts.map +1 -0
- package/types/coefficients/fraction.d.ts +14 -12
- package/types/coefficients/fraction.d.ts.map +1 -1
- package/types/coefficients/index.d.ts +1 -1
- package/types/coefficients/index.d.ts.map +1 -1
- package/types/coefficients/root.d.ts +41 -0
- package/types/coefficients/root.d.ts.map +1 -0
- package/types/geometry/TupleAbstract.d.ts +22 -0
- package/types/geometry/TupleAbstract.d.ts.map +1 -0
- package/types/geometry/TupleN.d.ts +24 -0
- package/types/geometry/TupleN.d.ts.map +1 -0
- package/types/geometry/circle.d.ts +26 -17
- package/types/geometry/circle.d.ts.map +1 -1
- package/types/geometry/geomMath.d.ts +2 -1
- package/types/geometry/geomMath.d.ts.map +1 -1
- package/types/geometry/index.d.ts.map +1 -1
- package/types/geometry/line.d.ts +21 -30
- package/types/geometry/line.d.ts.map +1 -1
- package/types/geometry/line3.d.ts +19 -19
- package/types/geometry/line3.d.ts.map +1 -1
- package/types/geometry/matrix.d.ts +11 -11
- package/types/geometry/plane3.d.ts +9 -9
- package/types/geometry/plane3.d.ts.map +1 -1
- package/types/geometry/point.d.ts +12 -7
- package/types/geometry/point.d.ts.map +1 -1
- package/types/geometry/triangle.d.ts +68 -23
- package/types/geometry/triangle.d.ts.map +1 -1
- package/types/geometry/vector.d.ts +24 -44
- package/types/geometry/vector.d.ts.map +1 -1
- package/types/helpers.d.ts +1 -0
- package/types/helpers.d.ts.map +1 -1
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +1 -1
- package/types/numeric.d.ts +2 -0
- package/types/numeric.d.ts.map +1 -1
- package/types/pimath.interface.d.ts +38 -44
- package/types/pimath.interface.d.ts.map +1 -1
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -1
- package/types/randomization/coefficient/rndFraction.d.ts +1 -1
- package/types/randomization/coefficient/rndFraction.d.ts.map +1 -1
- package/types/randomization/geometry/rndLine.d.ts.map +1 -1
- package/types/randomization/random.d.ts +3 -2
- package/types/randomization/random.d.ts.map +1 -1
- package/types/randomization/rndTypes.d.ts +15 -10
- package/types/randomization/rndTypes.d.ts.map +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Circle } from "../../geometry/circle"
|
|
2
|
+
import { randomInt } from "../rndHelpers"
|
|
3
|
+
import type { randomGeometryCircleConfig } from "../rndTypes"
|
|
4
|
+
import { rndVector } from "./rndVector"
|
|
5
|
+
|
|
6
|
+
export function rndCircle(userConfig?: randomGeometryCircleConfig): Circle {
|
|
7
|
+
const config = Object.assign(
|
|
8
|
+
{
|
|
9
|
+
center: {
|
|
10
|
+
x: { min: -10, max: 10 },
|
|
11
|
+
y: { min: -10, max: 10 }
|
|
12
|
+
},
|
|
13
|
+
pointsOnCircle: 8
|
|
14
|
+
}, userConfig)
|
|
15
|
+
|
|
16
|
+
const center = rndVector(config.center)
|
|
17
|
+
|
|
18
|
+
let rv, r
|
|
19
|
+
if (config.pointsOnCircle === 8) {
|
|
20
|
+
rv = randomInt(1, 3),
|
|
21
|
+
r = rv ** 2 + (rv + 1) ** 2
|
|
22
|
+
} else {
|
|
23
|
+
r = randomInt(1, 20)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new Circle(center, r, true)
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {Line} from "../../geometry/line"
|
|
2
|
+
import {Vector} from "../../geometry/vector"
|
|
3
|
+
import {randomIntSym} from "../rndHelpers"
|
|
4
|
+
import type {randomGeometryLineConfig} from "../rndTypes"
|
|
5
|
+
|
|
6
|
+
export function rndLine(userConfig?: randomGeometryLineConfig): Line {
|
|
7
|
+
const config = Object.assign(
|
|
8
|
+
{
|
|
9
|
+
A: {
|
|
10
|
+
x: randomIntSym(10),
|
|
11
|
+
y: randomIntSym(10)
|
|
12
|
+
},
|
|
13
|
+
}, userConfig)
|
|
14
|
+
|
|
15
|
+
// The A point exists.
|
|
16
|
+
const d = new Vector(0, 0)
|
|
17
|
+
|
|
18
|
+
while (d.isNull) {
|
|
19
|
+
d.x = randomIntSym(10, config.allow?.vertical ?? true)
|
|
20
|
+
d.y = randomIntSym(10, config.allow?.horizontal ?? true)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// slope === 1 => slope must be positive
|
|
24
|
+
if (config.slope === 1) {
|
|
25
|
+
if (d.x.sign() !== d.y.sign()) {
|
|
26
|
+
d.y.opposite()
|
|
27
|
+
}
|
|
28
|
+
} else if (config.slope === -1) {
|
|
29
|
+
if (d.x.sign() !== d.y.sign()) {
|
|
30
|
+
d.y.opposite()
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return new Line().fromPointAndDirection(new Vector(config.A.x, config.A.y), d)
|
|
35
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Line3 } from "../../geometry/line3"
|
|
2
|
+
import { Point } from "../../geometry/point"
|
|
3
|
+
import { Vector } from "../../geometry/vector"
|
|
4
|
+
import { randomIntSym } from "../rndHelpers"
|
|
5
|
+
import type { randomGeometryLine3Config } from "../rndTypes"
|
|
6
|
+
|
|
7
|
+
export function rndLine3(userConfig?: randomGeometryLine3Config): Line3 {
|
|
8
|
+
const config = Object.assign(
|
|
9
|
+
{
|
|
10
|
+
A: {
|
|
11
|
+
x: randomIntSym(10),
|
|
12
|
+
y: randomIntSym(10),
|
|
13
|
+
z: randomIntSym(10)
|
|
14
|
+
},
|
|
15
|
+
direction: {
|
|
16
|
+
x: randomIntSym(10),
|
|
17
|
+
y: randomIntSym(10),
|
|
18
|
+
z: randomIntSym(10)
|
|
19
|
+
}
|
|
20
|
+
}, userConfig)
|
|
21
|
+
|
|
22
|
+
// The direction vector exists.
|
|
23
|
+
const A = new Point(config.A.x, config.A.y, config.A.z)
|
|
24
|
+
const d = new Vector(config.direction.x, config.direction.y, config.direction.z)
|
|
25
|
+
|
|
26
|
+
return new Line3(A, d)
|
|
27
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Fraction } from "../../coefficients/fraction"
|
|
2
|
+
import type { randomGeometryPointConfig } from "../rndTypes"
|
|
3
|
+
import { rndFraction } from "../coefficient/rndFraction"
|
|
4
|
+
import { randomIntSym } from "../rndHelpers"
|
|
5
|
+
import { Point } from "../../geometry/point"
|
|
6
|
+
|
|
7
|
+
export function rndVector(userConfig?: randomGeometryPointConfig): Point {
|
|
8
|
+
const config: {
|
|
9
|
+
axis: 'x' | 'y' | 'z' | null,
|
|
10
|
+
fraction: boolean,
|
|
11
|
+
max: number,
|
|
12
|
+
quadrant: number | null
|
|
13
|
+
} = Object.assign(
|
|
14
|
+
{
|
|
15
|
+
axis: true,
|
|
16
|
+
fraction: false,
|
|
17
|
+
max: 10,
|
|
18
|
+
quadrant: null
|
|
19
|
+
}, userConfig)
|
|
20
|
+
|
|
21
|
+
const zeroX = config.axis === 'x',
|
|
22
|
+
zeroY = config.axis === 'y'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const x = config.fraction ?
|
|
26
|
+
rndFraction({ max: config.max, zero: zeroX }) :
|
|
27
|
+
new Fraction(randomIntSym(config.max, zeroX))
|
|
28
|
+
|
|
29
|
+
const y = config.fraction ?
|
|
30
|
+
rndFraction({ max: config.max, zero: zeroY }) :
|
|
31
|
+
new Fraction(randomIntSym(config.max, zeroY))
|
|
32
|
+
|
|
33
|
+
if (Number(config.quadrant) === 1) {
|
|
34
|
+
x.abs()
|
|
35
|
+
y.abs()
|
|
36
|
+
}
|
|
37
|
+
if (Number(config.quadrant) === 2) {
|
|
38
|
+
if (x.isPositive()) {
|
|
39
|
+
x.opposite()
|
|
40
|
+
}
|
|
41
|
+
if (y.isNegative()) {
|
|
42
|
+
y.opposite()
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (Number(config.quadrant) === 3) {
|
|
46
|
+
if (x.isPositive()) {
|
|
47
|
+
x.opposite()
|
|
48
|
+
}
|
|
49
|
+
if (y.isPositive()) {
|
|
50
|
+
y.opposite()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (Number(config.quadrant) === 4) {
|
|
54
|
+
if (x.isNegative()) {
|
|
55
|
+
x.opposite()
|
|
56
|
+
}
|
|
57
|
+
if (y.isPositive()) {
|
|
58
|
+
y.opposite()
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return new Point(x, y)
|
|
63
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
randomCoefficientConfig,
|
|
3
|
+
randomEquationConfig,
|
|
4
|
+
randomGeometryCircleConfig,
|
|
5
|
+
randomGeometryLine3Config,
|
|
6
|
+
randomGeometryLineConfig,
|
|
7
|
+
randomGeometryPointConfig,
|
|
8
|
+
randomMonomConfig,
|
|
9
|
+
randomPolynomConfig
|
|
10
|
+
} from "./rndTypes"
|
|
11
|
+
|
|
12
|
+
import {randomArray, randomBool, randomInt, randomIntSym, randomItem, randomPrime, shuffleArray} from "./rndHelpers"
|
|
13
|
+
import {rndFraction} from "./coefficient/rndFraction"
|
|
14
|
+
import {rndMonom} from "./algebra/rndMonom"
|
|
15
|
+
import {rndPolynom} from "./algebra/rndPolynom"
|
|
16
|
+
import {rndEquation} from "./algebra/rndEquation"
|
|
17
|
+
import {rndCircle} from "./geometry/rndCircle"
|
|
18
|
+
import {rndLine} from "./geometry/rndLine"
|
|
19
|
+
import {rndLine3} from "./geometry/rndLine3"
|
|
20
|
+
import {rndVector} from "./geometry/rndVector"
|
|
21
|
+
import {Point} from "../geometry"
|
|
22
|
+
|
|
23
|
+
export type * from "./rndTypes"
|
|
24
|
+
|
|
25
|
+
export const Random = {
|
|
26
|
+
equation: (config?: randomEquationConfig) => {
|
|
27
|
+
return rndEquation(config)
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
polynom: (config?: randomPolynomConfig) => {
|
|
31
|
+
return rndPolynom(config)
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
monom: (config?: randomMonomConfig) => {
|
|
35
|
+
return rndMonom(config)
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
fraction: (config?: randomCoefficientConfig) => {
|
|
39
|
+
return rndFraction(config)
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
number: (from: number, to: number, exclude?: number[]): number => {
|
|
43
|
+
return randomInt(from, to, exclude)
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
numberSym: (max: number, allowZero?: boolean): number => {
|
|
47
|
+
return randomIntSym(max, allowZero)
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
prime: (max: number): number => {
|
|
51
|
+
return randomPrime(max)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
bool: (percent?: number): boolean => {
|
|
55
|
+
return randomBool(percent)
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
array: <T>(arr: T[], number?: number): T[] => {
|
|
59
|
+
return randomArray(arr, number)
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
item: <T>(arr: T[]): T => {
|
|
63
|
+
return randomItem(arr)
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
shuffle: <T>(arr: T[]): T[] => {
|
|
67
|
+
return shuffleArray(arr)
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
line: (config?: randomGeometryLineConfig) => {
|
|
71
|
+
return rndLine(config)
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
line3: (config?: randomGeometryLine3Config) => {
|
|
75
|
+
return rndLine3(config)
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
vector: (config?: randomGeometryPointConfig) => {
|
|
79
|
+
return rndVector(config)
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
point: (config?: randomGeometryPointConfig) => {
|
|
83
|
+
return new Point(rndVector(config))
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
circle: (config?: randomGeometryCircleConfig) => {
|
|
87
|
+
return rndCircle(config)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random helpers
|
|
3
|
+
*/
|
|
4
|
+
import { Numeric } from "../numeric"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Random boolean with a percent ratio
|
|
9
|
+
* @param percent
|
|
10
|
+
*/
|
|
11
|
+
export function randomBool(percent = 0.5): boolean {
|
|
12
|
+
return Math.random() < percent
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Random integer between two values.
|
|
17
|
+
* @param a (number) : From this value to the second value. If the second is ommited, this value is the max value.
|
|
18
|
+
* @param b (number) : To this value. If this is ommited.
|
|
19
|
+
*/
|
|
20
|
+
export function randomInt(a: number, b?: number, exclude?: number[]): number {
|
|
21
|
+
if (b === undefined) {
|
|
22
|
+
if (a >= 0) {
|
|
23
|
+
return randomInt(0, a)
|
|
24
|
+
} else {
|
|
25
|
+
return randomInt(a, 0)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Same start and end values
|
|
30
|
+
if (a === b) {
|
|
31
|
+
return a
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// No exclusion
|
|
35
|
+
if (exclude === undefined) {
|
|
36
|
+
return Math.floor(Math.random() * (b - a + 1) + a)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// With exclusion
|
|
40
|
+
if (Math.abs(b - a) <= exclude.length) {
|
|
41
|
+
throw new Error('The number of excluded values is too high.')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let r = randomInt(a, b)
|
|
45
|
+
while (exclude.includes(r)) {
|
|
46
|
+
r = randomInt(a, b)
|
|
47
|
+
}
|
|
48
|
+
return r
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Random integer between -max and max value.
|
|
53
|
+
* @param max (number) : determine the limits.
|
|
54
|
+
* @param zero (bool) : determine if zero is allowed or not.
|
|
55
|
+
*/
|
|
56
|
+
export function randomIntSym(max: number, zero?: boolean): number {
|
|
57
|
+
if (zero === false) {
|
|
58
|
+
return randomBool() ? randomInt(1, max) : -randomInt(1, max)
|
|
59
|
+
} else {
|
|
60
|
+
return randomInt(-max, max)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function randomPrime(max?: number): number {
|
|
65
|
+
let primes = Numeric.primes()
|
|
66
|
+
if (max !== undefined) {
|
|
67
|
+
primes = primes.filter(x => x < max)
|
|
68
|
+
}
|
|
69
|
+
return randomItem(primes)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function randomArray<T>(arr: T[], number?: number): T[] {
|
|
73
|
+
if (number === undefined) {
|
|
74
|
+
number = 1
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Return a clone array
|
|
78
|
+
if (arr.length <= 0) {
|
|
79
|
+
return Object.values(arr)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Randomize the array and return the n first elements.
|
|
83
|
+
return shuffleArray(arr).slice(0, number)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function randomItem<T>(arr: T[]): T {
|
|
87
|
+
if (arr.length === 0) { return null as T }
|
|
88
|
+
return arr[randomInt(0, arr.length - 1)]
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function shuffleArray<T>(arr: T[]): T[] {
|
|
92
|
+
// The Fisher-Yates algorithm
|
|
93
|
+
const shuffleArray = Object.values(arr)
|
|
94
|
+
for (let i = shuffleArray.length - 1; i > 0; i--) {
|
|
95
|
+
const j = Math.floor(Math.random() * (i + 1))
|
|
96
|
+
const temp = shuffleArray[i]
|
|
97
|
+
shuffleArray[i] = shuffleArray[j]
|
|
98
|
+
shuffleArray[j] = temp
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return shuffleArray
|
|
102
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {Fraction} from "../coefficients/fraction"
|
|
2
|
+
|
|
3
|
+
export interface randomCoefficientConfig {
|
|
4
|
+
max?: number,
|
|
5
|
+
natural?: boolean
|
|
6
|
+
negative?: boolean,
|
|
7
|
+
reduced?: boolean,
|
|
8
|
+
zero?: boolean,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface randomMonomConfig {
|
|
12
|
+
degree?: number,
|
|
13
|
+
fraction?: boolean | randomCoefficientConfig,
|
|
14
|
+
letters?: string,
|
|
15
|
+
zero?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface randomPolynomConfig {
|
|
19
|
+
allowNullMonom?: boolean,
|
|
20
|
+
commonConstant?: boolean ,
|
|
21
|
+
degree?: number,
|
|
22
|
+
factorable?: boolean,
|
|
23
|
+
fraction?: boolean | randomCoefficientConfig,
|
|
24
|
+
letters?: string,
|
|
25
|
+
numberOfMonoms?: number,
|
|
26
|
+
positive?: boolean
|
|
27
|
+
unit?: boolean,
|
|
28
|
+
zero?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface randomEquationConfig extends randomPolynomConfig {
|
|
32
|
+
solution?: {
|
|
33
|
+
allowZero?: boolean,
|
|
34
|
+
fraction?: boolean,
|
|
35
|
+
nothing?: boolean,
|
|
36
|
+
everything?: boolean,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export interface randomGeometryLineConfig {
|
|
42
|
+
A: { x: number | Fraction, y: number | Fraction },
|
|
43
|
+
allow?: {
|
|
44
|
+
vertical?: boolean,
|
|
45
|
+
horizontal?: boolean
|
|
46
|
+
}
|
|
47
|
+
slope?: Fraction | string | number,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface randomGeometryLine3Config {
|
|
51
|
+
A?: { x: number | Fraction, y: number | Fraction, z: number | Fraction },
|
|
52
|
+
direction?: { x: number | Fraction, y: number | Fraction, z: number | Fraction },
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export interface randomGeometryPointConfig {
|
|
57
|
+
axis?: 'x' | 'y' | 'z' | null,
|
|
58
|
+
fraction?: boolean,
|
|
59
|
+
max?: number
|
|
60
|
+
quadrant?: number | null,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface randomGeometryCircleConfig {
|
|
64
|
+
center?: randomGeometryPointConfig,
|
|
65
|
+
pointsOnCircle?: number
|
|
66
|
+
radius?: number,
|
|
67
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject,
|
|
1
|
+
import { EQUATION_SIGN, IAlgebra, IEquation, InputAlgebra, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients/fraction';
|
|
3
3
|
import { Polynom } from './polynom';
|
|
4
|
+
import { Solution } from '../analyze/solution';
|
|
4
5
|
export declare class Equation implements IPiMathObject<Equation>, IEquation<Equation>, IAlgebra<Equation> {
|
|
5
6
|
#private;
|
|
6
7
|
constructor(equation: InputAlgebra<Polynom> | Equation);
|
|
7
8
|
constructor(left: InputAlgebra<Polynom>, right: InputAlgebra<Polynom>, sign?: EQUATION_SIGN);
|
|
8
9
|
parse: (equationString: string) => this;
|
|
9
|
-
create: (left: Polynom, right: Polynom, sign?: string) => this;
|
|
10
10
|
clone: () => Equation;
|
|
11
|
+
get tex(): string;
|
|
12
|
+
get display(): string;
|
|
13
|
+
static isEquationString(equationString: string): boolean;
|
|
14
|
+
static makeSolutionsUnique(solutions: Solution[], sorted?: boolean): Solution[];
|
|
11
15
|
/**
|
|
12
16
|
* Add a value to the equation
|
|
13
17
|
* if value is an equation, add the left part to the left part of the equation
|
|
@@ -17,6 +21,7 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
17
21
|
* @param value | Polynom | Monom | Fraction | string | monom
|
|
18
22
|
*/
|
|
19
23
|
add(value: InputValue<Equation | Polynom>): this;
|
|
24
|
+
create: (left: Polynom, right: Polynom, sign?: string) => this;
|
|
20
25
|
/**
|
|
21
26
|
* Get the degree of the equation
|
|
22
27
|
* @param letter
|
|
@@ -50,17 +55,19 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
50
55
|
*/
|
|
51
56
|
hasVariable: (letter: string) => boolean;
|
|
52
57
|
isEqual(value: InputValue<Equation>): boolean;
|
|
58
|
+
isEqualTo: (equ: Equation) => boolean;
|
|
53
59
|
isLinearTo: (equ: Equation) => boolean;
|
|
54
60
|
/**
|
|
55
61
|
* Determine if the equation contains more than one letter/variable.
|
|
56
62
|
*/
|
|
57
63
|
isMultiVariable: () => boolean;
|
|
58
|
-
isEqualTo: (equ: Equation) => boolean;
|
|
59
64
|
/**
|
|
60
65
|
* Reorder the polynom to have only one letter on the left, the rest on the right.
|
|
61
66
|
* @param letter
|
|
62
67
|
*/
|
|
63
68
|
isolate: (letter?: string) => this | false;
|
|
69
|
+
get left(): Polynom;
|
|
70
|
+
set left(value: Polynom);
|
|
64
71
|
letters: () => string[];
|
|
65
72
|
/**
|
|
66
73
|
* Reorder will move all monoms containing a letter on the left, all the other on the right.
|
|
@@ -71,30 +78,24 @@ export declare class Equation implements IPiMathObject<Equation>, IEquation<Equa
|
|
|
71
78
|
* @param value
|
|
72
79
|
*/
|
|
73
80
|
multiply: (value: InputValue<Fraction>) => this;
|
|
74
|
-
|
|
81
|
+
get numberOfVars(): number;
|
|
75
82
|
opposite: () => this;
|
|
83
|
+
pow(value: number): this;
|
|
76
84
|
reduce(): this;
|
|
77
85
|
reorder: (allLeft?: boolean) => this;
|
|
78
86
|
replaceBy: (letter: string, P: Polynom) => this;
|
|
87
|
+
get right(): Polynom;
|
|
88
|
+
set right(value: Polynom);
|
|
89
|
+
get sign(): string;
|
|
90
|
+
set sign(value: string);
|
|
91
|
+
get signAsTex(): string;
|
|
79
92
|
/**
|
|
80
93
|
* Multiply by the lcm denominator and divide by the gcm numerators.
|
|
81
94
|
*/
|
|
82
95
|
simplify: () => this;
|
|
83
|
-
solve: () =>
|
|
96
|
+
solve: () => Solution[];
|
|
84
97
|
split(): [Polynom, Polynom];
|
|
85
98
|
subtract(value: InputValue<Equation | Polynom>): this;
|
|
86
99
|
test: (values: literalType<Fraction>) => boolean;
|
|
87
|
-
static isEquationString(equationString: string): boolean;
|
|
88
|
-
static makeSolutionsUnique(solutions: ISolution[], sorted?: boolean): ISolution[];
|
|
89
|
-
get display(): string;
|
|
90
|
-
get left(): Polynom;
|
|
91
|
-
set left(value: Polynom);
|
|
92
|
-
get numberOfVars(): number;
|
|
93
|
-
get right(): Polynom;
|
|
94
|
-
set right(value: Polynom);
|
|
95
|
-
get sign(): string;
|
|
96
|
-
set sign(value: string);
|
|
97
|
-
get signAsTex(): string;
|
|
98
|
-
get tex(): string;
|
|
99
100
|
get variables(): string[];
|
|
100
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AAIjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAEjD,qBAAa,QAAS,YAClB,aAAa,CAAC,QAAQ,CAAC,EACvB,SAAS,CAAC,QAAQ,CAAC,EACnB,QAAQ,CAAC,QAAQ,CAAC;;gBAUN,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,QAAQ;gBAC1C,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa;IA8BpF,KAAK,GAAI,gBAAgB,MAAM,KAAG,IAAI,CAY5C;IAEM,KAAK,QAAO,QAAQ,CAE1B;IAED,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;WAEa,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO;WAWjD,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE;IA0B/E,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IAwBhD,MAAM,GAAI,MAAM,OAAO,EAAE,OAAO,OAAO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W,IAAI,CAAC,KAAK,EAAE,MAAM,EAG5B;IAED,IAAW,SAAS,IAAI,MAAM,CAU7B;IAKM,QAAQ,QAAO,IAAI,CAIzB;IAGM,KAAK,QAAO,QAAQ,EAAE,CAG5B;IAEM,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAI3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI;IAoBrD,IAAI,GAAI,QAAQ,WAAW,CAAC,QAAQ,CAAC,KAAG,OAAO,CAErD;IAED,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;CAsEJ"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { ISolution } from '../pimath.interface';
|
|
2
1
|
import { Polynom } from './polynom';
|
|
3
2
|
import { Equation } from './equation';
|
|
3
|
+
import { Solution } from '../analyze';
|
|
4
4
|
export declare class EquationSolver {
|
|
5
5
|
#private;
|
|
6
|
+
_: number;
|
|
6
7
|
constructor(left: Polynom | Equation, right?: Polynom, variable?: string);
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
get bissectionComplexityCounter(): number;
|
|
9
|
+
get bissectionDeltaX(): number;
|
|
10
|
+
set bissectionDeltaX(value: number);
|
|
11
|
+
solve(): Solution[];
|
|
12
|
+
solveAsCardan(): Solution[];
|
|
9
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,qBAAa,cAAc;;IACvB,CAAC,EAAE,MAAM,CAAA;gBAKG,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,SAAM;IAgBrE,IAAI,2BAA2B,WAE9B;IAED,IAAI,gBAAgB,IAIQ,MAAM,CAFjC;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAEjC;IAEM,KAAK,IAAI,QAAQ,EAAE;IAqCnB,aAAa,IAAI,QAAQ,EAAE;CAyZrC"}
|
|
@@ -6,7 +6,6 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
|
|
|
6
6
|
constructor(value?: InputAlgebra<Polynom> | Factor, power?: InputValue<Fraction>);
|
|
7
7
|
parse(): Factor;
|
|
8
8
|
clone(): Factor;
|
|
9
|
-
fromPolynom(polynom: InputValue<Polynom>): this;
|
|
10
9
|
get tex(): string;
|
|
11
10
|
get display(): string;
|
|
12
11
|
add(): Factor;
|
|
@@ -16,6 +15,7 @@ export declare class Factor implements IPiMathObject<Factor>, IExpression<Factor
|
|
|
16
15
|
develop(): Polynom;
|
|
17
16
|
divide(value: InputAlgebra<Factor | Polynom>): this;
|
|
18
17
|
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
18
|
+
fromPolynom(polynom: InputValue<Polynom>): this;
|
|
19
19
|
hasVariable(letter: string): boolean;
|
|
20
20
|
inverse(): this;
|
|
21
21
|
isEqual(value: Factor): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,
|
|
1
|
+
{"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV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;IAIjB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI;IAkBrD,GAAG,IAAI,IAAI;IAMX,QAAQ,IAAI,MAAM;IAIzB,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAEhC;IAEM,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAK1C,IAAW,KAAK,IAAI,QAAQ,CAE3B;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,EAE3C;IAEM,SAAS,IAAI,MAAM;IAInB,MAAM,IAAI,MAAM;IAIhB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,IAAI,IAAI,IAAI;IAIZ,QAAQ,IAAI,MAAM;IAIlB,YAAY,IAAI,cAAc;IAwBrC,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,IAAI,IAAI,CAG3B;IAED,IAAW,QAAQ,IAAI,IAAI,CAG1B;IAEM,IAAI,IAAI,IAAI;CAMtB;AAED,oBAAY,cAAc;IACtB,IAAI,IAAA;IACJ,KAAK,IAAA;CACR"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { IAlgebra, IEquation, InputValue, IPiMathObject,
|
|
1
|
+
import { IAlgebra, IEquation, InputValue, IPiMathObject, literalType } from '../pimath.interface';
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Equation } from './equation';
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
|
+
import { Solution } from '../analyze/solution';
|
|
5
6
|
export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
|
|
6
7
|
#private;
|
|
7
8
|
constructor(...values: (string | Equation)[]);
|
|
8
9
|
parse: (...equations: (string | Equation)[]) => this;
|
|
9
10
|
clone: () => LinearSystem;
|
|
11
|
+
get tex(): string;
|
|
12
|
+
get display(): string;
|
|
10
13
|
static fromMatrix(matrix: InputValue<Fraction>[][], letters?: string): LinearSystem;
|
|
11
14
|
add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
12
15
|
buildTex: (equations: Equation[], operators?: (string[])[]) => string;
|
|
13
16
|
degree(letter?: string): Fraction;
|
|
14
|
-
get display(): string;
|
|
15
17
|
get equations(): Equation[];
|
|
16
18
|
set equations(value: Equation[]);
|
|
17
19
|
evaluate(values: InputValue<Fraction> | literalType<number | Fraction>, asNumeric?: boolean): number | Fraction;
|
|
@@ -19,14 +21,29 @@ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquat
|
|
|
19
21
|
isEqual(value: LinearSystem): boolean;
|
|
20
22
|
get isSolvable(): boolean;
|
|
21
23
|
get matrix(): [Fraction[][], Fraction[]];
|
|
22
|
-
mergeEquations
|
|
24
|
+
mergeEquations(equation1: {
|
|
25
|
+
id: number;
|
|
26
|
+
factor: InputValue<Fraction>;
|
|
27
|
+
}, equation2: {
|
|
28
|
+
id: number;
|
|
29
|
+
factor: number;
|
|
30
|
+
}): Equation;
|
|
23
31
|
multiply(value: InputValue<Fraction> | InputValue<Fraction>[], index?: number): this;
|
|
24
|
-
reduce():
|
|
32
|
+
reduce(): this;
|
|
25
33
|
reorder: () => this;
|
|
26
|
-
solve():
|
|
34
|
+
solve(): Solution[];
|
|
27
35
|
solveMatrix: () => Fraction[];
|
|
36
|
+
solve_compute_factors(letter: string): [
|
|
37
|
+
{
|
|
38
|
+
id: number;
|
|
39
|
+
factor: number;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: number;
|
|
43
|
+
factor: number;
|
|
44
|
+
}
|
|
45
|
+
][];
|
|
28
46
|
subtract(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
29
|
-
get tex(): string;
|
|
30
47
|
get variables(): string[];
|
|
31
48
|
set variables(value: string | string[]);
|
|
32
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linearSystem.d.ts","sourceRoot":"","sources":["../../src/algebra/linearSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"linearSystem.d.ts","sourceRoot":"","sources":["../../src/algebra/linearSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAA;AACpG,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAEjD,qBAAa,YAAa,YAAW,aAAa,CAAC,YAAY,CAAC,EAC5D,SAAS,CAAC,YAAY,CAAC,EACvB,QAAQ,CAAC,YAAY,CAAC;;gBAQV,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;IAWrC,KAAK,GAAI,GAAG,WAAW,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,KAAG,IAAI,CAOzD;IAEM,KAAK,QAAO,YAAY,CAG9B;IAED,IAAW,GAAG,IAAI,MAAM,CAQvB;IAED,IAAI,OAAO,WAGV;WAEa,UAAU,CACpB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,EAChC,OAAO,SAAQ,GAAG,YAAY;IAqB3B,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqB/E,QAAQ,GAAI,WAAW,QAAQ,EAAE,EAAE,YAAY,CAAC,MAAM,EAAE,CAA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E;IA2B/D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqB3F,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAI5C;CAmCJ"}
|
|
@@ -9,12 +9,12 @@ export declare class LogicalSet {
|
|
|
9
9
|
*/
|
|
10
10
|
constructor(value?: string);
|
|
11
11
|
parse: (value: string) => this;
|
|
12
|
+
get tex(): string;
|
|
12
13
|
evaluate(values: Record<string, boolean>): boolean;
|
|
13
14
|
get rpn(): {
|
|
14
15
|
token: string;
|
|
15
16
|
tokenType: string;
|
|
16
17
|
}[];
|
|
17
|
-
get tex(): string;
|
|
18
18
|
get variables(): string[];
|
|
19
19
|
vennAB(): string[];
|
|
20
20
|
vennABC(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"AASA,qBAAa,UAAU;;gBAOP,KAAK,CAAC,EAAE,MAAM;IAU1B,KAAK,GAAI,OAAO,MAAM,KAAG,IAAI,CAO5B;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"AASA,qBAAa,UAAU;;gBAOP,KAAK,CAAC,EAAE,MAAM;IAU1B,KAAK,GAAI,OAAO,MAAM,KAAG,IAAI,CAO5B;IAED,IAAI,GAAG,IAAI,MAAM,CAsEhB;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IA+ClD,IAAI,GAAG,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAEhD;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAIxB;IAED,MAAM,IAAI,MAAM,EAAE;IASlB,OAAO,IAAI,MAAM,EAAE;CAiFtB"}
|