pimath 0.1.39 → 0.1.40
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 +188 -159
- package/dist/pimath.js.map +1 -1
- package/package.json +4 -2
- package/src/algebra/equation.ts +556 -0
- package/src/algebra/equationSolver.ts +539 -0
- package/src/algebra/factor.ts +339 -0
- package/src/algebra/index.ts +11 -0
- package/src/algebra/linearSystem.ts +388 -0
- package/src/algebra/logicalset.ts +256 -0
- package/src/algebra/matrix.ts +474 -0
- package/src/algebra/monom.ts +1015 -0
- package/src/algebra/operations.ts +24 -0
- package/src/algebra/polyFactor.ts +668 -0
- package/src/algebra/polynom.ts +1394 -0
- package/src/analyze/solution.ts +115 -0
- package/src/analyze/tableOfSigns.ts +30 -0
- package/src/coefficients/fraction.ts +678 -0
- package/src/coefficients/index.ts +4 -0
- package/src/coefficients/nthRoot.ts +149 -0
- package/src/coefficients/root.ts +299 -0
- package/src/geometry/circle.ts +386 -0
- package/src/geometry/geomMath.ts +70 -0
- package/src/geometry/index.ts +10 -0
- package/src/geometry/line.ts +677 -0
- package/src/geometry/line3.ts +206 -0
- package/src/geometry/plane3.ts +170 -0
- package/src/geometry/point.ts +66 -0
- package/src/geometry/sphere3.ts +214 -0
- package/src/geometry/triangle.ts +354 -0
- package/src/geometry/vector.ts +341 -0
- package/src/helpers.ts +35 -0
- package/src/index.ts +60 -0
- package/src/numeric.ts +199 -0
- package/src/pimath.interface.ts +160 -0
- package/src/randomization/algebra/rndEquation.ts +41 -0
- package/src/randomization/algebra/rndMonom.ts +39 -0
- package/src/randomization/algebra/rndPolynom.ts +86 -0
- package/src/randomization/coefficient/rndFraction.ts +38 -0
- package/src/randomization/geometry/rndCircle.ts +27 -0
- package/src/randomization/geometry/rndLine.ts +37 -0
- package/src/randomization/geometry/rndLine3.ts +27 -0
- package/src/randomization/geometry/rndVector.ts +63 -0
- package/src/randomization/random.ts +91 -0
- package/src/randomization/rndHelpers.ts +102 -0
- package/src/randomization/rndTypes.ts +63 -0
- package/types/algebra/equationSolver.d.ts +3 -0
- package/types/algebra/equationSolver.d.ts.map +1 -1
- package/types/algebra/polyFactor.d.ts +5 -0
- package/types/algebra/polyFactor.d.ts.map +1 -1
- package/types/analyze/solution.d.ts +21 -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/root.d.ts +38 -0
- package/types/coefficients/root.d.ts.map +1 -0
- package/types/geometry/point.d.ts +1 -1
- package/types/geometry/point.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 +1 -0
- 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 +26 -26
- package/types/pimath.interface.d.ts.map +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
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(
|
|
17
|
+
randomIntSym(10),
|
|
18
|
+
randomIntSym(10)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
while (d.isNull) {
|
|
22
|
+
d.x = randomIntSym(10)
|
|
23
|
+
d.y = randomIntSym(10)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (config.slope === 1) {
|
|
27
|
+
if (d.x.sign() !== d.y.sign()) {
|
|
28
|
+
d.y.opposite()
|
|
29
|
+
}
|
|
30
|
+
} else if (config.slope === -1) {
|
|
31
|
+
if (d.x.sign() !== d.y.sign()) {
|
|
32
|
+
d.y.opposite()
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return new Line().fromPointAndDirection(new Vector(config.A.x, config.A.y), d)
|
|
37
|
+
}
|
|
@@ -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,91 @@
|
|
|
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
|
+
|
|
22
|
+
export type * from "./rndTypes"
|
|
23
|
+
|
|
24
|
+
export const Random = {
|
|
25
|
+
equation: (config?: randomEquationConfig) => {
|
|
26
|
+
return rndEquation(config)
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
polynom: (config?: randomPolynomConfig) => {
|
|
30
|
+
return rndPolynom(config)
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
monom: (config?: randomMonomConfig) => {
|
|
34
|
+
return rndMonom(config)
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
fraction: (config?: randomCoefficientConfig) => {
|
|
38
|
+
return rndFraction(config)
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
number: (from: number, to: number, exclude?: number[]): number => {
|
|
42
|
+
return randomInt(from, to, exclude)
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
numberSym: (max: number, allowZero?: boolean): number => {
|
|
46
|
+
return randomIntSym(max, allowZero)
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
prime: (max: number): number => {
|
|
50
|
+
return randomPrime(max)
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
bool: (percent?: number): boolean => {
|
|
54
|
+
return randomBool(percent)
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
array: <T>(arr: T[], number?: number): T[] => {
|
|
58
|
+
return randomArray(arr, number)
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
item: <T>(arr: T[]): T => {
|
|
62
|
+
return randomItem(arr)
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
shuffle: <T>(arr: T[]): T[] => {
|
|
66
|
+
return shuffleArray(arr)
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
line: (config?: randomGeometryLineConfig) => {
|
|
70
|
+
return rndLine(config)
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
line3: (config?: randomGeometryLine3Config) => {
|
|
74
|
+
return rndLine3(config)
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
vector: (config?: randomGeometryPointConfig) => {
|
|
78
|
+
return rndVector(config)
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
point: (config?: randomGeometryPointConfig) => {
|
|
82
|
+
const vector = rndVector(config)
|
|
83
|
+
vector.asPoint = true
|
|
84
|
+
|
|
85
|
+
return vector
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
circle: (config?: randomGeometryCircleConfig) => {
|
|
89
|
+
return rndCircle(config)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -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,63 @@
|
|
|
1
|
+
import { Fraction } from "../coefficients/fraction"
|
|
2
|
+
|
|
3
|
+
export interface randomCoefficientConfig {
|
|
4
|
+
negative?: boolean,
|
|
5
|
+
max?: number,
|
|
6
|
+
reduced?: boolean,
|
|
7
|
+
zero?: boolean,
|
|
8
|
+
natural?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface randomMonomConfig {
|
|
12
|
+
letters?: string,
|
|
13
|
+
degree?: number,
|
|
14
|
+
fraction?: boolean | randomCoefficientConfig,
|
|
15
|
+
zero?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface randomPolynomConfig {
|
|
19
|
+
letters?: string,
|
|
20
|
+
degree?: number,
|
|
21
|
+
fraction?: boolean | randomCoefficientConfig,
|
|
22
|
+
zero?: boolean
|
|
23
|
+
unit?: boolean,
|
|
24
|
+
factorable?: boolean,
|
|
25
|
+
allowNullMonom?: boolean,
|
|
26
|
+
numberOfMonoms?: number,
|
|
27
|
+
positive?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface randomEquationConfig extends randomPolynomConfig {
|
|
31
|
+
solution?: {
|
|
32
|
+
allowZero?: boolean,
|
|
33
|
+
fraction?: boolean,
|
|
34
|
+
nothing?: boolean,
|
|
35
|
+
everything?: boolean,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export interface randomGeometryLineConfig {
|
|
42
|
+
A: { x: number | Fraction, y: number | Fraction },
|
|
43
|
+
slope?: Fraction | string | number,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface randomGeometryLine3Config {
|
|
47
|
+
A?: { x: number | Fraction, y: number | Fraction, z: number | Fraction },
|
|
48
|
+
direction?: { x: number | Fraction, y: number | Fraction, z: number | Fraction },
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export interface randomGeometryPointConfig {
|
|
53
|
+
quadrant?: number | null,
|
|
54
|
+
axis?: 'x' | 'y' | 'z' | null,
|
|
55
|
+
fraction?: boolean,
|
|
56
|
+
max?: number
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface randomGeometryCircleConfig {
|
|
60
|
+
center?: randomGeometryPointConfig,
|
|
61
|
+
radius?: number,
|
|
62
|
+
pointsOnCircle?: number
|
|
63
|
+
}
|
|
@@ -4,6 +4,9 @@ import { Equation } from './equation';
|
|
|
4
4
|
export declare class EquationSolver {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(left: Polynom | Equation, right?: Polynom, variable?: string);
|
|
7
|
+
get bissectionCompexityCounter(): number;
|
|
8
|
+
get bissectionDeltaX(): number;
|
|
9
|
+
set bissectionDeltaX(value: number);
|
|
7
10
|
solve(): ISolution[];
|
|
8
11
|
solveAsCardan(): ISolution[];
|
|
9
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,qBAAa,cAAc;;
|
|
1
|
+
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,qBAAa,cAAc;;gBAMX,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,SAAM;IAarE,IAAI,0BAA0B,WAE7B;IAED,IAAI,gBAAgB,IAIQ,MAAM,CAFjC;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAEjC;IAEM,KAAK,IAAI,SAAS,EAAE;IAsCpB,aAAa,IAAI,SAAS,EAAE;CA+ctC"}
|
|
@@ -2,6 +2,7 @@ import { IAlgebra, IExpression, InputAlgebra, InputValue, IPiMathObject, ISoluti
|
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Factor } from './factor';
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
|
+
import { Solution } from '../analyze/solution';
|
|
5
6
|
export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpression<PolyFactor>, IAlgebra<PolyFactor> {
|
|
6
7
|
#private;
|
|
7
8
|
constructor(...values: (Factor | PolyFactor)[]);
|
|
@@ -24,6 +25,10 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
24
25
|
get factors(): Factor[];
|
|
25
26
|
set factors(value: Factor[]);
|
|
26
27
|
fromPolynom(numerator: InputAlgebra<Polynom>, denominator?: InputAlgebra<Polynom>): this;
|
|
28
|
+
/**
|
|
29
|
+
* Get the roots of the PolyFactor.
|
|
30
|
+
*/
|
|
31
|
+
getRoots(): Solution[];
|
|
27
32
|
getZeroes(): ISolution[];
|
|
28
33
|
hasVariable(letter: string): boolean;
|
|
29
34
|
inverse(): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,yBAAyB,EAE5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAC,MAAM,EAAiB,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,yBAAyB,EAE5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ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O,IAAI,MAAM,EAAE,CAE7B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAEjC;IAEM,WAAW,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI;IAgCxF,QAAQ,IAAI,QAAQ,EAAE;IAItB,SAAS,IAAI,SAAS,EAAE;IAiBxB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIpC,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IASnC,KAAK,IAAI,OAAO;IAIhB,MAAM,IAAI,OAAO;IAIjB,QAAQ,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAQ9C,IAAI,SAAS,IAAI,UAAU,CAE1B;IAEM,GAAG,IAAI,IAAI;IAKX,QAAQ,IAAI,IAAI;IAahB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAKnC,SAAS,IAAI,UAAU;IAIvB,MAAM,IAAI,IAAI;IAgBd,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWzB,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAmC3B,IAAI,IAAI,IAAI;IAKZ,QAAQ,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAIvC,YAAY,IAAI,yBAAyB;IAgFhD,IAAW,SAAS,IAAI,MAAM,EAAE,CAG/B;IAEM,IAAI,IAAI,IAAI;CAwBtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InputValue } from '../pimath.interface';
|
|
2
|
+
import { Fraction } from '../coefficients';
|
|
3
|
+
export declare class Solution {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
get tex(): string;
|
|
7
|
+
set tex(value: string);
|
|
8
|
+
get display(): string;
|
|
9
|
+
set display(value: string);
|
|
10
|
+
static fromFraction(value: InputValue<Fraction>): Solution;
|
|
11
|
+
static fromQuadratic(values: [InputValue<Fraction>, InputValue<Fraction>, InputValue<Fraction>]): Solution[];
|
|
12
|
+
get exact(): boolean;
|
|
13
|
+
set exact(value: boolean);
|
|
14
|
+
isAZero(value?: boolean): this;
|
|
15
|
+
isExact(value?: boolean): this;
|
|
16
|
+
get isZero(): boolean;
|
|
17
|
+
set isZero(value: boolean);
|
|
18
|
+
get value(): number;
|
|
19
|
+
get variable(): string;
|
|
20
|
+
set variable(value: string | undefined);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solution.d.ts","sourceRoot":"","sources":["../../src/analyze/solution.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AAExC,qBAAa,QAAQ;;;IAgBjB,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAEpB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAExB;IAED,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAW1D,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,QAAQ,EAAE;IAyB5G,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,EAEvB;IAED,OAAO,CAAC,KAAK,UAAO,GAAG,IAAI;IAK3B,OAAO,CAAC,KAAK,UAAO,GAAG,IAAI;IAK3B,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAMrC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Factor, PolyFactor, Polynom } from '../algebra';
|
|
2
|
+
import { InputAlgebra } from '../pimath.interface';
|
|
3
|
+
import { Solution } from './solution';
|
|
4
|
+
export declare class TableOfSigns {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(value: InputAlgebra<PolyFactor | Factor | Polynom>);
|
|
7
|
+
get fx(): PolyFactor;
|
|
8
|
+
get roots(): Solution[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableOfSigns.d.ts","sourceRoot":"","sources":["../../src/analyze/tableOfSigns.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,qBAAa,YAAY;;gBAGT,KAAK,EAAE,YAAY,CAAC,UAAU,GAAG,MAAM,GAAG,OAAO,CAAE;IAY/D,IAAI,EAAE,eAEL;IAED,IAAI,KAAK,eAER;CACJ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Fraction } from './fraction';
|
|
2
|
+
import { IExpression, InputValue, IPiMathObject } from '../pimath.interface';
|
|
3
|
+
export declare class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(value?: InputValue<Root | Fraction>);
|
|
6
|
+
parse(value: InputValue<Root | Fraction>): this;
|
|
7
|
+
clone(): Root;
|
|
8
|
+
get tex(): string;
|
|
9
|
+
get display(): string;
|
|
10
|
+
add(value: InputValue<Root>): this;
|
|
11
|
+
divide(value: InputValue<Root>): this;
|
|
12
|
+
get factor(): Fraction;
|
|
13
|
+
set factor(value: Fraction);
|
|
14
|
+
from(index: number, radical: InputValue<Fraction>, factor?: InputValue<Fraction>): this;
|
|
15
|
+
/**
|
|
16
|
+
* convert to root(index)(radical), without factor
|
|
17
|
+
*/
|
|
18
|
+
group(): this;
|
|
19
|
+
get index(): number;
|
|
20
|
+
set index(value: number);
|
|
21
|
+
get indexAsPow(): Fraction;
|
|
22
|
+
inverse(): this;
|
|
23
|
+
isEqual(root: Root): boolean;
|
|
24
|
+
isOne(): boolean;
|
|
25
|
+
isZero(): boolean;
|
|
26
|
+
multiply(value: InputValue<Root>): this;
|
|
27
|
+
one(): this;
|
|
28
|
+
opposite(): this;
|
|
29
|
+
pow(value: number): this;
|
|
30
|
+
get radical(): Fraction;
|
|
31
|
+
set radical(value: Fraction);
|
|
32
|
+
reduce(): this;
|
|
33
|
+
root(value: number): this;
|
|
34
|
+
sqrt(): this;
|
|
35
|
+
subtract(value: InputValue<Root>): this;
|
|
36
|
+
get value(): number;
|
|
37
|
+
zero(): this;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/coefficients/root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAI/E,qBAAa,IAAK,YAAW,aAAa,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC;;gBAKnD,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC;IAa/C,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,IAAI;IAuC/C,KAAK,IAAI,IAAI;IAIb,IAAI,GA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d.ts","sourceRoot":"","sources":["../../src/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAE/B,qBAAa,KAAM,SAAQ,MAAM;;gBAGjB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;gBAC1B,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;IAY7B,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;IAgCzD,KAAK,IAAI,KAAK;CAOjC"}
|
package/types/helpers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function wrapParenthesis(str: string, tex?: boolean): string;
|
|
2
|
+
export declare function stripParenthesis(str: string): string;
|
|
2
3
|
export declare function wrapVert(str: string, tex?: boolean): string;
|
|
3
4
|
export declare function wrapNorm(str: string, tex?: boolean): string;
|
|
4
5
|
export declare function replace_in_array<T>(haystack: string[], search: string, target: string, start?: number, end?: number): T;
|
package/types/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAUvH"}
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,MAAM,CAExD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAUvH"}
|
package/types/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ declare const PiMath: {
|
|
|
23
23
|
primes: (nb?: number) => number[];
|
|
24
24
|
pythagoreanTripletsWithTarget: (target: number, targetIsSquare?: boolean) => number[][];
|
|
25
25
|
round: (value: number, decimals?: number) => number;
|
|
26
|
+
greatestPower: (value: number, index: number) => number;
|
|
26
27
|
};
|
|
27
28
|
Fraction: typeof Fraction;
|
|
28
29
|
Root: typeof NthRoot;
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA;AAC9B,cAAc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,OAAO,EAAC,CAAA;AAGhB,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AACnC,OAAO,EAAC,MAAM,EAAC,CAAA;AAGf,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAC,MAAM,EAAC,CAAA;AAGf,mBAAmB,oBAAoB,CAAA;AAGvC,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBX,CAAA;AAGD,eAAe,MAAM,CAAA"}
|
package/types/numeric.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare function periodic(value: number): number;
|
|
|
24
24
|
declare function primes(nb?: number): number[];
|
|
25
25
|
declare function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): number[][];
|
|
26
26
|
declare function round(value: number, decimals?: number): number;
|
|
27
|
+
declare function greatestPower(value: number, index: number): number;
|
|
27
28
|
export declare const Numeric: {
|
|
28
29
|
decompose: typeof decompose;
|
|
29
30
|
dividers: typeof dividers;
|
|
@@ -35,5 +36,6 @@ export declare const Numeric: {
|
|
|
35
36
|
primes: typeof primes;
|
|
36
37
|
pythagoreanTripletsWithTarget: typeof pythagoreanTripletsWithTarget;
|
|
37
38
|
round: typeof round;
|
|
39
|
+
greatestPower: typeof greatestPower;
|
|
38
40
|
};
|
|
39
41
|
export {};
|
package/types/numeric.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../src/numeric.ts"],"names":[],"mappings":"AACA,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAa5C;AAED,iBAAS,kBAAkB,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAIzD;AAMD,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBzC;AAMD,iBAAS,qBAAqB,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