pimath 0.1.21 → 0.1.23
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/algebra/polyFactor.d.ts +2 -2
- package/dist/pimath.interface.d.ts +1 -1
- package/dist/pimath.js +60 -60
- package/dist/pimath.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
14
14
|
get asPower(): this;
|
|
15
15
|
get asRoot(): this;
|
|
16
16
|
degree(letter?: string): Fraction;
|
|
17
|
-
get denominator():
|
|
17
|
+
get denominator(): PolyFactor;
|
|
18
18
|
derivative(): this;
|
|
19
19
|
develop(): Polynom;
|
|
20
20
|
divide(value: PolyFactor): this;
|
|
@@ -30,7 +30,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
30
30
|
isOne(): boolean;
|
|
31
31
|
isZero(): boolean;
|
|
32
32
|
multiply(...values: PolyFactor[]): this;
|
|
33
|
-
get numerator():
|
|
33
|
+
get numerator(): PolyFactor;
|
|
34
34
|
one(): this;
|
|
35
35
|
opposite(): this;
|
|
36
36
|
pow(value: number | Fraction): this;
|
|
@@ -58,7 +58,7 @@ export interface ISolution {
|
|
|
58
58
|
tex: string;
|
|
59
59
|
value: number;
|
|
60
60
|
}
|
|
61
|
-
export type TABLE_OF_SIGNS_VALUES = '-' | '+' | 'h' | 'z' | 't' | 'd' | '';
|
|
61
|
+
export type TABLE_OF_SIGNS_VALUES = '-' | '+' | 'h' | 'z' | 't' | 'd' | 'u' | 'n' | '';
|
|
62
62
|
export interface TABLE_OF_SIGNS {
|
|
63
63
|
roots: ISolution[];
|
|
64
64
|
signs: TABLE_OF_SIGNS_VALUES[];
|
package/dist/pimath.js
CHANGED
|
@@ -391,37 +391,37 @@ class vt {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
Z = new WeakMap(), ee = new WeakMap(), ie = new WeakMap(), Xe = new WeakMap();
|
|
394
|
-
var
|
|
394
|
+
var fe, je, P, ot, ye, bi, ti, xi, Ei, Ni;
|
|
395
395
|
const mi = class mi {
|
|
396
396
|
constructor(e, t, i = "x") {
|
|
397
397
|
p(this, P);
|
|
398
|
-
p(this,
|
|
398
|
+
p(this, fe);
|
|
399
399
|
p(this, je);
|
|
400
400
|
if (h(this, je, i), Object.hasOwn(e, "moveLeft")) {
|
|
401
401
|
const n = e;
|
|
402
|
-
h(this,
|
|
402
|
+
h(this, fe, n.left.clone().subtract(n.right));
|
|
403
403
|
} else
|
|
404
|
-
h(this,
|
|
404
|
+
h(this, fe, e.clone().subtract(t ?? 0));
|
|
405
405
|
}
|
|
406
406
|
solve() {
|
|
407
|
-
if (s(this,
|
|
407
|
+
if (s(this, fe).degree().isOne())
|
|
408
408
|
return q(this, P, xi).call(this);
|
|
409
|
-
if (s(this,
|
|
409
|
+
if (s(this, fe).degree().value === 2)
|
|
410
410
|
return q(this, P, Ei).call(this);
|
|
411
411
|
const e = q(this, P, bi).call(this);
|
|
412
412
|
if (e.length > 0)
|
|
413
413
|
return e;
|
|
414
|
-
if (s(this,
|
|
414
|
+
if (s(this, fe).degree().value === 3)
|
|
415
415
|
return q(this, P, ti).call(this);
|
|
416
416
|
throw new Error("The equation degree is too high.");
|
|
417
417
|
}
|
|
418
418
|
solveAsCardan() {
|
|
419
|
-
if (s(this,
|
|
419
|
+
if (s(this, fe).degree().value !== 3)
|
|
420
420
|
throw new Error("The equation is not cubic.");
|
|
421
421
|
return q(this, P, ti).call(this);
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
|
|
424
|
+
fe = new WeakMap(), je = new WeakMap(), P = new WeakSet(), ot = function(e, t) {
|
|
425
425
|
return {
|
|
426
426
|
variable: s(this, je),
|
|
427
427
|
exact: !1,
|
|
@@ -441,7 +441,7 @@ ue = new WeakMap(), je = new WeakMap(), P = new WeakSet(), ot = function(e, t) {
|
|
|
441
441
|
display: t.display
|
|
442
442
|
};
|
|
443
443
|
}, bi = function() {
|
|
444
|
-
let e = s(this,
|
|
444
|
+
let e = s(this, fe).clone(), t = [];
|
|
445
445
|
const i = e.lcmDenominator();
|
|
446
446
|
i !== 1 && e.multiply(i);
|
|
447
447
|
const n = e.monomByDegree().coefficient;
|
|
@@ -457,7 +457,7 @@ ue = new WeakMap(), je = new WeakMap(), P = new WeakSet(), ot = function(e, t) {
|
|
|
457
457
|
for (const f of t) {
|
|
458
458
|
if (f.exact !== !1 && f.exact.isZero())
|
|
459
459
|
continue;
|
|
460
|
-
const g = s(this,
|
|
460
|
+
const g = s(this, fe).clone().parse("x", f.exact.denominator, -f.exact.numerator);
|
|
461
461
|
for (; e.isDividableBy(g); )
|
|
462
462
|
e = e.divide(g);
|
|
463
463
|
}
|
|
@@ -468,32 +468,32 @@ ue = new WeakMap(), je = new WeakMap(), P = new WeakSet(), ot = function(e, t) {
|
|
|
468
468
|
const d = new mi(e, e.clone().parse("0"), s(this, je));
|
|
469
469
|
return t = t.concat(d.solve()), t.sort((f, g) => f.value - g.value);
|
|
470
470
|
}, ti = function() {
|
|
471
|
-
const e = s(this,
|
|
472
|
-
if (
|
|
473
|
-
const he = g.clone().opposite().add(
|
|
471
|
+
const e = s(this, fe), t = e.monomByDegree(3).coefficient, i = e.monomByDegree(2).coefficient, n = e.monomByDegree(1).coefficient, r = e.monomByDegree(0).coefficient, l = i.clone().divide(t), c = n.clone().divide(t), d = r.clone().divide(t), f = c.clone().subtract(l.clone().pow(2).divide(3)), g = d.clone().subtract(l.clone().multiply(c).divide(3)).add(l.clone().pow(3).multiply(2).divide(27)), N = g.clone().opposite(), V = f.clone().opposite().pow(3).divide(27), pe = N.clone().pow(2).subtract(V.clone().multiply(4)).opposite();
|
|
472
|
+
if (pe.isNegative()) {
|
|
473
|
+
const he = g.clone().opposite().add(pe.clone().opposite().sqrt()).divide(2).root(3), ae = g.clone().opposite().subtract(pe.clone().opposite().sqrt()).divide(2).root(3), ge = he.clone().add(ae).subtract(l.clone().divide(3));
|
|
474
474
|
return [q(this, P, ye).call(this, ge)];
|
|
475
475
|
}
|
|
476
|
-
if (
|
|
476
|
+
if (pe.isZero()) {
|
|
477
477
|
const he = g.clone().opposite().divide(2).root(3), ae = he.clone().opposite().subtract(l.clone().divide(3)), ge = he.clone().multiply(2).subtract(l.clone().divide(3));
|
|
478
478
|
return ae.isEqual(ge) ? [q(this, P, ye).call(this, ae)] : [
|
|
479
479
|
q(this, P, ye).call(this, ge),
|
|
480
480
|
q(this, P, ye).call(this, ae)
|
|
481
|
-
].sort((
|
|
481
|
+
].sort((me, ce) => me.value - ce.value);
|
|
482
482
|
}
|
|
483
|
-
if (
|
|
484
|
-
const he = [], ae = f.value, ge = g.value,
|
|
483
|
+
if (pe.isPositive()) {
|
|
484
|
+
const he = [], ae = f.value, ge = g.value, me = l.value;
|
|
485
485
|
for (let ce = 0; ce < 3; ce++)
|
|
486
|
-
he.push(2 * Math.sqrt(-ae / 3) * Math.cos(Math.acos(3 * ge / (2 * ae) * Math.sqrt(-3 / ae)) / 3 + 2 * Math.PI * ce / 3) -
|
|
486
|
+
he.push(2 * Math.sqrt(-ae / 3) * Math.cos(Math.acos(3 * ge / (2 * ae) * Math.sqrt(-3 / ae)) / 3 + 2 * Math.PI * ce / 3) - me / 3);
|
|
487
487
|
return he.map((ce) => q(this, P, ot).call(this, ce)).sort((ce, nt) => ce.value - nt.value);
|
|
488
488
|
}
|
|
489
489
|
return [];
|
|
490
490
|
}, xi = function() {
|
|
491
|
-
const e = s(this,
|
|
491
|
+
const e = s(this, fe).monomByDegree(0).coefficient.clone().opposite().divide(s(this, fe).monomByDegree(1).coefficient);
|
|
492
492
|
return [
|
|
493
493
|
q(this, P, ye).call(this, e)
|
|
494
494
|
];
|
|
495
495
|
}, Ei = function() {
|
|
496
|
-
const e = s(this,
|
|
496
|
+
const e = s(this, fe), t = e.monomByDegree(2).coefficient, i = e.monomByDegree(1).coefficient, n = e.monomByDegree(0).coefficient, r = i.clone().pow(2).subtract(t.clone().multiply(n).multiply(4));
|
|
497
497
|
if (r.isNegative())
|
|
498
498
|
return [];
|
|
499
499
|
if (r.isSquare()) {
|
|
@@ -505,24 +505,24 @@ ue = new WeakMap(), je = new WeakMap(), P = new WeakSet(), ot = function(e, t) {
|
|
|
505
505
|
}
|
|
506
506
|
return q(this, P, Ni).call(this, t, i, r);
|
|
507
507
|
}, Ni = function(e, t, i) {
|
|
508
|
-
const n = G.dividers(i.value).filter((
|
|
509
|
-
function V(
|
|
510
|
-
return `\\frac{ ${ce} ${nt}\\sqrt{ ${Kt} } }{ ${
|
|
508
|
+
const n = G.dividers(i.value).filter((me) => Math.sqrt(me) % 1 === 0).map((me) => Math.sqrt(me)).pop() ?? 1, r = G.gcd(2 * e.value, t.value, n) * (e.isNegative() ? -1 : 1), l = t.clone().divide(r).opposite(), c = e.clone().divide(r).multiply(2), d = i.clone().divide(n ** 2), f = Math.abs(n / r), g = n === 1 ? "-" : `-${f} `, N = n === 1 ? "+" : `+${f} `;
|
|
509
|
+
function V(me, ce, nt, Kt) {
|
|
510
|
+
return `\\frac{ ${ce} ${nt}\\sqrt{ ${Kt} } }{ ${me} }`;
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
return `(${ce}${nt}sqrt(${Kt}))/${
|
|
512
|
+
function pe(me, ce, nt, Kt) {
|
|
513
|
+
return `(${ce}${nt}sqrt(${Kt}))/${me}`;
|
|
514
514
|
}
|
|
515
515
|
const he = i.value ** 0.5, ae = (-t.value - he) / (2 * e.value), ge = (-t.value + he) / (2 * e.value);
|
|
516
516
|
return [
|
|
517
517
|
q(this, P, ot).call(this, ae, {
|
|
518
518
|
tex: V(c.tex, l.tex, g.toString(), d.tex),
|
|
519
|
-
display:
|
|
519
|
+
display: pe(c.display, l.display, g.toString(), d.display)
|
|
520
520
|
}),
|
|
521
521
|
q(this, P, ot).call(this, ge, {
|
|
522
522
|
tex: V(c.tex, l.tex, N.toString(), d.tex),
|
|
523
|
-
display:
|
|
523
|
+
display: pe(c.display, l.display, N.toString(), d.display)
|
|
524
524
|
})
|
|
525
|
-
].sort((
|
|
525
|
+
].sort((me, ce) => me.value - ce.value);
|
|
526
526
|
};
|
|
527
527
|
let Nt = mi;
|
|
528
528
|
var Gi = Object.defineProperty, Ti = (o) => {
|
|
@@ -1470,8 +1470,8 @@ const C = class C {
|
|
|
1470
1470
|
else {
|
|
1471
1471
|
const f = i.euclidean(d);
|
|
1472
1472
|
t.push(d), i = f.quotient.clone(), c = c.filter((g) => {
|
|
1473
|
-
const N = i.monoms[0], V = i.monoms[i.monoms.length - 1],
|
|
1474
|
-
return V.isDivisible(he) ? N.isDivisible(
|
|
1473
|
+
const N = i.monoms[0], V = i.monoms[i.monoms.length - 1], pe = g.monoms[0], he = g.monoms[g.monoms.length - 1];
|
|
1474
|
+
return V.isDivisible(he) ? N.isDivisible(pe) : !1;
|
|
1475
1475
|
});
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
@@ -1689,10 +1689,10 @@ const C = class C {
|
|
|
1689
1689
|
new C(e).subtract(f.display).multiply(f.denominator)
|
|
1690
1690
|
]) : [this.clone()];
|
|
1691
1691
|
if (n = this.monomByDegree(2, e), r = this.monomByDegree(1, e), l = this.monomByDegree(0, e), n.isLiteralSquare() && l.isLiteralSquare() && r.clone().pow(2).isSameAs(n.clone().multiply(l))) {
|
|
1692
|
-
const V = new C("x", n.coefficient, r.coefficient, l.coefficient),
|
|
1692
|
+
const V = new C("x", n.coefficient, r.coefficient, l.coefficient), pe = s(N = V, $t).call(N, "x"), he = [];
|
|
1693
1693
|
let ae;
|
|
1694
|
-
if (
|
|
1695
|
-
for (const ge of
|
|
1694
|
+
if (pe.length >= 2) {
|
|
1695
|
+
for (const ge of pe)
|
|
1696
1696
|
ge.degree().isZero() ? he.push(ge.clone()) : (ae = ge.clone(), ae.monoms[0].literal = n.literalSqrt, ae.monoms[1].literal = l.literalSqrt, he.push(ae.clone()));
|
|
1697
1697
|
return he;
|
|
1698
1698
|
}
|
|
@@ -2610,7 +2610,7 @@ Oe = new WeakMap(), pt = new WeakSet(), si = function(e, t) {
|
|
|
2610
2610
|
return [...i[0]].sort();
|
|
2611
2611
|
};
|
|
2612
2612
|
var tt, E, mt, ri, gt, oi;
|
|
2613
|
-
const
|
|
2613
|
+
const ue = class ue {
|
|
2614
2614
|
constructor(...e) {
|
|
2615
2615
|
p(this, gt);
|
|
2616
2616
|
p(this, tt, at.POWER);
|
|
@@ -2622,11 +2622,11 @@ const me = class me {
|
|
|
2622
2622
|
if (typeof t == "string") {
|
|
2623
2623
|
const i = t.split(")(").join(")*(").split("*");
|
|
2624
2624
|
s(this, E).push(...i.map((n) => new le(n)));
|
|
2625
|
-
} else t instanceof
|
|
2625
|
+
} else t instanceof ue ? s(this, E).push(...t.factors.map((i) => i.clone())) : s(this, E).push(new le(t));
|
|
2626
2626
|
}), this);
|
|
2627
2627
|
}
|
|
2628
2628
|
clone() {
|
|
2629
|
-
return new
|
|
2629
|
+
return new ue(...s(this, E).map((e) => e.clone()));
|
|
2630
2630
|
}
|
|
2631
2631
|
get tex() {
|
|
2632
2632
|
const { num: e, den: t } = q(this, gt, oi).call(this);
|
|
@@ -2645,20 +2645,20 @@ const me = class me {
|
|
|
2645
2645
|
static gcd(...e) {
|
|
2646
2646
|
var i;
|
|
2647
2647
|
if (e.length === 0)
|
|
2648
|
-
return new
|
|
2648
|
+
return new ue().one();
|
|
2649
2649
|
if (e.length === 1)
|
|
2650
2650
|
return e[0];
|
|
2651
2651
|
if (e.length === 2)
|
|
2652
|
-
return q(i =
|
|
2652
|
+
return q(i = ue, mt, ri).call(i, e[0], e[1]);
|
|
2653
2653
|
let t = e[0];
|
|
2654
2654
|
return e.shift(), e.forEach((n) => {
|
|
2655
2655
|
var r;
|
|
2656
|
-
return t = q(r =
|
|
2656
|
+
return t = q(r = ue, mt, ri).call(r, t, n);
|
|
2657
2657
|
}), t;
|
|
2658
2658
|
}
|
|
2659
2659
|
add(...e) {
|
|
2660
2660
|
let t = [this, ...e];
|
|
2661
|
-
const i =
|
|
2661
|
+
const i = ue.gcd(...t);
|
|
2662
2662
|
t = t.map((r) => r.divide(i).reduce());
|
|
2663
2663
|
const n = new O("0");
|
|
2664
2664
|
return t.forEach((r) => n.add(r.develop())), h(this, E, [
|
|
@@ -2676,13 +2676,13 @@ const me = class me {
|
|
|
2676
2676
|
return s(this, E).reduce((t, i) => t.add(i.degree(e)), new u("0"));
|
|
2677
2677
|
}
|
|
2678
2678
|
get denominator() {
|
|
2679
|
-
return s(this, E).filter((e) => e.power.isNegative());
|
|
2679
|
+
return new ue(...s(this, E).filter((e) => e.power.isNegative()));
|
|
2680
2680
|
}
|
|
2681
2681
|
derivative() {
|
|
2682
2682
|
const e = [], t = s(this, E).length;
|
|
2683
2683
|
for (let n = 0; n < t; n++) {
|
|
2684
2684
|
const r = s(this, E).slice(), l = r.splice(n, 1)[0];
|
|
2685
|
-
e.push(new
|
|
2685
|
+
e.push(new ue(...r).multiply(new ue(...l.derivative())));
|
|
2686
2686
|
}
|
|
2687
2687
|
e.forEach((n) => n.reduce());
|
|
2688
2688
|
const i = e.shift();
|
|
@@ -2727,7 +2727,7 @@ const me = class me {
|
|
|
2727
2727
|
return h(this, E, s(this, E).map((e) => e.inverse())), this;
|
|
2728
2728
|
}
|
|
2729
2729
|
isEqual(e) {
|
|
2730
|
-
const t =
|
|
2730
|
+
const t = ue.gcd(this, e), i = this.clone().divide(t).reduce(), n = e.clone().divide(t).reduce();
|
|
2731
2731
|
return i.isOne() && n.isOne();
|
|
2732
2732
|
}
|
|
2733
2733
|
isOne() {
|
|
@@ -2742,7 +2742,7 @@ const me = class me {
|
|
|
2742
2742
|
}), this;
|
|
2743
2743
|
}
|
|
2744
2744
|
get numerator() {
|
|
2745
|
-
return s(this, E).filter((e) => e.power.isPositive());
|
|
2745
|
+
return new ue(...s(this, E).filter((e) => e.power.isPositive()));
|
|
2746
2746
|
}
|
|
2747
2747
|
one() {
|
|
2748
2748
|
return h(this, E, [new le("1", "1")]), this;
|
|
@@ -2807,12 +2807,12 @@ tt = new WeakMap(), E = new WeakMap(), mt = new WeakSet(), ri = function(e, t) {
|
|
|
2807
2807
|
const d = i[c].reduce((g, N) => g.add(N.power), new u("0")), f = n[c].reduce((g, N) => g.add(N.power), new u("0"));
|
|
2808
2808
|
return new le(c, u.min(d, f));
|
|
2809
2809
|
});
|
|
2810
|
-
return new
|
|
2810
|
+
return new ue(...l);
|
|
2811
2811
|
}, gt = new WeakSet(), oi = function() {
|
|
2812
2812
|
let e, t = [];
|
|
2813
|
-
return s(this, tt) === at.ROOT ? (e = this.numerator, t = this.denominator.map((i) => i.clone().inverse())) : e = s(this, E), e.length === 0 && (e = [new le("1")]), { num: e, den: t };
|
|
2814
|
-
}, p(
|
|
2815
|
-
let ni =
|
|
2813
|
+
return s(this, tt) === at.ROOT ? (e = this.numerator.factors, t = this.denominator.factors.map((i) => i.clone().inverse())) : e = s(this, E), e.length === 0 && (e = [new le("1")]), { num: e, den: t };
|
|
2814
|
+
}, p(ue, mt);
|
|
2815
|
+
let ni = ue;
|
|
2816
2816
|
function ei(o) {
|
|
2817
2817
|
const e = new u().one(), t = o.factors.reduce((i, n) => {
|
|
2818
2818
|
if (n.polynom.degree().isZero())
|
|
@@ -3041,22 +3041,22 @@ var we = /* @__PURE__ */ ((o) => (o.None = "none", o.Parallel = "parallel", o.Pe
|
|
|
3041
3041
|
function qi(o = 0.5) {
|
|
3042
3042
|
return Math.random() < o;
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3044
|
+
function de(o, e, t) {
|
|
3045
3045
|
if (e === void 0)
|
|
3046
|
-
return o >= 0 ?
|
|
3046
|
+
return o >= 0 ? de(0, o) : de(o, 0);
|
|
3047
3047
|
if (o === e)
|
|
3048
3048
|
return o;
|
|
3049
3049
|
if (t === void 0)
|
|
3050
3050
|
return Math.floor(Math.random() * (e - o + 1) + o);
|
|
3051
3051
|
if (Math.abs(e - o) <= t.length)
|
|
3052
3052
|
throw new Error("The number of excluded values is too high.");
|
|
3053
|
-
let i =
|
|
3053
|
+
let i = de(o, e);
|
|
3054
3054
|
for (; t.includes(i); )
|
|
3055
|
-
i =
|
|
3055
|
+
i = de(o, e);
|
|
3056
3056
|
return i;
|
|
3057
3057
|
}
|
|
3058
3058
|
function Y(o, e) {
|
|
3059
|
-
return e === !1 ? qi() ?
|
|
3059
|
+
return e === !1 ? qi() ? de(1, o) : -de(1, o) : de(-o, o);
|
|
3060
3060
|
}
|
|
3061
3061
|
function rs(o) {
|
|
3062
3062
|
let e = G.primes();
|
|
@@ -3066,7 +3066,7 @@ function os(o, e) {
|
|
|
3066
3066
|
return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) : ki(o).slice(0, e);
|
|
3067
3067
|
}
|
|
3068
3068
|
function pi(o) {
|
|
3069
|
-
return o.length === 0 ? null : o[
|
|
3069
|
+
return o.length === 0 ? null : o[de(0, o.length - 1)];
|
|
3070
3070
|
}
|
|
3071
3071
|
function ki(o) {
|
|
3072
3072
|
const e = Object.values(o);
|
|
@@ -3984,12 +3984,12 @@ function Ot(o) {
|
|
|
3984
3984
|
},
|
|
3985
3985
|
o
|
|
3986
3986
|
), t = new u();
|
|
3987
|
-
if (e.negative ? t.numerator = Y(e.max, e.zero) : t.numerator =
|
|
3987
|
+
if (e.negative ? t.numerator = Y(e.max, e.zero) : t.numerator = de(e.zero ? 0 : 1, e.max), e.natural)
|
|
3988
3988
|
t.denominator = 1;
|
|
3989
3989
|
else {
|
|
3990
3990
|
let i = 0;
|
|
3991
3991
|
for (; t.isRelative() && i < 10; )
|
|
3992
|
-
t.denominator =
|
|
3992
|
+
t.denominator = de(1, e.max), i++;
|
|
3993
3993
|
}
|
|
3994
3994
|
return e.reduced ? t.reduce() : t;
|
|
3995
3995
|
}
|
|
@@ -4044,7 +4044,7 @@ function Bi(o) {
|
|
|
4044
4044
|
}), e.unit && e.degree === n && i.coefficient.one(), t.add(i);
|
|
4045
4045
|
if (e.positive && t.monomByDegree().coefficient.isNegative() && t.monomByDegree().coefficient.opposite(), e.numberOfMonoms && e.numberOfMonoms > 0 && e.numberOfMonoms < t.length)
|
|
4046
4046
|
for (; t.length > e.numberOfMonoms; ) {
|
|
4047
|
-
const n =
|
|
4047
|
+
const n = de(1, t.length - 1);
|
|
4048
4048
|
t.monoms.splice(n, 1);
|
|
4049
4049
|
}
|
|
4050
4050
|
return t.reduce();
|
|
@@ -4106,7 +4106,7 @@ function cs(o) {
|
|
|
4106
4106
|
o
|
|
4107
4107
|
), t = ui(e.center);
|
|
4108
4108
|
let i, n;
|
|
4109
|
-
return e.pointsOnCircle === 8 ? (i =
|
|
4109
|
+
return e.pointsOnCircle === 8 ? (i = de(1, 3), n = i ** 2 + (i + 1) ** 2) : n = de(1, 20), new Tt(t, n, !0);
|
|
4110
4110
|
}
|
|
4111
4111
|
function us(o) {
|
|
4112
4112
|
const e = Object.assign(
|
|
@@ -4148,7 +4148,7 @@ const ds = {
|
|
|
4148
4148
|
polynom: (o) => Bi(o),
|
|
4149
4149
|
monom: (o) => Pi(o),
|
|
4150
4150
|
fraction: (o) => Ot(o),
|
|
4151
|
-
number: (o, e, t) =>
|
|
4151
|
+
number: (o, e, t) => de(o, e, t),
|
|
4152
4152
|
numberSym: (o, e) => Y(o, e),
|
|
4153
4153
|
prime: (o) => rs(o),
|
|
4154
4154
|
bool: (o) => qi(o),
|