pimath 0.2.0 → 0.2.2
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 +198 -177
- package/dist/pimath.js.map +1 -1
- package/package.json +1 -1
- package/src/algebra/linearSystem.ts +40 -38
- package/src/coefficients/root.ts +41 -28
- package/src/geometry/line.ts +1 -1
- package/src/geometry/plane3.ts +1 -1
- package/src/numeric.ts +2 -2
- package/src/randomization/algebra/rndPolynom.ts +1 -3
- package/src/randomization/random.ts +14 -1
- package/src/randomization/rndHelpers.ts +13 -2
- package/types/algebra/linearSystem.d.ts +3 -2
- package/types/algebra/linearSystem.d.ts.map +1 -1
- package/types/coefficients/root.d.ts.map +1 -1
- package/types/geometry/plane3.d.ts +1 -1
- package/types/geometry/plane3.d.ts.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/numeric.d.ts +1 -1
- package/types/numeric.d.ts.map +1 -1
- package/types/randomization/algebra/rndPolynom.d.ts.map +1 -1
- package/types/randomization/random.d.ts +1 -0
- package/types/randomization/random.d.ts.map +1 -1
- package/types/randomization/rndHelpers.d.ts +1 -0
- package/types/randomization/rndHelpers.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -4,15 +4,14 @@ import {Equation} from "./equation"
|
|
|
4
4
|
import {Monom} from "./monom"
|
|
5
5
|
import {Polynom} from "./polynom"
|
|
6
6
|
import {Numeric} from "../numeric"
|
|
7
|
-
import
|
|
7
|
+
import {Solution} from "../analyze"
|
|
8
8
|
|
|
9
9
|
export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
10
10
|
IEquation<LinearSystem>,
|
|
11
11
|
IAlgebra<LinearSystem> {
|
|
12
12
|
|
|
13
13
|
#equations: Equation[]
|
|
14
|
-
|
|
15
|
-
#steps: string[] = []
|
|
14
|
+
|
|
16
15
|
// Determine the letters in the linear asSystem, usually ['x', 'y']
|
|
17
16
|
#variables: string[]
|
|
18
17
|
|
|
@@ -79,6 +78,12 @@ export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
|
79
78
|
|
|
80
79
|
}
|
|
81
80
|
|
|
81
|
+
public static solutionAsDisplay(value: Solution[]): string {
|
|
82
|
+
return `(${value.map(x=>x.display).join(";")})`
|
|
83
|
+
}
|
|
84
|
+
public static solutionAsTex(value: Solution[]): string {
|
|
85
|
+
return `\\left( ${value.map(x=>x.tex).join(" ; ")} \\right)`
|
|
86
|
+
}
|
|
82
87
|
public add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this {
|
|
83
88
|
if (value instanceof LinearSystem) {
|
|
84
89
|
const length = value.equations.length
|
|
@@ -239,7 +244,7 @@ export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
|
239
244
|
|
|
240
245
|
public reduce(): this {
|
|
241
246
|
// reduce all equations at once.
|
|
242
|
-
this.equations.forEach(equ=>equ.reduce())
|
|
247
|
+
this.equations.forEach(equ => equ.reduce())
|
|
243
248
|
return this
|
|
244
249
|
}
|
|
245
250
|
|
|
@@ -252,38 +257,7 @@ export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
|
252
257
|
return this
|
|
253
258
|
}
|
|
254
259
|
|
|
255
|
-
solve(): Solution[] {
|
|
256
|
-
// TODO : à retravailler, car ce n'est ni l'endroit, ni l'intérêt de l'avoir ici.
|
|
257
|
-
// 1. search in the equations if a variable has two same or opposite value = candidate for merging
|
|
258
|
-
// 2. if 1 is false, search for a variable that has coefficient one
|
|
259
|
-
// 3. if 2 is false, search for a variable that has a coefficient multiple of another.
|
|
260
|
-
// 4. if 3 is false, multiply both lines.
|
|
261
|
-
// => merge the equations and cycle.
|
|
262
|
-
const output: string[] = [this.tex]
|
|
263
|
-
|
|
264
|
-
const LS = this.clone()
|
|
265
|
-
|
|
266
|
-
while (LS.variables.length>1){
|
|
267
|
-
const letter = LS.variables[LS.variables.length-1]
|
|
268
|
-
const emptyLS = new LinearSystem()
|
|
269
|
-
const factors = LS.solve_compute_factors(letter).slice(0, LS.variables.length-1)
|
|
270
|
-
factors.forEach(factor=> {
|
|
271
|
-
emptyLS.equations.push(LS.mergeEquations(...factor))
|
|
272
|
-
})
|
|
273
|
-
|
|
274
|
-
LS.equations = emptyLS.equations
|
|
275
|
-
|
|
276
|
-
output.push(LS.tex)
|
|
277
|
-
|
|
278
|
-
// add the same but with a reduced value.
|
|
279
|
-
LS.reduce()
|
|
280
|
-
output.push(LS.tex)
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return []
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
public solveMatrix = (): Fraction[] => {
|
|
260
|
+
public solve(): Solution[] {
|
|
287
261
|
const [matrix, vector] = this.matrix
|
|
288
262
|
// Solve the matrix
|
|
289
263
|
|
|
@@ -333,15 +307,18 @@ export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
|
333
307
|
// the last element must not be zero => the asSystem is impossible
|
|
334
308
|
if (augmentedMatrix[j].slice(0, augmentedMatrix[j].length - 1).every(x => x.isZero())) {
|
|
335
309
|
if (augmentedMatrix[j][augmentedMatrix[j].length - 1].isZero()) {
|
|
336
|
-
|
|
310
|
+
// Infinite solution
|
|
311
|
+
return this.#mapMatrixSolutions()
|
|
337
312
|
} else {
|
|
313
|
+
// No solution
|
|
338
314
|
return []
|
|
339
315
|
}
|
|
340
316
|
}
|
|
341
317
|
}
|
|
342
318
|
}
|
|
343
319
|
|
|
344
|
-
return augmentedMatrix
|
|
320
|
+
return this.#mapMatrixSolutions(augmentedMatrix)
|
|
321
|
+
|
|
345
322
|
}
|
|
346
323
|
|
|
347
324
|
solve_compute_factors(letter: string):
|
|
@@ -436,4 +413,29 @@ export class LinearSystem implements IPiMathObject<LinearSystem>,
|
|
|
436
413
|
return [matrix, vector]
|
|
437
414
|
}
|
|
438
415
|
|
|
416
|
+
#mapMatrixSolutions(matrix?: Fraction[][]): Solution[] {
|
|
417
|
+
const result: Solution[] = []
|
|
418
|
+
|
|
419
|
+
if(!matrix){
|
|
420
|
+
// infinite solutions
|
|
421
|
+
this.variables.forEach(letter=>{
|
|
422
|
+
const sol = Solution.fromFraction(Infinity)
|
|
423
|
+
sol.variable = letter
|
|
424
|
+
result.push(sol)
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
return result
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
matrix.forEach((x, index) => {
|
|
431
|
+
|
|
432
|
+
const sol = Solution.fromFraction(x[x.length - 1])
|
|
433
|
+
sol.variable = this.variables[index]
|
|
434
|
+
|
|
435
|
+
result.push(sol)
|
|
436
|
+
})
|
|
437
|
+
|
|
438
|
+
return result
|
|
439
|
+
}
|
|
440
|
+
|
|
439
441
|
}
|
package/src/coefficients/root.ts
CHANGED
|
@@ -75,43 +75,28 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
75
75
|
// Force the plus sign.
|
|
76
76
|
const plus = this.#withSign && this.factor.isPositive() ? '+' : ''
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
if (this.#radical.isZero()) return `${plus}${this.#factor.tex}`
|
|
78
|
+
if (this.value === 0) return `${plus}0`
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
const den = this.#makeTeXLine(this.#factor.denominator, this.#radical.denominator)
|
|
81
|
+
const num = this.#makeTeXLine(this.#factor.numerator, this.#radical.numerator) ?? '1'
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
const rad = this.index === 2
|
|
86
|
-
? `\\sqrt{ ${this.#radical.tex} }`
|
|
87
|
-
: `\\sqrt[ ${this.index} ]{ ${this.#radical.tex} }`
|
|
83
|
+
if (den === null) return `${plus}${num}`
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
return this.#withSign
|
|
91
|
-
? `${this.#factor.isOne() ? plus : '-'} ${rad}`
|
|
92
|
-
: `${this.#factor.isOne() ? '' : '-'}${rad}`
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return `${plus}${this.#factor.tex} ${rad}`
|
|
85
|
+
return `${plus}\\frac{ ${num} }{ ${den} }`
|
|
96
86
|
}
|
|
97
87
|
|
|
98
88
|
get display(): string {
|
|
89
|
+
// force the '+' sign if asked
|
|
99
90
|
const plus = this.#withSign && this.factor.isPositive() ? '+' : ''
|
|
100
91
|
|
|
101
|
-
|
|
102
|
-
if (this.#radical.isZero()) return `${plus}${this.#factor.display}`
|
|
92
|
+
if (this.value === 0) return `${plus}0`
|
|
103
93
|
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
const den = this.#makeDisplayLine(this.#factor.denominator, this.#radical.denominator, true)
|
|
95
|
+
const num = this.#makeDisplayLine(this.#factor.numerator, this.#radical.numerator, den !== null) ?? '1'
|
|
106
96
|
|
|
107
|
-
|
|
108
|
-
const rad = this.index === 2
|
|
109
|
-
? `sqrt(${this.#radical.tex})`
|
|
110
|
-
: `root(${this.index})(${this.#radical.display})`
|
|
97
|
+
if (den === null) return `${plus}${num}`
|
|
111
98
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return `${plus}${this.#factor.display}${rad}`
|
|
99
|
+
return `${plus}${num}/${den}`
|
|
115
100
|
}
|
|
116
101
|
|
|
117
102
|
add(value: InputValue<Root>): this {
|
|
@@ -198,9 +183,9 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
198
183
|
isRational(): boolean {
|
|
199
184
|
const reduced = this.clone().reduce()
|
|
200
185
|
|
|
201
|
-
if(reduced.radical.isOne()) return reduced.factor.exact
|
|
186
|
+
if (reduced.radical.isOne()) return reduced.factor.exact
|
|
202
187
|
|
|
203
|
-
if(reduced.index===1) return reduced.factor.exact && reduced.radical.exact
|
|
188
|
+
if (reduced.index === 1) return reduced.factor.exact && reduced.radical.exact
|
|
204
189
|
|
|
205
190
|
return false
|
|
206
191
|
}
|
|
@@ -317,6 +302,34 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
317
302
|
return this
|
|
318
303
|
}
|
|
319
304
|
|
|
305
|
+
#makeDisplayLine(a: number, b: number, wrap: boolean): string | null {
|
|
306
|
+
const rad = this.#index === 2 ? `sqrt` : `root(${this.#index})`
|
|
307
|
+
|
|
308
|
+
const formatted: string[] = [
|
|
309
|
+
(a !== 1 && a !== 0) ? a.toString() : null,
|
|
310
|
+
(b !== 1 && b !== 0) ? `${rad}(${b})` : null,
|
|
311
|
+
].filter(x => x !== null)
|
|
312
|
+
|
|
313
|
+
if (formatted.length === 0) return null
|
|
314
|
+
|
|
315
|
+
if (wrap && formatted.length===2) return `(${formatted.join("")})`
|
|
316
|
+
|
|
317
|
+
return formatted.join("")
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
#makeTeXLine(a: number, b: number): string | null {
|
|
321
|
+
const rad = this.#index === 2 ? `\\sqrt` : `\\sqrt[ ${this.#index} ]`
|
|
322
|
+
|
|
323
|
+
const formatted: string[] = [
|
|
324
|
+
(a !== 1 && a !== 0) ? a.toString() : null,
|
|
325
|
+
(b !== 1 && b !== 0) ? `${rad}{ ${b} }` : null,
|
|
326
|
+
].filter(x => x !== null)
|
|
327
|
+
|
|
328
|
+
if (formatted.length === 0) return null
|
|
329
|
+
|
|
330
|
+
return formatted.join(" ")
|
|
331
|
+
}
|
|
332
|
+
|
|
320
333
|
#parse_root(value: string): this {
|
|
321
334
|
// value = a root(n)b or a root(n)(b)
|
|
322
335
|
const [factor, index_radical] = value.split('root')
|
package/src/geometry/line.ts
CHANGED
|
@@ -328,7 +328,7 @@ export class Line implements IPiMathObject<Line> {
|
|
|
328
328
|
return new Root(0)
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
return new Root().from(2, d2.inverse(), numerator)
|
|
331
|
+
return new Root().from(2, d2.inverse(), numerator).reduce()
|
|
332
332
|
|
|
333
333
|
// The denominator is a perfect square - simplify the tex result
|
|
334
334
|
// const value = numerator.value / Math.sqrt(d2.value)
|
package/src/geometry/plane3.ts
CHANGED
package/src/numeric.ts
CHANGED
|
@@ -141,9 +141,9 @@ function primes(nb?: number): number[] {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): number
|
|
144
|
+
function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): [number,number,number][] {
|
|
145
145
|
// méthode inverse, à partir du triplet.
|
|
146
|
-
const triplets = [],
|
|
146
|
+
const triplets:[number, number, number][] = [],
|
|
147
147
|
targetValue = targetIsSquare === true ? +target : target ** 2
|
|
148
148
|
for (let u = 0; u <= target; u++) {
|
|
149
149
|
for (let v = 0; v <= target; v++) {
|
|
@@ -49,9 +49,7 @@ export function rndPolynom(userConfig?: randomPolynomConfig): Polynom {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// Make sure the first monom is positive.
|
|
52
|
-
if (config.positive && P.monomByDegree().coefficient.isNegative())
|
|
53
|
-
P.monomByDegree().coefficient.opposite()
|
|
54
|
-
}
|
|
52
|
+
if (config.positive && P.monomByDegree().coefficient.isNegative()) P.opposite()
|
|
55
53
|
|
|
56
54
|
// If the number of monoms is greater than the allowed value, remove some of them... except the first one !
|
|
57
55
|
if (config.numberOfMonoms
|
|
@@ -9,7 +9,16 @@ import type {
|
|
|
9
9
|
randomPolynomConfig
|
|
10
10
|
} from "./rndTypes"
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
randomArray,
|
|
14
|
+
randomBool,
|
|
15
|
+
randomInt,
|
|
16
|
+
randomIntSym,
|
|
17
|
+
randomItem,
|
|
18
|
+
randomPrime,
|
|
19
|
+
randomTriplet,
|
|
20
|
+
shuffleArray
|
|
21
|
+
} from "./rndHelpers"
|
|
13
22
|
import {rndFraction} from "./coefficient/rndFraction"
|
|
14
23
|
import {rndMonom} from "./algebra/rndMonom"
|
|
15
24
|
import {rndPolynom} from "./algebra/rndPolynom"
|
|
@@ -51,6 +60,10 @@ export const Random = {
|
|
|
51
60
|
return randomPrime(max)
|
|
52
61
|
},
|
|
53
62
|
|
|
63
|
+
triplet: (target: number, allowZero?: boolean): [number, number, number] | null => {
|
|
64
|
+
return randomTriplet(target, allowZero)
|
|
65
|
+
},
|
|
66
|
+
|
|
54
67
|
bool: (percent?: number): boolean => {
|
|
55
68
|
return randomBool(percent)
|
|
56
69
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Random helpers
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {Numeric} from "../numeric"
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -61,6 +61,15 @@ export function randomIntSym(max: number, zero?: boolean): number {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
export function randomTriplet(target: number, allowZero?: boolean): [number, number, number] | null {
|
|
65
|
+
const triplets = Numeric.pythagoreanTripletsWithTarget(target)
|
|
66
|
+
.filter(x => allowZero === true || !x.includes(0))
|
|
67
|
+
|
|
68
|
+
if (triplets.length === 0) return null
|
|
69
|
+
|
|
70
|
+
return randomItem(triplets)
|
|
71
|
+
}
|
|
72
|
+
|
|
64
73
|
export function randomPrime(max?: number): number {
|
|
65
74
|
let primes = Numeric.primes()
|
|
66
75
|
if (max !== undefined) {
|
|
@@ -84,7 +93,9 @@ export function randomArray<T>(arr: T[], number?: number): T[] {
|
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
export function randomItem<T>(arr: T[]): T {
|
|
87
|
-
if (arr.length === 0) {
|
|
96
|
+
if (arr.length === 0) {
|
|
97
|
+
return null as T
|
|
98
|
+
}
|
|
88
99
|
return arr[randomInt(0, arr.length - 1)]
|
|
89
100
|
}
|
|
90
101
|
|
|
@@ -2,7 +2,7 @@ import { IAlgebra, IEquation, InputValue, IPiMathObject, literalType } from '../
|
|
|
2
2
|
import { Fraction } from '../coefficients';
|
|
3
3
|
import { Equation } from './equation';
|
|
4
4
|
import { Polynom } from './polynom';
|
|
5
|
-
import { Solution } from '../analyze
|
|
5
|
+
import { Solution } from '../analyze';
|
|
6
6
|
export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquation<LinearSystem>, IAlgebra<LinearSystem> {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(...values: (string | Equation)[]);
|
|
@@ -11,6 +11,8 @@ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquat
|
|
|
11
11
|
get tex(): string;
|
|
12
12
|
get display(): string;
|
|
13
13
|
static fromMatrix(matrix: InputValue<Fraction>[][], letters?: string): LinearSystem;
|
|
14
|
+
static solutionAsDisplay(value: Solution[]): string;
|
|
15
|
+
static solutionAsTex(value: Solution[]): string;
|
|
14
16
|
add(value: InputValue<LinearSystem | Equation | Polynom>, index?: number): this;
|
|
15
17
|
buildTex: (equations: Equation[], operators?: (string[])[]) => string;
|
|
16
18
|
degree(letter?: string): Fraction;
|
|
@@ -32,7 +34,6 @@ export declare class LinearSystem implements IPiMathObject<LinearSystem>, IEquat
|
|
|
32
34
|
reduce(): this;
|
|
33
35
|
reorder: () => this;
|
|
34
36
|
solve(): Solution[];
|
|
35
|
-
solveMatrix: () => Fraction[];
|
|
36
37
|
solve_compute_factors(letter: string): [
|
|
37
38
|
{
|
|
38
39
|
id: number;
|
|
@@ -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,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,
|
|
1
|
+
{"version":3,"file":"linearSystem.d.ts","sourceRoot":"","sources":["../../src/algebra/linearSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ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M,EAAE,EAI5C;CA4DJ"}
|
|
@@ -1 +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;;gBAMnD,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC;IAa/C,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,IAAI;IAwC/C,KAAK,IAAI,IAAI;IAIb,IAAI,GAAG,IAAI,MAAM,
|
|
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;;gBAMnD,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC;IAa/C,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,IAAI;IAwC/C,KAAK,IAAI,IAAI;IAIb,IAAI,GAAG,IAAI,MAAM,CAiBhB;IAED,IAAI,OAAO,IAAI,MAAM,CAYpB;IAED,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI;IAiBlC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI;IAIrC,IAAI,MAAM,I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;
|
|
20
20
|
intersectWithLine(line: Line3): Point;
|
|
21
21
|
intersectWithPlane(plane: Plane3): Line3;
|
|
22
22
|
isPointOnPlane(pt: Point): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plane3.d.ts","sourceRoot":"","sources":["../../src/geometry/plane3.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAA;AAGrD,qBAAa,MAAM;;gBAIH,MAAM,CAAC,EAAE,YAAY;IAQjC,KAAK,CAAC,MAAM,EAAE,YAAY;IAyD1B,IAAI,GAAG,IAAI,MAAM,CAMhB;IAED,IAAI,OAAO,IAAI,MAAM,CAMpB;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAEhE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAE7D,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM;IAsB/D,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,UAAU,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"plane3.d.ts","sourceRoot":"","sources":["../../src/geometry/plane3.ts"],"names":[],"mappings":"AA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IAED,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAE9B;CACJ"}
|
package/types/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare const PiMath: {
|
|
|
22
22
|
numberCorrection: (value: number, number_of_digits?: number) => number;
|
|
23
23
|
periodic: (value: number) => number;
|
|
24
24
|
primes: (nb?: number) => number[];
|
|
25
|
-
pythagoreanTripletsWithTarget: (target: number, targetIsSquare?: boolean) => number
|
|
25
|
+
pythagoreanTripletsWithTarget: (target: number, targetIsSquare?: boolean) => [number, number, number][];
|
|
26
26
|
round: (value: number, decimals?: number) => number;
|
|
27
27
|
greatestPower: (value: number, index: number) => number;
|
|
28
28
|
};
|
|
@@ -44,6 +44,7 @@ declare const PiMath: {
|
|
|
44
44
|
number: (from: number, to: number, exclude?: number[]) => number;
|
|
45
45
|
numberSym: (max: number, allowZero?: boolean) => number;
|
|
46
46
|
prime: (max: number) => number;
|
|
47
|
+
triplet: (target: number, allowZero?: boolean) => [number, number, number] | null;
|
|
47
48
|
bool: (percent?: number) => boolean;
|
|
48
49
|
array: <T>(arr: T[], number?: number) => T[];
|
|
49
50
|
item: <T>(arr: T[]) => T;
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,WAAW,CAAA;AAGxG,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,YAAY,CAAA;AAGxF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;A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;;;;;;;;;;;;;;CAwBX,CAAA;AAGD,eAAe,MAAM,CAAA"}
|
package/types/numeric.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare function periodic(value: number): number;
|
|
|
22
22
|
* @param nb : number of primes to choose from
|
|
23
23
|
*/
|
|
24
24
|
declare function primes(nb?: number): number[];
|
|
25
|
-
declare function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): number
|
|
25
|
+
declare function pythagoreanTripletsWithTarget(target: number, targetIsSquare?: boolean): [number, number, number][];
|
|
26
26
|
declare function round(value: number, decimals?: number): number;
|
|
27
27
|
declare function greatestPower(value: number, index: number): number;
|
|
28
28
|
export declare const Numeric: {
|
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,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CA4C1D;AAMD,iBAAS,mBAAmB,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAIxD;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,gBAAgB,SAAI,UAE5D;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAevC;AAMD,iBAAS,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAOrC;AAED,iBAAS,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,
|
|
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,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CA4C1D;AAMD,iBAAS,mBAAmB,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAIxD;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,gBAAgB,SAAI,UAE5D;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAevC;AAMD,iBAAS,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAOrC;AAED,iBAAS,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,EAAC,MAAM,EAAC,MAAM,CAAC,EAAE,CAazG;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAIlD;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAgB3D;AAGD,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rndPolynom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndPolynom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAQ,OAAO,EAAC,MAAM,eAAe,CAAA;AAgB5C,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"rndPolynom.d.ts","sourceRoot":"","sources":["../../../src/randomization/algebra/rndPolynom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAQ,OAAO,EAAC,MAAM,eAAe,CAAA;AAgB5C,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAgDpE;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CA6B9E"}
|
|
@@ -9,6 +9,7 @@ export declare const Random: {
|
|
|
9
9
|
number: (from: number, to: number, exclude?: number[]) => number;
|
|
10
10
|
numberSym: (max: number, allowZero?: boolean) => number;
|
|
11
11
|
prime: (max: number) => number;
|
|
12
|
+
triplet: (target: number, allowZero?: boolean) => [number, number, number] | null;
|
|
12
13
|
bool: (percent?: number) => boolean;
|
|
13
14
|
array: <T>(arr: T[], number?: number) => T[];
|
|
14
15
|
item: <T>(arr: T[]) => T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/randomization/random.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACtB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/randomization/random.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACtB,MAAM,YAAY,CAAA;AAoBnB,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,mBAAmB,YAAY,CAAA;AAE/B,eAAO,MAAM,MAAM;wBACK,oBAAoB;uBAIrB,mBAAmB;qBAIrB,iBAAiB;wBAId,uBAAuB;mBAI5B,MAAM,MAAM,MAAM,YAAY,MAAM,EAAE,KAAG,MAAM;qBAI7C,MAAM,cAAc,OAAO,KAAG,MAAM;iBAIxC,MAAM,KAAG,MAAM;sBAIV,MAAM,cAAc,OAAO,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;qBAI9D,MAAM,KAAG,OAAO;YAIzB,CAAC,OAAO,CAAC,EAAE,WAAW,MAAM,KAAG,CAAC,EAAE;WAInC,CAAC,OAAO,CAAC,EAAE,KAAG,CAAC;cAIZ,CAAC,OAAO,CAAC,EAAE,KAAG,CAAC,EAAE;oBAIX,wBAAwB;qBAIvB,yBAAyB;sBAIxB,yBAAyB;qBAI1B,yBAAyB;sBAIxB,0BAA0B;CAG/C,CAAA"}
|
|
@@ -15,6 +15,7 @@ export declare function randomInt(a: number, b?: number, exclude?: number[]): nu
|
|
|
15
15
|
* @param zero (bool) : determine if zero is allowed or not.
|
|
16
16
|
*/
|
|
17
17
|
export declare function randomIntSym(max: number, zero?: boolean): number;
|
|
18
|
+
export declare function randomTriplet(target: number, allowZero?: boolean): [number, number, number] | null;
|
|
18
19
|
export declare function randomPrime(max?: number): number;
|
|
19
20
|
export declare function randomArray<T>(arr: T[], number?: number): T[];
|
|
20
21
|
export declare function randomItem<T>(arr: T[]): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rndHelpers.d.ts","sourceRoot":"","sources":["../../src/randomization/rndHelpers.ts"],"names":[],"mappings":"AAUA,wBAAgB,UAAU,CAAC,OAAO,SAAM,GAAG,OAAO,CAEjD;AAOD,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAA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