pimath 0.1.25 → 0.1.27
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 +296 -296
- package/dist/pimath.js.map +1 -1
- package/package.json +1 -1
package/dist/pimath.js
CHANGED
|
@@ -79,7 +79,7 @@ const U = {
|
|
|
79
79
|
round: Hi
|
|
80
80
|
};
|
|
81
81
|
var ut, x, v, Re;
|
|
82
|
-
const
|
|
82
|
+
const $ = class $ {
|
|
83
83
|
constructor(e, t) {
|
|
84
84
|
m(this, ut, !1);
|
|
85
85
|
m(this, x, 1);
|
|
@@ -114,22 +114,22 @@ const P = class P {
|
|
|
114
114
|
}
|
|
115
115
|
break;
|
|
116
116
|
case "object":
|
|
117
|
-
e instanceof
|
|
117
|
+
e instanceof $ && (h(this, v, +e.numerator), h(this, x, +e.denominator));
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
return this;
|
|
121
121
|
});
|
|
122
122
|
a(this, "clone", () => {
|
|
123
|
-
const e = new
|
|
123
|
+
const e = new $();
|
|
124
124
|
return e.numerator = +s(this, v), e.denominator = +s(this, x), e;
|
|
125
125
|
});
|
|
126
126
|
a(this, "abs", () => (h(this, v, Math.abs(s(this, v))), h(this, x, Math.abs(s(this, x))), this));
|
|
127
127
|
a(this, "add", (e) => {
|
|
128
|
-
if (e instanceof
|
|
128
|
+
if (e instanceof $) {
|
|
129
129
|
const t = s(this, v), i = s(this, x);
|
|
130
130
|
h(this, v, t * e.denominator + e.numerator * i), h(this, x, i * e.denominator);
|
|
131
131
|
} else
|
|
132
|
-
return this.add(new
|
|
132
|
+
return this.add(new $(e));
|
|
133
133
|
return this.reduce();
|
|
134
134
|
});
|
|
135
135
|
a(this, "amplify", (e) => (Number.isSafeInteger(e) && (h(this, v, s(this, v) * e), h(this, x, s(this, x) * e)), this));
|
|
@@ -146,7 +146,7 @@ const P = class P {
|
|
|
146
146
|
a(this, "compare", (e, t) => {
|
|
147
147
|
t === void 0 && (t = "=");
|
|
148
148
|
let i;
|
|
149
|
-
switch (e instanceof
|
|
149
|
+
switch (e instanceof $ ? i = e.clone() : i = new $(e), t) {
|
|
150
150
|
case ">":
|
|
151
151
|
return this.value > i.value;
|
|
152
152
|
case ">=":
|
|
@@ -168,9 +168,9 @@ const P = class P {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
a(this, "divide", (e) => {
|
|
171
|
-
const t = new
|
|
171
|
+
const t = new $(e);
|
|
172
172
|
if (t.numerator === 0)
|
|
173
|
-
return new
|
|
173
|
+
return new $().infinite();
|
|
174
174
|
const i = +s(this, v), n = +s(this, x);
|
|
175
175
|
return h(this, v, i * t.denominator), h(this, x, n * t.numerator), this.reduce();
|
|
176
176
|
});
|
|
@@ -188,7 +188,7 @@ const P = class P {
|
|
|
188
188
|
a(this, "isGeq", (e) => this.compare(e, ">="));
|
|
189
189
|
a(this, "isGreater", (e) => this.compare(e, ">"));
|
|
190
190
|
a(this, "isInfinity", () => Math.abs(s(this, v)) === 1 / 0);
|
|
191
|
-
a(this, "isInverted", (e) => this.isEqual(new
|
|
191
|
+
a(this, "isInverted", (e) => this.isEqual(new $().one().divide(e.clone())));
|
|
192
192
|
a(this, "isLeq", (e) => this.compare(e, "<="));
|
|
193
193
|
/* Compare shortcuts */
|
|
194
194
|
a(this, "isLesser", (e) => this.compare(e, "<"));
|
|
@@ -212,13 +212,13 @@ const P = class P {
|
|
|
212
212
|
// Mathematical operations specific to fractions
|
|
213
213
|
a(this, "isZero", () => s(this, v) === 0);
|
|
214
214
|
a(this, "multiply", (e) => {
|
|
215
|
-
const t = new
|
|
215
|
+
const t = new $(e);
|
|
216
216
|
return h(this, v, s(this, v) * t.numerator), h(this, x, s(this, x) * t.denominator), this.reduce();
|
|
217
217
|
});
|
|
218
218
|
a(this, "one", () => (h(this, v, 1), h(this, x, 1), this));
|
|
219
219
|
a(this, "opposite", () => (h(this, v, -s(this, v)), this));
|
|
220
220
|
a(this, "pow", (e) => {
|
|
221
|
-
if (e instanceof
|
|
221
|
+
if (e instanceof $)
|
|
222
222
|
return this.pow(e.value);
|
|
223
223
|
this.reduce(), e < 0 && this.inverse();
|
|
224
224
|
const t = Math.floor(Math.pow(s(this, v), Math.abs(e))), i = Math.floor(Math.pow(s(this, x), Math.abs(e)));
|
|
@@ -245,7 +245,7 @@ const P = class P {
|
|
|
245
245
|
// Getter and setter
|
|
246
246
|
a(this, "sign", () => s(this, v) * s(this, x) >= 0 ? 1 : -1);
|
|
247
247
|
a(this, "sqrt", () => this.root(2));
|
|
248
|
-
a(this, "subtract", (e) => e instanceof
|
|
248
|
+
a(this, "subtract", (e) => e instanceof $ ? this.add(e.clone().opposite()) : this.add(-e));
|
|
249
249
|
a(this, "zero", () => (h(this, v, 0), h(this, x, 1), this));
|
|
250
250
|
return e !== void 0 && this.parse(e, t), this;
|
|
251
251
|
}
|
|
@@ -286,55 +286,55 @@ const P = class P {
|
|
|
286
286
|
return e === 0 ? 0 : e;
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
|
-
ut = new WeakMap(), x = new WeakMap(), v = new WeakMap(), Re = new WeakMap(), a(
|
|
290
|
-
const t = new
|
|
289
|
+
ut = new WeakMap(), x = new WeakMap(), v = new WeakMap(), Re = new WeakMap(), a($, "average", (...e) => {
|
|
290
|
+
const t = new $().zero();
|
|
291
291
|
for (const i of e)
|
|
292
292
|
t.add(i);
|
|
293
293
|
return t.divide(e.length), t;
|
|
294
|
-
}), a(
|
|
295
|
-
let t = new
|
|
294
|
+
}), a($, "max", (...e) => {
|
|
295
|
+
let t = new $(e[0]);
|
|
296
296
|
for (const i of e) {
|
|
297
|
-
const n = new
|
|
297
|
+
const n = new $(i);
|
|
298
298
|
n.isGreater(t) && (t = n.clone());
|
|
299
299
|
}
|
|
300
300
|
return t;
|
|
301
|
-
}), a(
|
|
302
|
-
let t = new
|
|
301
|
+
}), a($, "min", (...e) => {
|
|
302
|
+
let t = new $(e[0]);
|
|
303
303
|
for (const i of e) {
|
|
304
|
-
const n = new
|
|
304
|
+
const n = new $(i);
|
|
305
305
|
n.isLesser(t) && (t = n.clone());
|
|
306
306
|
}
|
|
307
307
|
return t;
|
|
308
|
-
}), a(
|
|
309
|
-
const n = e.map((r) => r instanceof
|
|
308
|
+
}), a($, "sort", (e, t) => {
|
|
309
|
+
const n = e.map((r) => r instanceof $ ? r : new $(r)).sort((r, l) => r.value - l.value);
|
|
310
310
|
return t && n.reverse(), n;
|
|
311
311
|
}), // ------------------------------------------
|
|
312
312
|
// Compare functions
|
|
313
|
-
a(
|
|
313
|
+
a($, "unique", (e) => {
|
|
314
314
|
const t = {}, i = [];
|
|
315
315
|
return e.forEach((n) => {
|
|
316
|
-
n instanceof
|
|
316
|
+
n instanceof $ || (n = new $(n)), t[n.clone().reduce().tex] || (i.push(n.clone()), t[n.tex] = !0);
|
|
317
317
|
}), i;
|
|
318
|
-
}), a(
|
|
319
|
-
const t = new
|
|
318
|
+
}), a($, "xMultiply", (...e) => {
|
|
319
|
+
const t = new $();
|
|
320
320
|
for (const i of e) {
|
|
321
|
-
const n = new
|
|
321
|
+
const n = new $(i);
|
|
322
322
|
t.numerator = t.numerator * n.numerator, t.denominator = t.denominator * n.denominator;
|
|
323
323
|
}
|
|
324
324
|
return t;
|
|
325
325
|
});
|
|
326
|
-
let u =
|
|
327
|
-
var Z, ie,
|
|
326
|
+
let u = $;
|
|
327
|
+
var Z, ie, re, Ye;
|
|
328
328
|
class vt {
|
|
329
329
|
constructor(...e) {
|
|
330
330
|
m(this, Z);
|
|
331
331
|
m(this, ie);
|
|
332
|
-
m(this,
|
|
332
|
+
m(this, re);
|
|
333
333
|
m(this, Ye);
|
|
334
334
|
// ------------------------------------------
|
|
335
335
|
// Creation / parsing functions
|
|
336
336
|
// ------------------------------------------
|
|
337
|
-
a(this, "parse", (e, t, i) => (h(this,
|
|
337
|
+
a(this, "parse", (e, t, i) => (h(this, re, i ?? 1), h(this, ie, t ?? 2), h(this, Z, e), s(this, ie) % 2 === 0 && s(this, Z) < 0 && h(this, Ye, !1), this));
|
|
338
338
|
// ------------------------------------------
|
|
339
339
|
// Mathematical operations
|
|
340
340
|
// ------------------------------------------
|
|
@@ -342,7 +342,7 @@ class vt {
|
|
|
342
342
|
let e = Math.floor(Math.pow(s(this, Z), 1 / s(this, ie)));
|
|
343
343
|
for (; e > 1; ) {
|
|
344
344
|
if (s(this, Z) % Math.pow(e, s(this, ie)) === 0) {
|
|
345
|
-
h(this,
|
|
345
|
+
h(this, re, s(this, re) * e), h(this, Z, s(this, Z) / Math.pow(e, s(this, ie))), e = Math.floor(Math.pow(s(this, Z), 1 / s(this, ie)));
|
|
346
346
|
continue;
|
|
347
347
|
}
|
|
348
348
|
e--;
|
|
@@ -354,7 +354,7 @@ class vt {
|
|
|
354
354
|
// Help functions
|
|
355
355
|
// ------------------------------------------
|
|
356
356
|
a(this, "hasRadical", () => !(s(this, Z) === 1 || s(this, Z) === 0 || !s(this, Ye)));
|
|
357
|
-
h(this, Z, 1), h(this,
|
|
357
|
+
h(this, Z, 1), h(this, re, 1), h(this, ie, 2), h(this, Ye, !0), e.length > 0 && this.parse(e[0], e[1], e[2]);
|
|
358
358
|
}
|
|
359
359
|
// ------------------------------------------
|
|
360
360
|
// Getter and setter
|
|
@@ -372,24 +372,24 @@ class vt {
|
|
|
372
372
|
Number.isSafeInteger(e) && e >= 2 ? h(this, ie, e) : (console.log("Error setting the nth root"), h(this, ie, 2));
|
|
373
373
|
}
|
|
374
374
|
get coefficient() {
|
|
375
|
-
return s(this,
|
|
375
|
+
return s(this, re);
|
|
376
376
|
}
|
|
377
377
|
set coefficient(e) {
|
|
378
|
-
h(this,
|
|
378
|
+
h(this, re, e);
|
|
379
379
|
}
|
|
380
380
|
get tex() {
|
|
381
381
|
let e;
|
|
382
|
-
return s(this,
|
|
382
|
+
return s(this, re) === 1 ? e = "" : s(this, re) === -1 ? e = "-" : e = s(this, re).toString(), s(this, Z) === 1 ? `${s(this, re)}` : s(this, ie) === 2 ? `${e}\\sqrt{${s(this, Z)}}` : `${e}\\sqrt[${s(this, ie)}]{${s(this, Z)}}`;
|
|
383
383
|
}
|
|
384
384
|
get display() {
|
|
385
385
|
let e;
|
|
386
|
-
return s(this,
|
|
386
|
+
return s(this, re) === 1 ? e = "" : s(this, re) === -1 ? e = "-" : e = s(this, re).toString(), s(this, Z) === 1 ? `${s(this, re)}` : s(this, ie) === 2 ? `${e}sqrt{${s(this, Z)}}` : `${e}root(${s(this, ie)}){${s(this, Z)}}`;
|
|
387
387
|
}
|
|
388
388
|
get value() {
|
|
389
|
-
return s(this,
|
|
389
|
+
return s(this, re) * Math.pow(s(this, Z), 1 / s(this, ie));
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
Z = new WeakMap(), ie = new WeakMap(),
|
|
392
|
+
Z = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), Ye = new WeakMap();
|
|
393
393
|
var K, Fe, C, Ge, ge, vi, bi, xi, Ei, Ni, Ai, Ti;
|
|
394
394
|
const pi = class pi {
|
|
395
395
|
constructor(e, t, i = "x") {
|
|
@@ -661,10 +661,10 @@ const Ji = {
|
|
|
661
661
|
"!": { precedence: 4, associative: "right", type: g.OPERATION },
|
|
662
662
|
"-": { precedence: 2, associative: "left", type: g.OPERATION }
|
|
663
663
|
};
|
|
664
|
-
var He, at,
|
|
664
|
+
var He, at, ne, bt, Ve;
|
|
665
665
|
class Kt {
|
|
666
666
|
constructor(e) {
|
|
667
|
-
ot(this, He), ot(this, at, []), ot(this,
|
|
667
|
+
ot(this, He), ot(this, at, []), ot(this, ne, {}), ot(this, bt, []), ot(this, Ve), Ee(this, He, typeof e > "u" ? Ze.POLYNOM : e), this.tokenConfigInitialization();
|
|
668
668
|
}
|
|
669
669
|
// Getter
|
|
670
670
|
get rpn() {
|
|
@@ -674,7 +674,7 @@ class Kt {
|
|
|
674
674
|
return te(this, at).map((e) => e.token);
|
|
675
675
|
}
|
|
676
676
|
tokenConfigInitialization() {
|
|
677
|
-
return te(this, He) === Ze.SET ? (Ee(this,
|
|
677
|
+
return te(this, He) === Ze.SET ? (Ee(this, ne, ts), Ee(this, Ve, !1)) : te(this, He) === Ze.NUMERIC ? (Ee(this, ne, es), Ee(this, Ve, !0)) : te(this, He) === Ze.EXPRESSION ? (Ee(this, ne, _i), Ee(this, Ve, !0)) : (Ee(this, ne, Ji), Ee(this, Ve, !0)), Ee(this, bt, Object.keys(te(this, ne)).sort((e, t) => t.length - e.length)), te(this, ne);
|
|
678
678
|
}
|
|
679
679
|
/**
|
|
680
680
|
* Get the next token to analyse.
|
|
@@ -692,7 +692,7 @@ class Kt {
|
|
|
692
692
|
else {
|
|
693
693
|
for (const r of te(this, bt))
|
|
694
694
|
if (e.substring(t, t + r.length) === r) {
|
|
695
|
-
i += r, n = te(this,
|
|
695
|
+
i += r, n = te(this, ne)[r].type;
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
698
|
for (const r in fi)
|
|
@@ -723,7 +723,7 @@ class Kt {
|
|
|
723
723
|
parse(e, t) {
|
|
724
724
|
const i = [], n = [];
|
|
725
725
|
let r = "", l = 0, c;
|
|
726
|
-
(t ?? te(this, Ve)) && (e = Qi(e, te(this,
|
|
726
|
+
(t ?? te(this, Ve)) && (e = Qi(e, te(this, ne)));
|
|
727
727
|
const f = 50;
|
|
728
728
|
let d = 50, p;
|
|
729
729
|
for (; l < e.length; ) {
|
|
@@ -744,9 +744,9 @@ class Kt {
|
|
|
744
744
|
case g.OPERATION:
|
|
745
745
|
if (n.length > 0) {
|
|
746
746
|
let w = n[n.length - 1];
|
|
747
|
-
for (p = +f; w.token in te(this,
|
|
748
|
-
(te(this,
|
|
749
|
-
te(this,
|
|
747
|
+
for (p = +f; w.token in te(this, ne) && //either o1 is left-associative and its precedence is less than or equal to that of o2,
|
|
748
|
+
(te(this, ne)[r].associative === "left" && te(this, ne)[r].precedence <= te(this, ne)[w.token].precedence || //or o1 is right associative, and has precedence less than that of o2,
|
|
749
|
+
te(this, ne)[r].associative === "right" && te(this, ne)[r].precedence < te(this, ne)[w.token].precedence); ) {
|
|
750
750
|
if (p--, p === 0) {
|
|
751
751
|
console.log("SECURITY LEVEL 2 OPERATION EXIT");
|
|
752
752
|
break;
|
|
@@ -790,7 +790,7 @@ class Kt {
|
|
|
790
790
|
return Ee(this, at, i.concat(n.reverse())), this;
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
He = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(),
|
|
793
|
+
He = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap();
|
|
794
794
|
class is {
|
|
795
795
|
constructor(e, t) {
|
|
796
796
|
ei(this, "_rpn"), ei(this, "_expression"), ei(this, "_isValid"), this._expression = e;
|
|
@@ -891,7 +891,7 @@ class is {
|
|
|
891
891
|
return +e.toFixed(t);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
var T, b, Qe, xt, ze,
|
|
894
|
+
var T, b, Qe, xt, ze, kt, Mt;
|
|
895
895
|
const I = class I {
|
|
896
896
|
constructor(e) {
|
|
897
897
|
m(this, Qe);
|
|
@@ -1146,7 +1146,7 @@ const I = class I {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
return t;
|
|
1148
1148
|
});
|
|
1149
|
-
m(this,
|
|
1149
|
+
m(this, kt, (e) => {
|
|
1150
1150
|
const i = new Kt().parse(e).rpn, n = [];
|
|
1151
1151
|
if (i.length === 0)
|
|
1152
1152
|
return this.zero(), this;
|
|
@@ -1155,10 +1155,10 @@ const I = class I {
|
|
|
1155
1155
|
return this.one(), r.tokenType === g.COEFFICIENT ? this.coefficient = new u(r.token) : r.tokenType === g.VARIABLE && this.setLetter(r.token, 1), this;
|
|
1156
1156
|
} else
|
|
1157
1157
|
for (const r of i)
|
|
1158
|
-
s(this,
|
|
1158
|
+
s(this, Mt).call(this, n, r);
|
|
1159
1159
|
return this.one(), this.multiply(n[0]), this;
|
|
1160
1160
|
});
|
|
1161
|
-
m(this,
|
|
1161
|
+
m(this, Mt, (e, t) => {
|
|
1162
1162
|
var f;
|
|
1163
1163
|
let i, n, r, l, c;
|
|
1164
1164
|
if (t.tokenType === g.COEFFICIENT)
|
|
@@ -1191,7 +1191,7 @@ const I = class I {
|
|
|
1191
1191
|
* @param inputStr
|
|
1192
1192
|
*/
|
|
1193
1193
|
parse(e) {
|
|
1194
|
-
return h(this, T, new u()), h(this, b, {}), typeof e == "string" ? s(this,
|
|
1194
|
+
return h(this, T, new u()), h(this, b, {}), typeof e == "string" ? s(this, kt).call(this, e) : typeof e == "number" ? h(this, T, new u(e)) : e instanceof u ? h(this, T, e.clone()) : e instanceof I && (h(this, T, s(e, T).clone()), A(this, Qe, xt).call(this, e)), this;
|
|
1195
1195
|
}
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Get the coefficient \\(k\\) of the Monom \\(k\\cdot x^{n}\\)
|
|
@@ -1340,7 +1340,7 @@ const I = class I {
|
|
|
1340
1340
|
T = new WeakMap(), b = new WeakMap(), Qe = new WeakSet(), xt = function(e) {
|
|
1341
1341
|
for (const t in e.literal)
|
|
1342
1342
|
s(this, b)[t] = e.literal[t].clone();
|
|
1343
|
-
}, ze = new WeakMap(),
|
|
1343
|
+
}, ze = new WeakMap(), kt = new WeakMap(), Mt = new WeakMap(), a(I, "gcd", (...e) => {
|
|
1344
1344
|
for (const r of e)
|
|
1345
1345
|
if (r.containsRationalPower())
|
|
1346
1346
|
return new I().zero();
|
|
@@ -1363,15 +1363,15 @@ a(I, "xMultiply", (...e) => {
|
|
|
1363
1363
|
t.multiply(i);
|
|
1364
1364
|
return t;
|
|
1365
1365
|
});
|
|
1366
|
-
let
|
|
1366
|
+
let M = I;
|
|
1367
1367
|
function yi(o, e = !0) {
|
|
1368
1368
|
return e ? `\\left( ${o} \\right)` : `(${o})`;
|
|
1369
1369
|
}
|
|
1370
1370
|
function Et(o, e, t, i, n) {
|
|
1371
1371
|
return o.map((r, l) => r === e ? t : r);
|
|
1372
1372
|
}
|
|
1373
|
-
var je, y, Ke, ft, Je, dt, Ct, $t,
|
|
1374
|
-
const
|
|
1373
|
+
var je, y, Ke, ft, Je, dt, Ct, Pt, $t, _e, It, pt, St, Bt, Rt, zt, ki, Lt, Vt;
|
|
1374
|
+
const P = class P {
|
|
1375
1375
|
constructor(e, ...t) {
|
|
1376
1376
|
m(this, zt);
|
|
1377
1377
|
m(this, je);
|
|
@@ -1385,14 +1385,14 @@ const $ = class $ {
|
|
|
1385
1385
|
*/
|
|
1386
1386
|
a(this, "parse", (e, ...t) => {
|
|
1387
1387
|
if (h(this, y, []), h(this, je, []), typeof e == "string")
|
|
1388
|
-
return A(this, zt,
|
|
1389
|
-
if ((typeof e == "number" || e instanceof u || e instanceof
|
|
1390
|
-
s(this, y).push(new
|
|
1391
|
-
else if (e instanceof
|
|
1392
|
-
s(this, y).push(new
|
|
1393
|
-
s(this, y).push(new
|
|
1388
|
+
return A(this, zt, ki).call(this, e, ...t);
|
|
1389
|
+
if ((typeof e == "number" || e instanceof u || e instanceof M) && t.length === 0)
|
|
1390
|
+
s(this, y).push(new M(e));
|
|
1391
|
+
else if (e instanceof M && t.length > 0)
|
|
1392
|
+
s(this, y).push(new M(e)), t.forEach((i) => {
|
|
1393
|
+
s(this, y).push(new M(i));
|
|
1394
1394
|
});
|
|
1395
|
-
else if (e instanceof
|
|
1395
|
+
else if (e instanceof P)
|
|
1396
1396
|
for (const i of e.monoms)
|
|
1397
1397
|
s(this, y).push(i.clone());
|
|
1398
1398
|
return this;
|
|
@@ -1401,18 +1401,18 @@ const $ = class $ {
|
|
|
1401
1401
|
* Clone the polynom
|
|
1402
1402
|
*/
|
|
1403
1403
|
a(this, "clone", () => {
|
|
1404
|
-
const e = new
|
|
1404
|
+
const e = new P(), t = [];
|
|
1405
1405
|
for (const i of s(this, y))
|
|
1406
1406
|
t.push(i.clone());
|
|
1407
1407
|
return e.monoms = t, e;
|
|
1408
1408
|
});
|
|
1409
1409
|
a(this, "add", (...e) => {
|
|
1410
1410
|
for (const t of e)
|
|
1411
|
-
t instanceof
|
|
1411
|
+
t instanceof P ? h(this, y, s(this, y).concat(t.monoms)) : t instanceof M ? s(this, y).push(t.clone()) : typeof t == "number" && Number.isSafeInteger(t) ? s(this, y).push(new M(t.toString())) : s(this, y).push(new M(t));
|
|
1412
1412
|
return this.reduce();
|
|
1413
1413
|
});
|
|
1414
1414
|
a(this, "commonMonom", () => {
|
|
1415
|
-
const e = new
|
|
1415
|
+
const e = new M().one(), t = this.gcdNumerator(), i = this.gcdDenominator(), n = this.degree();
|
|
1416
1416
|
e.coefficient = new u(t, i);
|
|
1417
1417
|
for (const r of this.variables) {
|
|
1418
1418
|
e.setLetter(r, n);
|
|
@@ -1429,7 +1429,7 @@ const $ = class $ {
|
|
|
1429
1429
|
return t;
|
|
1430
1430
|
});
|
|
1431
1431
|
a(this, "derivative", (e) => {
|
|
1432
|
-
const t = new
|
|
1432
|
+
const t = new P();
|
|
1433
1433
|
for (const i of s(this, y))
|
|
1434
1434
|
t.add(i.derivative(e));
|
|
1435
1435
|
return t.reduce();
|
|
@@ -1439,9 +1439,9 @@ const $ = class $ {
|
|
|
1439
1439
|
return s(this, dt).call(this, e);
|
|
1440
1440
|
if (typeof e == "number" && Number.isSafeInteger(e))
|
|
1441
1441
|
return s(this, Ct).call(this, e);
|
|
1442
|
-
if (e instanceof
|
|
1443
|
-
return this.divide(new
|
|
1444
|
-
if (e instanceof
|
|
1442
|
+
if (e instanceof M)
|
|
1443
|
+
return this.divide(new P(e));
|
|
1444
|
+
if (e instanceof P) {
|
|
1445
1445
|
if (e.monoms.length === 1 && e.variables.length === 0)
|
|
1446
1446
|
return s(this, dt).call(this, e.monoms[0].coefficient);
|
|
1447
1447
|
{
|
|
@@ -1450,7 +1450,7 @@ const $ = class $ {
|
|
|
1450
1450
|
return h(this, y, t.monoms), this;
|
|
1451
1451
|
}
|
|
1452
1452
|
} else if (typeof e == "string")
|
|
1453
|
-
return this.divide(new
|
|
1453
|
+
return this.divide(new P(e));
|
|
1454
1454
|
throw new Error(`Cannot divide by ${e}`);
|
|
1455
1455
|
});
|
|
1456
1456
|
a(this, "empty", () => (h(this, y, []), this));
|
|
@@ -1460,11 +1460,11 @@ const $ = class $ {
|
|
|
1460
1460
|
* returns {quotient: Polynom, reminder: Polynom}
|
|
1461
1461
|
*/
|
|
1462
1462
|
a(this, "euclidean", (e) => {
|
|
1463
|
-
const t = e.variables[0], i = new
|
|
1463
|
+
const t = e.variables[0], i = new P().zero(), n = this.clone().reorder(t);
|
|
1464
1464
|
if (e.variables.length === 0)
|
|
1465
1465
|
return {
|
|
1466
1466
|
quotient: this.clone().divide(e).reduce(),
|
|
1467
|
-
reminder: new
|
|
1467
|
+
reminder: new P().zero()
|
|
1468
1468
|
};
|
|
1469
1469
|
const r = e.monomByDegree(void 0, t), l = e.degree(t);
|
|
1470
1470
|
let c, f = this.degree(t).value * 2;
|
|
@@ -1474,7 +1474,7 @@ const $ = class $ {
|
|
|
1474
1474
|
});
|
|
1475
1475
|
a(this, "evaluate", (e, t) => {
|
|
1476
1476
|
if (t)
|
|
1477
|
-
return s(this,
|
|
1477
|
+
return s(this, Pt).call(this, e);
|
|
1478
1478
|
const i = new u().zero();
|
|
1479
1479
|
return s(this, y).forEach((n) => {
|
|
1480
1480
|
i.add(n.evaluate(e, t));
|
|
@@ -1489,7 +1489,7 @@ const $ = class $ {
|
|
|
1489
1489
|
let t = [], i = this.clone().reorder();
|
|
1490
1490
|
const n = i.commonMonom();
|
|
1491
1491
|
if (i.monomByDegree().coefficient.isStrictlyNegative() && n.coefficient.isStrictlyPositive() && !n.isOne() && n.opposite(), !n.isOne()) {
|
|
1492
|
-
const c = new
|
|
1492
|
+
const c = new P(n);
|
|
1493
1493
|
t = [c.clone()], i = i.euclidean(c).quotient;
|
|
1494
1494
|
}
|
|
1495
1495
|
let r = i.degree().clone().multiply(2).value, l = 1;
|
|
@@ -1543,7 +1543,7 @@ const $ = class $ {
|
|
|
1543
1543
|
if (i.includes("(") || i.includes(")"))
|
|
1544
1544
|
return !1;
|
|
1545
1545
|
try {
|
|
1546
|
-
t = new
|
|
1546
|
+
t = new P(e);
|
|
1547
1547
|
} catch {
|
|
1548
1548
|
return !1;
|
|
1549
1549
|
}
|
|
@@ -1563,7 +1563,7 @@ const $ = class $ {
|
|
|
1563
1563
|
a(this, "isReduced", (e) => {
|
|
1564
1564
|
if (!this.isDeveloped(e))
|
|
1565
1565
|
return !1;
|
|
1566
|
-
const t = new
|
|
1566
|
+
const t = new P(e);
|
|
1567
1567
|
if (t.monoms.length > this.monoms.length)
|
|
1568
1568
|
return !1;
|
|
1569
1569
|
for (const i of t.monoms)
|
|
@@ -1595,7 +1595,7 @@ const $ = class $ {
|
|
|
1595
1595
|
for (const n of s(i, y))
|
|
1596
1596
|
if (n.degree(t).isEqual(e))
|
|
1597
1597
|
return n.clone();
|
|
1598
|
-
return new
|
|
1598
|
+
return new M().zero();
|
|
1599
1599
|
});
|
|
1600
1600
|
// Used in LinearSystem.tex
|
|
1601
1601
|
a(this, "monomByLetter", (e) => {
|
|
@@ -1603,7 +1603,7 @@ const $ = class $ {
|
|
|
1603
1603
|
for (const i of s(t, y))
|
|
1604
1604
|
if (i.hasVariable(e))
|
|
1605
1605
|
return i.clone();
|
|
1606
|
-
return new
|
|
1606
|
+
return new M().zero();
|
|
1607
1607
|
});
|
|
1608
1608
|
a(this, "monomsByDegree", (e, t) => {
|
|
1609
1609
|
if (e === void 0)
|
|
@@ -1613,8 +1613,8 @@ const $ = class $ {
|
|
|
1613
1613
|
r.degree(t).isEqual(e) && i.push(r.clone());
|
|
1614
1614
|
return i;
|
|
1615
1615
|
});
|
|
1616
|
-
a(this, "multiply", (e) => e instanceof
|
|
1617
|
-
a(this, "one", () => (h(this, y, []), s(this, y).push(new
|
|
1616
|
+
a(this, "multiply", (e) => e instanceof P ? s(this, Rt).call(this, e) : e instanceof u ? s(this, pt).call(this, e) : e instanceof M ? s(this, Bt).call(this, e) : Number.isSafeInteger(e) && typeof e == "number" ? s(this, St).call(this, e) : this);
|
|
1617
|
+
a(this, "one", () => (h(this, y, []), s(this, y).push(new M().one()), this));
|
|
1618
1618
|
// ------------------------------------------
|
|
1619
1619
|
a(this, "opposite", () => (h(this, y, s(this, y).map((e) => e.opposite())), this));
|
|
1620
1620
|
a(this, "pow", (e) => {
|
|
@@ -1623,14 +1623,14 @@ const $ = class $ {
|
|
|
1623
1623
|
if (e < 0)
|
|
1624
1624
|
return this.zero();
|
|
1625
1625
|
if (e === 0)
|
|
1626
|
-
return new
|
|
1626
|
+
return new P();
|
|
1627
1627
|
const t = this.clone();
|
|
1628
1628
|
for (let i = 1; i < e; i++)
|
|
1629
1629
|
this.multiply(t);
|
|
1630
1630
|
return this.reduce();
|
|
1631
1631
|
});
|
|
1632
1632
|
a(this, "primitive", (e) => {
|
|
1633
|
-
const t = new
|
|
1633
|
+
const t = new P();
|
|
1634
1634
|
for (const i of s(this, y))
|
|
1635
1635
|
t.add(i.primitive(e));
|
|
1636
1636
|
return t;
|
|
@@ -1639,13 +1639,13 @@ const $ = class $ {
|
|
|
1639
1639
|
let e = 0;
|
|
1640
1640
|
for (; e < s(this, y).length; ) {
|
|
1641
1641
|
for (let t = e + 1; t < s(this, y).length; t++)
|
|
1642
|
-
s(this, y)[e].isSameAs(s(this, y)[t]) && (s(this, y)[e].add(s(this, y)[t]), s(this, y).splice(t, 1), s(this, y)[e].isZero() && (s(this, y)[e] = new
|
|
1642
|
+
s(this, y)[e].isSameAs(s(this, y)[t]) && (s(this, y)[e].add(s(this, y)[t]), s(this, y).splice(t, 1), s(this, y)[e].isZero() && (s(this, y)[e] = new M().zero()), t--);
|
|
1643
1643
|
e++;
|
|
1644
1644
|
}
|
|
1645
1645
|
h(this, y, s(this, y).filter((t) => !t.coefficient.isZero()));
|
|
1646
1646
|
for (const t of s(this, y))
|
|
1647
1647
|
t.coefficient.reduce();
|
|
1648
|
-
return this.length === 0 ? new
|
|
1648
|
+
return this.length === 0 ? new P().zero() : this.reorder();
|
|
1649
1649
|
});
|
|
1650
1650
|
// ------------------------------------------
|
|
1651
1651
|
a(this, "reorder", (e = "x", t) => {
|
|
@@ -1671,21 +1671,21 @@ const $ = class $ {
|
|
|
1671
1671
|
*/
|
|
1672
1672
|
a(this, "replaceBy", (e, t) => {
|
|
1673
1673
|
let i;
|
|
1674
|
-
const n = new
|
|
1674
|
+
const n = new P().zero();
|
|
1675
1675
|
for (const r of this.monoms)
|
|
1676
1676
|
!r.hasVariable(e) || r.literal[e].isZero() ? n.add(r.clone()) : (i = r.literal[e].clone(), r.removeVariable(e), n.add(t.clone().pow(Math.abs(i.numerator)).multiply(r)));
|
|
1677
1677
|
return h(this, y, n.reduce().monoms), this;
|
|
1678
1678
|
});
|
|
1679
1679
|
a(this, "subtract", (...e) => {
|
|
1680
1680
|
for (const t of e)
|
|
1681
|
-
t instanceof
|
|
1681
|
+
t instanceof P ? this.add(t.clone().opposite()) : t instanceof M ? s(this, y).push(t.clone().opposite()) : s(this, y).push(new M(t).opposite());
|
|
1682
1682
|
return this.reduce();
|
|
1683
1683
|
});
|
|
1684
1684
|
/**
|
|
1685
1685
|
* Set the polynom to zero.
|
|
1686
1686
|
* @returns {this}
|
|
1687
1687
|
*/
|
|
1688
|
-
a(this, "zero", () => (h(this, y, []), s(this, y).push(new
|
|
1688
|
+
a(this, "zero", () => (h(this, y, []), s(this, y).push(new M().zero()), this));
|
|
1689
1689
|
m(this, Je, (e, t) => {
|
|
1690
1690
|
t === void 0 && (t = "=");
|
|
1691
1691
|
const i = this.clone().reduce().reorder(), n = e.clone().reduce().reorder();
|
|
@@ -1709,26 +1709,26 @@ const $ = class $ {
|
|
|
1709
1709
|
i.coefficient.divide(t);
|
|
1710
1710
|
return this;
|
|
1711
1711
|
});
|
|
1712
|
-
m(this,
|
|
1712
|
+
m(this, Pt, (e) => {
|
|
1713
1713
|
let t = 0;
|
|
1714
1714
|
return s(this, y).forEach((i) => {
|
|
1715
1715
|
t += i.evaluate(e, !0);
|
|
1716
1716
|
}), t;
|
|
1717
1717
|
});
|
|
1718
|
-
m(this,
|
|
1718
|
+
m(this, $t, (e) => {
|
|
1719
1719
|
var w;
|
|
1720
1720
|
let t, i, n, r, l, c, f, d, p;
|
|
1721
1721
|
if (this.numberOfVars === 1)
|
|
1722
|
-
return n = this.monomByDegree(2, e).coefficient, r = this.monomByDegree(1, e).coefficient, l = this.monomByDegree(0, e).coefficient, c = r.clone().pow(2).subtract(n.clone().multiply(l).multiply(4)), c.isZero() ? (f = r.clone().opposite().divide(n.clone().multiply(2)), t = new
|
|
1723
|
-
new
|
|
1724
|
-
new
|
|
1722
|
+
return n = this.monomByDegree(2, e).coefficient, r = this.monomByDegree(1, e).coefficient, l = this.monomByDegree(0, e).coefficient, c = r.clone().pow(2).subtract(n.clone().multiply(l).multiply(4)), c.isZero() ? (f = r.clone().opposite().divide(n.clone().multiply(2)), t = new P(e).subtract(f.display).multiply(f.denominator), i = new P(e).subtract(f.display).multiply(f.denominator), p = n.divide(f.denominator).divide(f.denominator), p.isOne() ? [t, i] : [new P(p.display), t, i]) : c.isPositive() && c.isSquare() ? (f = r.clone().opposite().add(c.clone().sqrt()).divide(n.clone().multiply(2)), d = r.clone().opposite().subtract(c.clone().sqrt()).divide(n.clone().multiply(2)), p = n.divide(f.denominator).divide(d.denominator), p.isOne() ? [
|
|
1723
|
+
new P(e).subtract(f.display).multiply(f.denominator),
|
|
1724
|
+
new P(e).subtract(d.display).multiply(d.denominator)
|
|
1725
1725
|
] : [
|
|
1726
|
-
new
|
|
1727
|
-
new
|
|
1728
|
-
new
|
|
1726
|
+
new P(p.display),
|
|
1727
|
+
new P(e).subtract(f.display).multiply(f.denominator),
|
|
1728
|
+
new P(e).subtract(d.display).multiply(d.denominator)
|
|
1729
1729
|
]) : [this.clone()];
|
|
1730
1730
|
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))) {
|
|
1731
|
-
const V = new
|
|
1731
|
+
const V = new P("x", n.coefficient, r.coefficient, l.coefficient), ce = s(w = V, $t).call(w, "x"), ue = [];
|
|
1732
1732
|
let fe;
|
|
1733
1733
|
if (ce.length >= 2) {
|
|
1734
1734
|
for (const ye of ce)
|
|
@@ -1752,7 +1752,7 @@ const $ = class $ {
|
|
|
1752
1752
|
const n = e.monoms[0].dividers, r = e.monoms[e.monoms.length - 1].dividers, l = [];
|
|
1753
1753
|
return n.forEach((c) => {
|
|
1754
1754
|
c.degree(i).isLeq(t) && r.forEach((f) => {
|
|
1755
|
-
c.degree(i).isNotEqual(f.degree(i)) && (l.push(new
|
|
1755
|
+
c.degree(i).isNotEqual(f.degree(i)) && (l.push(new P(c, f)), l.push(new P(c, f.clone().opposite())));
|
|
1756
1756
|
});
|
|
1757
1757
|
}), l;
|
|
1758
1758
|
});
|
|
@@ -1761,8 +1761,8 @@ const $ = class $ {
|
|
|
1761
1761
|
t.coefficient.multiply(e);
|
|
1762
1762
|
return this.reduce();
|
|
1763
1763
|
});
|
|
1764
|
-
m(this,
|
|
1765
|
-
m(this,
|
|
1764
|
+
m(this, St, (e) => s(this, pt).call(this, new u(e)));
|
|
1765
|
+
m(this, Bt, (e) => {
|
|
1766
1766
|
for (const t of s(this, y))
|
|
1767
1767
|
t.multiply(e);
|
|
1768
1768
|
return this.reduce();
|
|
@@ -1771,7 +1771,7 @@ const $ = class $ {
|
|
|
1771
1771
|
const t = [];
|
|
1772
1772
|
for (const i of s(this, y))
|
|
1773
1773
|
for (const n of e.monoms)
|
|
1774
|
-
t.push(
|
|
1774
|
+
t.push(M.xMultiply(i, n));
|
|
1775
1775
|
return h(this, y, t), this.reduce();
|
|
1776
1776
|
});
|
|
1777
1777
|
/**
|
|
@@ -1789,10 +1789,10 @@ const $ = class $ {
|
|
|
1789
1789
|
m(this, Vt, (e, t) => {
|
|
1790
1790
|
switch (t.tokenType) {
|
|
1791
1791
|
case g.COEFFICIENT:
|
|
1792
|
-
e.push(new
|
|
1792
|
+
e.push(new P(t.token));
|
|
1793
1793
|
break;
|
|
1794
1794
|
case g.VARIABLE:
|
|
1795
|
-
e.push(new
|
|
1795
|
+
e.push(new P().add(new M(t.token)));
|
|
1796
1796
|
break;
|
|
1797
1797
|
case g.CONSTANT:
|
|
1798
1798
|
console.log("Actually, not supported - will be added later !");
|
|
@@ -1848,7 +1848,7 @@ const $ = class $ {
|
|
|
1848
1848
|
h(this, y, []);
|
|
1849
1849
|
const t = "x";
|
|
1850
1850
|
return e.reverse().forEach((i, n) => {
|
|
1851
|
-
const r = new
|
|
1851
|
+
const r = new M();
|
|
1852
1852
|
r.coefficient = new u(i), r.setLetter(t, n), s(this, y).push(r);
|
|
1853
1853
|
}), this;
|
|
1854
1854
|
}
|
|
@@ -1930,11 +1930,11 @@ const $ = class $ {
|
|
|
1930
1930
|
return this.getZeroes();
|
|
1931
1931
|
}
|
|
1932
1932
|
};
|
|
1933
|
-
je = new WeakMap(), y = new WeakMap(), Ke = new WeakMap(), ft = new WeakMap(), Je = new WeakMap(), dt = new WeakMap(), Ct = new WeakMap(),
|
|
1933
|
+
je = new WeakMap(), y = new WeakMap(), Ke = new WeakMap(), ft = new WeakMap(), Je = new WeakMap(), dt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), $t = new WeakMap(), _e = new WeakMap(), It = new WeakMap(), pt = new WeakMap(), St = new WeakMap(), Bt = new WeakMap(), Rt = new WeakMap(), zt = new WeakSet(), ki = function(e, ...t) {
|
|
1934
1934
|
if (t.length === 0) {
|
|
1935
1935
|
if (e = "" + e, e !== "" && !isNaN(Number(e))) {
|
|
1936
1936
|
this.empty();
|
|
1937
|
-
const i = new
|
|
1937
|
+
const i = new M(e);
|
|
1938
1938
|
return this.add(i), this;
|
|
1939
1939
|
}
|
|
1940
1940
|
return s(this, Lt).call(this, e);
|
|
@@ -1947,13 +1947,13 @@ je = new WeakMap(), y = new WeakMap(), Ke = new WeakMap(), ft = new WeakMap(), J
|
|
|
1947
1947
|
throw new Error("Too many factors for too few variables !");
|
|
1948
1948
|
let r = 0;
|
|
1949
1949
|
for (const l of i) {
|
|
1950
|
-
const c = new
|
|
1950
|
+
const c = new M();
|
|
1951
1951
|
c.coefficient = l.clone(), c.literalStr = n[r] || "", this.add(c), r++;
|
|
1952
1952
|
}
|
|
1953
1953
|
} else {
|
|
1954
1954
|
let n = i.length - 1;
|
|
1955
1955
|
for (const r of i) {
|
|
1956
|
-
const l = new
|
|
1956
|
+
const l = new M();
|
|
1957
1957
|
l.coefficient = r.clone(), l.literalStr = `${e}^${n}`, this.add(l), n--;
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
@@ -1961,16 +1961,16 @@ je = new WeakMap(), y = new WeakMap(), Ke = new WeakMap(), ft = new WeakMap(), J
|
|
|
1961
1961
|
} else
|
|
1962
1962
|
return this.zero();
|
|
1963
1963
|
}, Lt = new WeakMap(), Vt = new WeakMap();
|
|
1964
|
-
let O =
|
|
1965
|
-
var q,
|
|
1964
|
+
let O = P;
|
|
1965
|
+
var q, k, oe, Dt, et, Zt;
|
|
1966
1966
|
const Ne = class Ne {
|
|
1967
1967
|
constructor(e, t, i) {
|
|
1968
1968
|
// Left part of the equation
|
|
1969
1969
|
m(this, q);
|
|
1970
1970
|
// Right part of the equation
|
|
1971
|
-
m(this,
|
|
1971
|
+
m(this, k);
|
|
1972
1972
|
// Signe of the equation
|
|
1973
|
-
m(this,
|
|
1973
|
+
m(this, oe);
|
|
1974
1974
|
// ------------------------------------------
|
|
1975
1975
|
a(this, "parse", (e) => {
|
|
1976
1976
|
const t = s(this, Dt).call(this, e);
|
|
@@ -1979,13 +1979,13 @@ const Ne = class Ne {
|
|
|
1979
1979
|
const i = e.split(t);
|
|
1980
1980
|
return this.create(new O(i[0]), new O(i[1]), s(this, et).call(this, t));
|
|
1981
1981
|
});
|
|
1982
|
-
a(this, "create", (e, t, i) => (h(this, q, e), h(this,
|
|
1983
|
-
a(this, "clone", () => new Ne(s(this, q).clone(), s(this,
|
|
1982
|
+
a(this, "create", (e, t, i) => (h(this, q, e), h(this, k, t), h(this, oe, s(this, et).call(this, i ?? "=")), this));
|
|
1983
|
+
a(this, "clone", () => new Ne(s(this, q).clone(), s(this, k).clone(), s(this, oe)));
|
|
1984
1984
|
/**
|
|
1985
1985
|
* Get the degree of the equation
|
|
1986
1986
|
* @param letter
|
|
1987
1987
|
*/
|
|
1988
|
-
a(this, "degree", (e) => u.max(s(this, q).degree(e), s(this,
|
|
1988
|
+
a(this, "degree", (e) => u.max(s(this, q).degree(e), s(this, k).degree(e)));
|
|
1989
1989
|
/**
|
|
1990
1990
|
* divide an equation by a given value (transformed as a fraction)
|
|
1991
1991
|
*
|
|
@@ -2016,7 +2016,7 @@ const Ne = class Ne {
|
|
|
2016
2016
|
/**
|
|
2017
2017
|
* Determine if the equation contains more than one letter/variable.
|
|
2018
2018
|
*/
|
|
2019
|
-
a(this, "isMultiVariable", () => s(this, q).isMultiVariable || s(this,
|
|
2019
|
+
a(this, "isMultiVariable", () => s(this, q).isMultiVariable || s(this, k).isMultiVariable);
|
|
2020
2020
|
// -----------------------------------------------
|
|
2021
2021
|
// Equations helpers
|
|
2022
2022
|
a(this, "isEqualTo", (e) => {
|
|
@@ -2031,43 +2031,43 @@ const Ne = class Ne {
|
|
|
2031
2031
|
if (!this.degree(e).isOne() || this.isMultiVariable())
|
|
2032
2032
|
return !1;
|
|
2033
2033
|
let t;
|
|
2034
|
-
s(this, q).subtract(s(this,
|
|
2034
|
+
s(this, q).subtract(s(this, k)), s(this, k).zero();
|
|
2035
2035
|
const i = [...s(this, q).monoms];
|
|
2036
2036
|
for (const r of i)
|
|
2037
|
-
r.hasVariable(e) || (t = r.clone(), s(this, q).subtract(t), s(this,
|
|
2037
|
+
r.hasVariable(e) || (t = r.clone(), s(this, q).subtract(t), s(this, k).subtract(t));
|
|
2038
2038
|
if (s(this, q).length !== 1)
|
|
2039
2039
|
return !1;
|
|
2040
2040
|
const n = s(this, q).monoms[0].coefficient.clone();
|
|
2041
|
-
return s(this, q).divide(n), s(this,
|
|
2041
|
+
return s(this, q).divide(n), s(this, k).divide(n), this;
|
|
2042
2042
|
});
|
|
2043
2043
|
// -----------------------------------------------
|
|
2044
2044
|
// Equations operations
|
|
2045
2045
|
// -----------------------------------------------
|
|
2046
|
-
a(this, "letters", () => [.../* @__PURE__ */ new Set([...s(this, q).letters(), ...s(this,
|
|
2046
|
+
a(this, "letters", () => [.../* @__PURE__ */ new Set([...s(this, q).letters(), ...s(this, k).letters()])]);
|
|
2047
2047
|
// -----------------------------------------------
|
|
2048
2048
|
/**
|
|
2049
2049
|
* Reorder will move all monoms containing a letter on the left, all the other on the right.
|
|
2050
2050
|
*/
|
|
2051
|
-
a(this, "moveLeft", () => (s(this, q).subtract(s(this,
|
|
2051
|
+
a(this, "moveLeft", () => (s(this, q).subtract(s(this, k)), s(this, k).zero(), this));
|
|
2052
2052
|
/**
|
|
2053
2053
|
* Multiple an equation by a fraction value.
|
|
2054
2054
|
* @param value
|
|
2055
2055
|
*/
|
|
2056
2056
|
a(this, "multiply", (e) => {
|
|
2057
2057
|
const t = new u(e);
|
|
2058
|
-
return s(this, q).multiply(t), s(this,
|
|
2058
|
+
return s(this, q).multiply(t), s(this, k).multiply(t), s(this, oe) !== "=" && t.sign() === -1 && s(this, Zt).call(this), this;
|
|
2059
2059
|
});
|
|
2060
|
-
a(this, "opposite", () => (h(this, q, s(this, q).opposite()), h(this,
|
|
2061
|
-
a(this, "reorder", (e) => (s(this, q).subtract(s(this,
|
|
2060
|
+
a(this, "opposite", () => (h(this, q, s(this, q).opposite()), h(this, k, s(this, k).opposite()), this));
|
|
2061
|
+
a(this, "reorder", (e) => (s(this, q).subtract(s(this, k)), s(this, k).zero(), s(this, q).reorder(), e ? this : (s(this, q).monoms.filter((t) => t.degree().isZero()).forEach((t) => {
|
|
2062
2062
|
const i = t.clone();
|
|
2063
|
-
s(this, q).subtract(i), s(this,
|
|
2064
|
-
}), s(this, q).reorder(), s(this,
|
|
2063
|
+
s(this, q).subtract(i), s(this, k).subtract(i);
|
|
2064
|
+
}), s(this, q).reorder(), s(this, k).reorder(), this)));
|
|
2065
2065
|
// ------------------------------------------
|
|
2066
|
-
a(this, "replaceBy", (e, t) => (s(this, q).replaceBy(e, t), s(this,
|
|
2066
|
+
a(this, "replaceBy", (e, t) => (s(this, q).replaceBy(e, t), s(this, k).replaceBy(e, t), this));
|
|
2067
2067
|
/**
|
|
2068
2068
|
* Multiply by the lcm denominator and divide by the gcm numerators.
|
|
2069
2069
|
*/
|
|
2070
|
-
a(this, "simplify", () => (this.multiply(U.lcm(...s(this, q).getDenominators(), ...s(this,
|
|
2070
|
+
a(this, "simplify", () => (this.multiply(U.lcm(...s(this, q).getDenominators(), ...s(this, k).getDenominators())), this.divide(U.gcd(...s(this, q).getNumerators(), ...s(this, k).getNumerators())), this));
|
|
2071
2071
|
// -----------------------------------------------
|
|
2072
2072
|
a(this, "solve", () => new At(this.clone()).solve());
|
|
2073
2073
|
a(this, "test", (e) => this.left.evaluate(e).isEqual(this.right.evaluate(e)));
|
|
@@ -2095,8 +2095,8 @@ const Ne = class Ne {
|
|
|
2095
2095
|
// -----------------------------------------------
|
|
2096
2096
|
// Equations solving algorithms
|
|
2097
2097
|
m(this, et, (e) => e === void 0 ? "=" : e.includes("geq") || e.includes(">=") || e.includes("=>") ? ">=" : e.includes(">") ? ">" : e.includes("leq") || e.includes("<=") || e.includes("=<") ? "<=" : e.includes("<") ? "<" : "=");
|
|
2098
|
-
m(this, Zt, () => s(this,
|
|
2099
|
-
if (h(this, q, new O().zero()), h(this,
|
|
2098
|
+
m(this, Zt, () => s(this, oe) === "=" ? this : s(this, oe).includes("<") ? (s(this, oe).replace("<", ">"), this) : s(this, oe).includes(">") ? (s(this, oe).replace(">", "<"), this) : this);
|
|
2099
|
+
if (h(this, q, new O().zero()), h(this, k, new O().zero()), h(this, oe, "="), e !== void 0 && t === void 0) {
|
|
2100
2100
|
if (e instanceof Ne)
|
|
2101
2101
|
return e.clone();
|
|
2102
2102
|
typeof e == "string" && this.parse(e);
|
|
@@ -2113,11 +2113,11 @@ const Ne = class Ne {
|
|
|
2113
2113
|
*/
|
|
2114
2114
|
add(e) {
|
|
2115
2115
|
if (e instanceof Ne)
|
|
2116
|
-
return s(this, q).add(e.left), s(this,
|
|
2116
|
+
return s(this, q).add(e.left), s(this, k).add(e.right), this;
|
|
2117
2117
|
if (typeof e == "string" && !Ne.isEquationString(e))
|
|
2118
2118
|
return this.add(new Ne(e));
|
|
2119
2119
|
const t = new O(e);
|
|
2120
|
-
return s(this, q).add(t), s(this,
|
|
2120
|
+
return s(this, q).add(t), s(this, k).add(t), this;
|
|
2121
2121
|
}
|
|
2122
2122
|
/**
|
|
2123
2123
|
* Create an Equation using two polynoms.
|
|
@@ -2126,29 +2126,29 @@ const Ne = class Ne {
|
|
|
2126
2126
|
* @param asNumeric
|
|
2127
2127
|
*/
|
|
2128
2128
|
evaluate(e, t) {
|
|
2129
|
-
const i = s(this, q).evaluate(e, t), n = s(this,
|
|
2129
|
+
const i = s(this, q).evaluate(e, t), n = s(this, k).evaluate(e, t);
|
|
2130
2130
|
return t ? i === n : i.isEqual(n);
|
|
2131
2131
|
}
|
|
2132
2132
|
isEqual(e) {
|
|
2133
2133
|
const t = new Ne(e);
|
|
2134
|
-
return t.left.isEqual(s(this, q)) && t.right.isEqual(s(this,
|
|
2134
|
+
return t.left.isEqual(s(this, q)) && t.right.isEqual(s(this, k));
|
|
2135
2135
|
}
|
|
2136
2136
|
pow(e) {
|
|
2137
|
-
return s(this, q).pow(e), s(this,
|
|
2137
|
+
return s(this, q).pow(e), s(this, k).pow(e), this;
|
|
2138
2138
|
}
|
|
2139
2139
|
reduce() {
|
|
2140
2140
|
return this.moveLeft(), s(this, q).reduce(), this.simplify(), s(this, q).monoms[0].coefficient.isNegative() && this.multiply(-1), this;
|
|
2141
2141
|
}
|
|
2142
2142
|
split() {
|
|
2143
|
-
return [s(this, q).clone(), s(this,
|
|
2143
|
+
return [s(this, q).clone(), s(this, k).clone()];
|
|
2144
2144
|
}
|
|
2145
2145
|
subtract(e) {
|
|
2146
2146
|
if (e instanceof Ne)
|
|
2147
|
-
return s(this, q).subtract(e.left), s(this,
|
|
2147
|
+
return s(this, q).subtract(e.left), s(this, k).subtract(e.right), this;
|
|
2148
2148
|
if (typeof e == "string" && !Ne.isEquationString(e))
|
|
2149
2149
|
return this.subtract(new Ne(e));
|
|
2150
2150
|
const t = new O(e);
|
|
2151
|
-
return s(this, q).subtract(t), s(this,
|
|
2151
|
+
return s(this, q).subtract(t), s(this, k).subtract(t), this;
|
|
2152
2152
|
}
|
|
2153
2153
|
static isEquationString(e) {
|
|
2154
2154
|
return e.includes("=") || e.includes("<") || e.includes(">") || e.includes("<=") || e.includes(">=");
|
|
@@ -2158,7 +2158,7 @@ const Ne = class Ne {
|
|
|
2158
2158
|
return t === !0 && n.sort((r, l) => r.value - l.value), n;
|
|
2159
2159
|
}
|
|
2160
2160
|
get display() {
|
|
2161
|
-
return `${s(this, q).display}${this.signAsTex}${s(this,
|
|
2161
|
+
return `${s(this, q).display}${this.signAsTex}${s(this, k).display}`;
|
|
2162
2162
|
}
|
|
2163
2163
|
// Getter and setter
|
|
2164
2164
|
get left() {
|
|
@@ -2171,29 +2171,29 @@ const Ne = class Ne {
|
|
|
2171
2171
|
return this.variables.length;
|
|
2172
2172
|
}
|
|
2173
2173
|
get right() {
|
|
2174
|
-
return s(this,
|
|
2174
|
+
return s(this, k);
|
|
2175
2175
|
}
|
|
2176
2176
|
set right(e) {
|
|
2177
|
-
h(this,
|
|
2177
|
+
h(this, k, e);
|
|
2178
2178
|
}
|
|
2179
2179
|
// ------------------------------------------
|
|
2180
2180
|
get sign() {
|
|
2181
|
-
return s(this,
|
|
2181
|
+
return s(this, oe);
|
|
2182
2182
|
}
|
|
2183
2183
|
set sign(e) {
|
|
2184
|
-
h(this,
|
|
2184
|
+
h(this, oe, s(this, et).call(this, e));
|
|
2185
2185
|
}
|
|
2186
2186
|
get signAsTex() {
|
|
2187
|
-
return s(this,
|
|
2187
|
+
return s(this, oe) === ">=" ? "\\geq" : s(this, oe) === "<=" ? "\\leq" : s(this, oe);
|
|
2188
2188
|
}
|
|
2189
2189
|
get tex() {
|
|
2190
|
-
return `${s(this, q).tex}${this.signAsTex}${s(this,
|
|
2190
|
+
return `${s(this, q).tex}${this.signAsTex}${s(this, k).tex}`;
|
|
2191
2191
|
}
|
|
2192
2192
|
get variables() {
|
|
2193
|
-
return [...new Set(s(this,
|
|
2193
|
+
return [...new Set(s(this, k).variables.concat(s(this, q).variables))];
|
|
2194
2194
|
}
|
|
2195
2195
|
};
|
|
2196
|
-
q = new WeakMap(),
|
|
2196
|
+
q = new WeakMap(), k = new WeakMap(), oe = new WeakMap(), Dt = new WeakMap(), et = new WeakMap(), Zt = new WeakMap();
|
|
2197
2197
|
let H = Ne;
|
|
2198
2198
|
var Te, Ae, be, tt;
|
|
2199
2199
|
const ve = class ve {
|
|
@@ -2336,13 +2336,13 @@ const ve = class ve {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
};
|
|
2338
2338
|
Te = new WeakMap(), Ae = new WeakMap(), be = new WeakMap(), tt = new WeakMap();
|
|
2339
|
-
let
|
|
2340
|
-
var lt = /* @__PURE__ */ ((o) => (o[o.ROOT = 0] = "ROOT", o[o.POWER = 1] = "POWER", o))(lt || {}), D,
|
|
2339
|
+
let se = ve;
|
|
2340
|
+
var lt = /* @__PURE__ */ ((o) => (o[o.ROOT = 0] = "ROOT", o[o.POWER = 1] = "POWER", o))(lt || {}), D, Pe, Ft, jt;
|
|
2341
2341
|
const Xe = class Xe {
|
|
2342
2342
|
constructor(...e) {
|
|
2343
2343
|
m(this, D);
|
|
2344
2344
|
// Determine the letters in the linear system, usually ['x', 'y']
|
|
2345
|
-
m(this,
|
|
2345
|
+
m(this, Pe);
|
|
2346
2346
|
a(this, "parse", (...e) => (h(this, D, e.map((t) => new H(t))), s(this, Ft).call(this), this));
|
|
2347
2347
|
a(this, "clone", () => new Xe().parse(...s(this, D).map((e) => e.clone())));
|
|
2348
2348
|
a(this, "buildTex", (e, t) => {
|
|
@@ -2393,7 +2393,7 @@ const Xe = class Xe {
|
|
|
2393
2393
|
}
|
|
2394
2394
|
return i.map((n) => n[n.length - 1]);
|
|
2395
2395
|
});
|
|
2396
|
-
m(this, Ft, () => (h(this,
|
|
2396
|
+
m(this, Ft, () => (h(this, Pe, s(this, D).reduce((e, t) => [.../* @__PURE__ */ new Set([...e, ...t.variables])], [])), s(this, Pe).sort(), this));
|
|
2397
2397
|
m(this, jt, () => {
|
|
2398
2398
|
const e = [], t = [];
|
|
2399
2399
|
for (const i of s(this, D)) {
|
|
@@ -2406,7 +2406,7 @@ const Xe = class Xe {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
return [e, t];
|
|
2408
2408
|
});
|
|
2409
|
-
return h(this, D, []), h(this,
|
|
2409
|
+
return h(this, D, []), h(this, Pe, []), e.length > 0 && this.parse(...e), this;
|
|
2410
2410
|
}
|
|
2411
2411
|
static fromMatrix(e, t = "xyz") {
|
|
2412
2412
|
const i = e[0].length;
|
|
@@ -2452,7 +2452,7 @@ const Xe = class Xe {
|
|
|
2452
2452
|
throw new Error("Method not implemented.");
|
|
2453
2453
|
}
|
|
2454
2454
|
hasVariable(e) {
|
|
2455
|
-
return s(this,
|
|
2455
|
+
return s(this, Pe).includes(e);
|
|
2456
2456
|
}
|
|
2457
2457
|
isEqual(e) {
|
|
2458
2458
|
return this.equations.every((t, i) => t.isEqual(e.equations[i]));
|
|
@@ -2501,14 +2501,14 @@ const Xe = class Xe {
|
|
|
2501
2501
|
return this.buildTex(e.equations);
|
|
2502
2502
|
}
|
|
2503
2503
|
get variables() {
|
|
2504
|
-
return s(this,
|
|
2504
|
+
return s(this, Pe);
|
|
2505
2505
|
}
|
|
2506
2506
|
set variables(e) {
|
|
2507
2507
|
const t = typeof e == "string" ? e.split("") : [...e];
|
|
2508
|
-
t.sort(), h(this,
|
|
2508
|
+
t.sort(), h(this, Pe, t);
|
|
2509
2509
|
}
|
|
2510
2510
|
};
|
|
2511
|
-
D = new WeakMap(),
|
|
2511
|
+
D = new WeakMap(), Pe = new WeakMap(), Ft = new WeakMap(), jt = new WeakMap();
|
|
2512
2512
|
let ti = Xe;
|
|
2513
2513
|
var Oe, mt, ii;
|
|
2514
2514
|
class ss {
|
|
@@ -2653,7 +2653,7 @@ Oe = new WeakMap(), mt = new WeakSet(), ii = function(e, t) {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
return [...i[0]].sort();
|
|
2655
2655
|
};
|
|
2656
|
-
var it, N, We, ni,
|
|
2656
|
+
var it, N, We, ni, Mi, gt, ri;
|
|
2657
2657
|
const X = class X {
|
|
2658
2658
|
constructor(...e) {
|
|
2659
2659
|
m(this, gt);
|
|
@@ -2663,7 +2663,7 @@ const X = class X {
|
|
|
2663
2663
|
}
|
|
2664
2664
|
parse(...e) {
|
|
2665
2665
|
return h(this, N, []), e.length === 0 ? this : (e.forEach((t) => {
|
|
2666
|
-
t instanceof X ? s(this, N).push(...t.factors.map((i) => i.clone())) : s(this, N).push(new
|
|
2666
|
+
t instanceof X ? s(this, N).push(...t.factors.map((i) => i.clone())) : s(this, N).push(new se(t));
|
|
2667
2667
|
}), this);
|
|
2668
2668
|
}
|
|
2669
2669
|
clone() {
|
|
@@ -2707,7 +2707,7 @@ const X = class X {
|
|
|
2707
2707
|
let t = e[0];
|
|
2708
2708
|
return e.shift(), e.forEach((i) => {
|
|
2709
2709
|
var n;
|
|
2710
|
-
return t = A(n = X, We,
|
|
2710
|
+
return t = A(n = X, We, Mi).call(n, t, i);
|
|
2711
2711
|
}), t;
|
|
2712
2712
|
}
|
|
2713
2713
|
add(...e) {
|
|
@@ -2724,7 +2724,7 @@ const X = class X {
|
|
|
2724
2724
|
).reduce();
|
|
2725
2725
|
return h(this, N, [
|
|
2726
2726
|
...r.factors,
|
|
2727
|
-
new
|
|
2727
|
+
new se(l)
|
|
2728
2728
|
]), n && this.divide(n), h(this, N, s(this, N).filter((c) => !c.power.isZero())), this;
|
|
2729
2729
|
}
|
|
2730
2730
|
get asPower() {
|
|
@@ -2773,7 +2773,7 @@ const X = class X {
|
|
|
2773
2773
|
const c = l.polynom.factorize(e);
|
|
2774
2774
|
if (c.length > 1) {
|
|
2775
2775
|
const f = l.power.clone();
|
|
2776
|
-
t.push(...c.map((d) => new
|
|
2776
|
+
t.push(...c.map((d) => new se(d, f)));
|
|
2777
2777
|
} else
|
|
2778
2778
|
t.push(l.clone());
|
|
2779
2779
|
});
|
|
@@ -2787,13 +2787,13 @@ const X = class X {
|
|
|
2787
2787
|
h(this, N, e);
|
|
2788
2788
|
}
|
|
2789
2789
|
fromPolynom(e, t) {
|
|
2790
|
-
if (h(this, N, [new
|
|
2790
|
+
if (h(this, N, [new se(new O(e))]), t) {
|
|
2791
2791
|
const i = new O(t);
|
|
2792
2792
|
if (i.isOne())
|
|
2793
2793
|
return this;
|
|
2794
2794
|
if (i.isZero())
|
|
2795
2795
|
throw new Error("Cannot divide by zero");
|
|
2796
|
-
s(this, N).push(new
|
|
2796
|
+
s(this, N).push(new se(i, -1));
|
|
2797
2797
|
}
|
|
2798
2798
|
return this;
|
|
2799
2799
|
}
|
|
@@ -2830,11 +2830,11 @@ const X = class X {
|
|
|
2830
2830
|
return new X(...s(this, N).filter((e) => e.power.isPositive()));
|
|
2831
2831
|
}
|
|
2832
2832
|
one() {
|
|
2833
|
-
return h(this, N, [new
|
|
2833
|
+
return h(this, N, [new se("1", "1")]), this;
|
|
2834
2834
|
}
|
|
2835
2835
|
opposite() {
|
|
2836
2836
|
const e = s(this, N).findIndex((t) => t.display === "(-1)");
|
|
2837
|
-
return e >= 0 ? s(this, N).splice(e, 1) : s(this, N).push(new
|
|
2837
|
+
return e >= 0 ? s(this, N).splice(e, 1) : s(this, N).push(new se("-1", "1")), this;
|
|
2838
2838
|
}
|
|
2839
2839
|
pow(e) {
|
|
2840
2840
|
return h(this, N, s(this, N).map((t) => t.pow(e))), this;
|
|
@@ -2846,7 +2846,7 @@ const X = class X {
|
|
|
2846
2846
|
const e = ht(this);
|
|
2847
2847
|
return h(this, N, Object.values(e).map((t) => {
|
|
2848
2848
|
const i = t[0].polynom, n = t.reduce((r, l) => r.add(l.power), new u("0"));
|
|
2849
|
-
return new
|
|
2849
|
+
return new se(i, n.reduce());
|
|
2850
2850
|
}).filter((t) => !t.power.isZero())), this;
|
|
2851
2851
|
}
|
|
2852
2852
|
root(e) {
|
|
@@ -2877,7 +2877,7 @@ const X = class X {
|
|
|
2877
2877
|
return this.add(...e.map((t) => t.opposite()));
|
|
2878
2878
|
}
|
|
2879
2879
|
tableOfSigns() {
|
|
2880
|
-
const e = this.getZeroes(), t = e.map((r) => r.value), i = this.factors.map((r) => ({ factor: new
|
|
2880
|
+
const e = this.getZeroes(), t = e.map((r) => r.value), i = this.factors.map((r) => ({ factor: new se(r), ...r.tableOfSigns() }));
|
|
2881
2881
|
return i.forEach((r) => {
|
|
2882
2882
|
const l = new Array(2 * e.length + 1).fill("");
|
|
2883
2883
|
let c = r.signs.shift(), f = r.roots.shift();
|
|
@@ -2911,34 +2911,34 @@ const X = class X {
|
|
|
2911
2911
|
return s(this, N).reduce((e, t) => e.concat(t.variables), []);
|
|
2912
2912
|
}
|
|
2913
2913
|
zero() {
|
|
2914
|
-
return h(this, N, [new
|
|
2914
|
+
return h(this, N, [new se("0", "1")]), this;
|
|
2915
2915
|
}
|
|
2916
2916
|
};
|
|
2917
2917
|
it = new WeakMap(), N = new WeakMap(), We = new WeakSet(), ni = function(e, t) {
|
|
2918
2918
|
const i = ht(e), n = ht(t), l = Object.keys(i).filter((c) => Object.hasOwn(n, c)).map((c) => {
|
|
2919
2919
|
const f = i[c].reduce((p, w) => p.add(w.power), new u("0")), d = n[c].reduce((p, w) => p.add(w.power), new u("0"));
|
|
2920
|
-
return new
|
|
2920
|
+
return new se(c, u.min(f, d));
|
|
2921
2921
|
});
|
|
2922
2922
|
return new X(...l);
|
|
2923
|
-
},
|
|
2923
|
+
}, Mi = function(e, t) {
|
|
2924
2924
|
const i = ht(e), n = ht(t), l = [.../* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)])].map((c) => {
|
|
2925
2925
|
const f = Object.hasOwn(i, c) ? i[c].reduce((p, w) => p.add(w.power), new u("0")) : new u(0), d = Object.hasOwn(n, c) ? n[c].reduce((p, w) => p.add(w.power), new u("0")) : new u(0);
|
|
2926
|
-
return new
|
|
2926
|
+
return new se(c, u.max(f, d));
|
|
2927
2927
|
});
|
|
2928
2928
|
return new X(...l);
|
|
2929
2929
|
}, gt = new WeakSet(), ri = function() {
|
|
2930
2930
|
let e, t = [];
|
|
2931
|
-
return s(this, it) === lt.ROOT ? (e = this.numerator.factors, t = this.denominator.factors) : e = s(this, N), e.length === 0 && (e = [new
|
|
2931
|
+
return s(this, it) === lt.ROOT ? (e = this.numerator.factors, t = this.denominator.factors) : e = s(this, N), e.length === 0 && (e = [new se("1")]), { num: e, den: t };
|
|
2932
2932
|
}, m(X, We);
|
|
2933
2933
|
let si = X;
|
|
2934
2934
|
function ht(o) {
|
|
2935
|
-
const e = new u().one(), t = o.factors.reduce((
|
|
2936
|
-
if (
|
|
2937
|
-
return
|
|
2938
|
-
const
|
|
2939
|
-
return Object.hasOwn(
|
|
2940
|
-
}, {});
|
|
2941
|
-
return
|
|
2935
|
+
const e = new u().one(), t = new u().one(), i = o.factors.reduce((l, c) => {
|
|
2936
|
+
if (c.polynom.degree().isZero())
|
|
2937
|
+
return c.power.isPositive() ? e.multiply(c.polynom.monoms[0].coefficient) : t.multiply(c.polynom.monoms[0].coefficient), l;
|
|
2938
|
+
const f = c.polynom.display;
|
|
2939
|
+
return Object.hasOwn(l, f) ? l[f].push(c) : l[f] = [c], l;
|
|
2940
|
+
}, {}), { numerator: n, denominator: r } = e.divide(t).reduce();
|
|
2941
|
+
return n !== 1 && (i[n.toString()] = [new se(n, 1)]), r !== 1 && (i[r.toString()] = [new se(r, -1)]), i;
|
|
2942
2942
|
}
|
|
2943
2943
|
function ns(o, e) {
|
|
2944
2944
|
return o.dimension === e.dimension && o.array.every(
|
|
@@ -2973,7 +2973,7 @@ function hs(...o) {
|
|
|
2973
2973
|
).add(o[0].array[2].clone().multiply(o[1].array[0].clone().multiply(o[2].array[1]).subtract(o[1].array[1].clone().multiply(o[2].array[0]))));
|
|
2974
2974
|
}
|
|
2975
2975
|
var F, Le;
|
|
2976
|
-
const
|
|
2976
|
+
const Be = class Be {
|
|
2977
2977
|
constructor(...e) {
|
|
2978
2978
|
m(this, F, []);
|
|
2979
2979
|
m(this, Le, !1);
|
|
@@ -3100,7 +3100,7 @@ const Se = class Se {
|
|
|
3100
3100
|
if (e.length === 0)
|
|
3101
3101
|
throw new Error("Invalid value");
|
|
3102
3102
|
if (e.length === 1) {
|
|
3103
|
-
if (e[0] instanceof
|
|
3103
|
+
if (e[0] instanceof Be)
|
|
3104
3104
|
return e[0].clone();
|
|
3105
3105
|
if (typeof e[0] == "string")
|
|
3106
3106
|
return this.fromString(e[0]);
|
|
@@ -3108,7 +3108,7 @@ const Se = class Se {
|
|
|
3108
3108
|
}
|
|
3109
3109
|
if (e.length === 2) {
|
|
3110
3110
|
const [t, i] = e;
|
|
3111
|
-
if (t instanceof
|
|
3111
|
+
if (t instanceof Be && i instanceof Be) {
|
|
3112
3112
|
if (t.dimension !== i.dimension)
|
|
3113
3113
|
throw new Error("Vectors must have the same dimension");
|
|
3114
3114
|
return h(this, F, i.array.map((n, r) => n.clone().subtract(t.array[r]))), this;
|
|
@@ -3117,7 +3117,7 @@ const Se = class Se {
|
|
|
3117
3117
|
return h(this, F, e.map((t) => new u(t))), this;
|
|
3118
3118
|
}
|
|
3119
3119
|
clone() {
|
|
3120
|
-
const e = new
|
|
3120
|
+
const e = new Be();
|
|
3121
3121
|
return e.array = this.copy(), e.asPoint = this.asPoint, e;
|
|
3122
3122
|
}
|
|
3123
3123
|
copy() {
|
|
@@ -3136,7 +3136,7 @@ const Se = class Se {
|
|
|
3136
3136
|
cross(e) {
|
|
3137
3137
|
if (this.dimension !== 3 || e.dimension !== 3)
|
|
3138
3138
|
throw new Error("Cross product can only be determined in 3D");
|
|
3139
|
-
return new
|
|
3139
|
+
return new Be(
|
|
3140
3140
|
this.y.clone().multiply(e.z).subtract(this.z.clone().multiply(e.y)),
|
|
3141
3141
|
this.z.clone().multiply(e.x).subtract(this.x.clone().multiply(e.z)),
|
|
3142
3142
|
this.x.clone().multiply(e.y).subtract(this.y.clone().multiply(e.x))
|
|
@@ -3149,7 +3149,7 @@ const Se = class Se {
|
|
|
3149
3149
|
return this.array.every((e, t) => t === 0 ? e.isOne() : e.isZero());
|
|
3150
3150
|
}
|
|
3151
3151
|
distanceTo(e) {
|
|
3152
|
-
const t = new
|
|
3152
|
+
const t = new Be(this, e);
|
|
3153
3153
|
return {
|
|
3154
3154
|
value: t.norm,
|
|
3155
3155
|
fraction: t.normSquare,
|
|
@@ -3158,7 +3158,7 @@ const Se = class Se {
|
|
|
3158
3158
|
}
|
|
3159
3159
|
};
|
|
3160
3160
|
F = new WeakMap(), Le = new WeakMap();
|
|
3161
|
-
let E =
|
|
3161
|
+
let E = Be;
|
|
3162
3162
|
var we = /* @__PURE__ */ ((o) => (o.None = "none", o.Parallel = "parallel", o.Perpendicular = "perpendicular", o.Tangent = "tangent", o))(we || {}), oi = /* @__PURE__ */ ((o) => (o.None = "none", o.Parallel = "parallel", o.Perpendicular = "perpendicular", o.Tangent = "tangent", o))(oi || {});
|
|
3163
3163
|
function Ci(o = 0.5) {
|
|
3164
3164
|
return Math.random() < o;
|
|
@@ -3185,12 +3185,12 @@ function as(o) {
|
|
|
3185
3185
|
return o !== void 0 && (e = e.filter((t) => t < o)), di(e);
|
|
3186
3186
|
}
|
|
3187
3187
|
function ls(o, e) {
|
|
3188
|
-
return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) :
|
|
3188
|
+
return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) : Pi(o).slice(0, e);
|
|
3189
3189
|
}
|
|
3190
3190
|
function di(o) {
|
|
3191
3191
|
return o.length === 0 ? null : o[pe(0, o.length - 1)];
|
|
3192
3192
|
}
|
|
3193
|
-
function
|
|
3193
|
+
function Pi(o) {
|
|
3194
3194
|
const e = Object.values(o);
|
|
3195
3195
|
for (let t = e.length - 1; t > 0; t--) {
|
|
3196
3196
|
const i = Math.floor(Math.random() * (t + 1)), n = e[t];
|
|
@@ -3198,7 +3198,7 @@ function $i(o) {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
return e;
|
|
3200
3200
|
}
|
|
3201
|
-
class
|
|
3201
|
+
class S extends E {
|
|
3202
3202
|
constructor(...e) {
|
|
3203
3203
|
super(), e.length > 0 && this.parse(...e);
|
|
3204
3204
|
}
|
|
@@ -3220,11 +3220,11 @@ class B extends E {
|
|
|
3220
3220
|
return this;
|
|
3221
3221
|
}
|
|
3222
3222
|
clone() {
|
|
3223
|
-
const e = new
|
|
3223
|
+
const e = new S();
|
|
3224
3224
|
return e.array = this.copy(), e.asPoint = !0, e;
|
|
3225
3225
|
}
|
|
3226
3226
|
}
|
|
3227
|
-
var
|
|
3227
|
+
var $e, B, z, W, he, J, Ie, xe;
|
|
3228
3228
|
const De = class De {
|
|
3229
3229
|
/**
|
|
3230
3230
|
* Value can be a mix of:
|
|
@@ -3232,17 +3232,17 @@ const De = class De {
|
|
|
3232
3232
|
* @param values
|
|
3233
3233
|
*/
|
|
3234
3234
|
constructor(...e) {
|
|
3235
|
-
m(this,
|
|
3235
|
+
m(this, $e);
|
|
3236
3236
|
// ax + by + c = 0
|
|
3237
|
-
m(this,
|
|
3237
|
+
m(this, B);
|
|
3238
3238
|
m(this, z);
|
|
3239
3239
|
m(this, W);
|
|
3240
|
-
m(this,
|
|
3240
|
+
m(this, he);
|
|
3241
3241
|
m(this, J);
|
|
3242
3242
|
m(this, Ie);
|
|
3243
3243
|
m(this, xe, "canonical");
|
|
3244
3244
|
a(this, "randomPoint", (e) => {
|
|
3245
|
-
const t = s(this, J).clone().multiplyByScalar(Q(e === void 0 || e <= 1 ? 3 : e, !1)).add(s(this,
|
|
3245
|
+
const t = s(this, J).clone().multiplyByScalar(Q(e === void 0 || e <= 1 ? 3 : e, !1)).add(s(this, he));
|
|
3246
3246
|
return t.asPoint = !0, t;
|
|
3247
3247
|
});
|
|
3248
3248
|
a(this, "randomNearPoint", (e) => {
|
|
@@ -3311,23 +3311,23 @@ const De = class De {
|
|
|
3311
3311
|
e.left.monomByDegree(0).coefficient
|
|
3312
3312
|
);
|
|
3313
3313
|
});
|
|
3314
|
-
a(this, "fromCoefficient", (e, t, i) => (h(this,
|
|
3314
|
+
a(this, "fromCoefficient", (e, t, i) => (h(this, B, new u(e)), h(this, z, new u(t)), h(this, W, new u(i)), h(this, J, new E(s(this, z).clone(), s(this, B).clone().opposite())), h(this, he, new E(new u().zero(), s(this, W).clone())), h(this, Ie, s(this, J).clone().normal()), this));
|
|
3315
3315
|
a(this, "fromPointAndDirection", (e, t) => (this.fromCoefficient(
|
|
3316
3316
|
t.y,
|
|
3317
3317
|
t.x.clone().opposite(),
|
|
3318
3318
|
e.x.clone().multiply(t.y).subtract(e.y.clone().multiply(t.x)).opposite()
|
|
3319
|
-
), h(this,
|
|
3319
|
+
), h(this, he, e.clone()), h(this, J, t.clone()), h(this, Ie, s(this, J).clone().normal()), this));
|
|
3320
3320
|
a(this, "fromPointAndNormal", (e, t) => this.fromCoefficient(
|
|
3321
3321
|
t.x,
|
|
3322
3322
|
t.y,
|
|
3323
3323
|
e.x.clone().multiply(t.x).add(e.y.clone().multiply(t.y)).opposite()
|
|
3324
3324
|
));
|
|
3325
3325
|
a(this, "fromPointAndLine", (e, t, i) => (i === void 0 && (i = we.Parallel), i === we.Parallel ? this.fromPointAndNormal(e, t.normal) : i === we.Perpendicular ? this.fromPointAndNormal(e, t.director) : this));
|
|
3326
|
-
a(this, "clone", () => (h(this,
|
|
3326
|
+
a(this, "clone", () => (h(this, B, s(this, B).clone()), h(this, z, s(this, z).clone()), h(this, W, s(this, W).clone()), h(this, J, s(this, J).clone()), h(this, he, s(this, he).clone()), h(this, Ie, s(this, Ie).clone()), this));
|
|
3327
3327
|
// ------------------------------------------
|
|
3328
3328
|
// Mathematical operations
|
|
3329
3329
|
// ------------------------------------------
|
|
3330
|
-
a(this, "isOnLine", (e) => s(this,
|
|
3330
|
+
a(this, "isOnLine", (e) => s(this, B).clone().multiply(e.x).add(
|
|
3331
3331
|
s(this, z).clone().multiply(e.y)
|
|
3332
3332
|
).add(s(this, W)).isZero());
|
|
3333
3333
|
a(this, "isParallelTo", (e) => this.slope.isEqual(e.slope) && this.height.isNotEqual(e.height));
|
|
@@ -3335,18 +3335,18 @@ const De = class De {
|
|
|
3335
3335
|
a(this, "isPerpendicularTo", (e) => this.d.isNormalTo(e.d));
|
|
3336
3336
|
a(this, "isVertical", () => this.slope.isInfinity());
|
|
3337
3337
|
a(this, "simplify", () => {
|
|
3338
|
-
const e = U.lcm(s(this,
|
|
3338
|
+
const e = U.lcm(s(this, B).denominator, s(this, z).denominator, s(this, W).denominator), t = U.gcd(s(this, B).numerator, s(this, z).numerator, s(this, W).numerator);
|
|
3339
3339
|
return this.fromCoefficient(
|
|
3340
|
-
s(this,
|
|
3340
|
+
s(this, B).clone().multiply(e).divide(t),
|
|
3341
3341
|
s(this, z).clone().multiply(e).divide(t),
|
|
3342
3342
|
s(this, W).clone().multiply(e).divide(t)
|
|
3343
3343
|
), this;
|
|
3344
3344
|
});
|
|
3345
3345
|
a(this, "simplifyDirection", () => (s(this, J).simplify(), this));
|
|
3346
3346
|
a(this, "intersection", (e) => {
|
|
3347
|
-
const t = new
|
|
3347
|
+
const t = new S();
|
|
3348
3348
|
let i = !1, n = !1;
|
|
3349
|
-
return s(this, z).isZero() || e.b.isZero(), this.isParallelTo(e) ? (t.x = new u().invalid(), t.y = new u().invalid(), i = !0) : this.isSameAs(e) ? (t.x = new u().invalid(), t.y = new u().invalid(), n = !0) : (t.x = s(this, z).clone().multiply(e.c).subtract(s(this, W).clone().multiply(e.b)).divide(s(this,
|
|
3349
|
+
return s(this, z).isZero() || e.b.isZero(), this.isParallelTo(e) ? (t.x = new u().invalid(), t.y = new u().invalid(), i = !0) : this.isSameAs(e) ? (t.x = new u().invalid(), t.y = new u().invalid(), n = !0) : (t.x = s(this, z).clone().multiply(e.c).subtract(s(this, W).clone().multiply(e.b)).divide(s(this, B).clone().multiply(e.b).subtract(s(this, z).clone().multiply(e.a))), t.y = s(this, B).clone().multiply(e.c).subtract(s(this, W).clone().multiply(e.a)).divide(s(this, z).clone().multiply(e.a).subtract(s(this, B).clone().multiply(e.b)))), {
|
|
3350
3350
|
point: t,
|
|
3351
3351
|
hasIntersection: !(i || n),
|
|
3352
3352
|
isParallel: i,
|
|
@@ -3361,15 +3361,15 @@ const De = class De {
|
|
|
3361
3361
|
const t = this.getEquation().isolate("x"), i = new u(e);
|
|
3362
3362
|
return t instanceof H ? t.right.evaluate({ y: i }) : new u().invalid();
|
|
3363
3363
|
});
|
|
3364
|
-
return h(this,
|
|
3364
|
+
return h(this, B, new u().zero()), h(this, z, new u().zero()), h(this, W, new u().zero()), h(this, he, new E()), h(this, J, new E()), h(this, Ie, new E()), h(this, $e, !0), e.length > 0 && this.parse(...e), this;
|
|
3365
3365
|
}
|
|
3366
3366
|
get a() {
|
|
3367
|
-
return s(this,
|
|
3367
|
+
return s(this, B);
|
|
3368
3368
|
}
|
|
3369
3369
|
// ------------------------------------------
|
|
3370
3370
|
// Getter and setter
|
|
3371
3371
|
set a(e) {
|
|
3372
|
-
h(this,
|
|
3372
|
+
h(this, B, e);
|
|
3373
3373
|
}
|
|
3374
3374
|
get b() {
|
|
3375
3375
|
return s(this, z);
|
|
@@ -3384,10 +3384,10 @@ const De = class De {
|
|
|
3384
3384
|
h(this, W, e);
|
|
3385
3385
|
}
|
|
3386
3386
|
get OA() {
|
|
3387
|
-
return s(this,
|
|
3387
|
+
return s(this, he);
|
|
3388
3388
|
}
|
|
3389
3389
|
set OA(e) {
|
|
3390
|
-
h(this,
|
|
3390
|
+
h(this, he, e);
|
|
3391
3391
|
}
|
|
3392
3392
|
get d() {
|
|
3393
3393
|
return s(this, J);
|
|
@@ -3400,8 +3400,8 @@ const De = class De {
|
|
|
3400
3400
|
}
|
|
3401
3401
|
// ------------------------------------------
|
|
3402
3402
|
getEquation() {
|
|
3403
|
-
const e = new H(new O().parse("xy", s(this,
|
|
3404
|
-
return s(this,
|
|
3403
|
+
const e = new H(new O().parse("xy", s(this, B), s(this, z), s(this, W)), new O("0"));
|
|
3404
|
+
return s(this, $e) ? e.simplify() : e;
|
|
3405
3405
|
}
|
|
3406
3406
|
// get system(): { x: Equation, y: Equation } {
|
|
3407
3407
|
// const e1 = new Equation(
|
|
@@ -3441,22 +3441,22 @@ const De = class De {
|
|
|
3441
3441
|
case "parametric":
|
|
3442
3442
|
case "system": {
|
|
3443
3443
|
const t = s(this, J).clone();
|
|
3444
|
-
return s(this,
|
|
3445
|
-
x &= ${new O(s(this,
|
|
3446
|
-
y &= ${new O(s(this,
|
|
3444
|
+
return s(this, $e) && t.simplify(), e === "parametric" ? `${E.asTex("x", "y")} = ${E.asTex(s(this, he).x.tex, s(this, he).y.tex)} + k\\cdot ${E.asTex(t.x.tex, t.y.tex)}` : `\\left\\{\\begin{aligned}
|
|
3445
|
+
x &= ${new O(s(this, he).x).add(new M(s(this, J).x).multiply(new M("k"))).reorder("k", !0).tex}\\\\
|
|
3446
|
+
y &= ${new O(s(this, he).y).add(new M(s(this, J).y).multiply(new M("k"))).reorder("k", !0).tex}
|
|
3447
3447
|
\\end{aligned}\\right.`;
|
|
3448
3448
|
}
|
|
3449
3449
|
default: {
|
|
3450
3450
|
const t = this.getEquation();
|
|
3451
|
-
return s(this,
|
|
3451
|
+
return s(this, B).isNegative() && t.multiply(-1), t.tex;
|
|
3452
3452
|
}
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
3455
3455
|
get reduceBeforeDisplay() {
|
|
3456
|
-
return s(this,
|
|
3456
|
+
return s(this, $e);
|
|
3457
3457
|
}
|
|
3458
3458
|
set reduceBeforeDisplay(e) {
|
|
3459
|
-
h(this,
|
|
3459
|
+
h(this, $e, e);
|
|
3460
3460
|
}
|
|
3461
3461
|
get display() {
|
|
3462
3462
|
const e = s(this, xe);
|
|
@@ -3467,22 +3467,22 @@ const De = class De {
|
|
|
3467
3467
|
return this.slope.isInfinity() ? "x=" + this.OA.x.display : "y=" + new O().parse("x", this.slope, this.height).display;
|
|
3468
3468
|
case "parametric": {
|
|
3469
3469
|
const t = s(this, J).clone();
|
|
3470
|
-
return s(this,
|
|
3470
|
+
return s(this, $e) && t.simplify(), `((x,y))=((${s(this, he).x.display},${s(this, he).y.display}))+k((${t.x.display},${t.y.display}))`;
|
|
3471
3471
|
}
|
|
3472
3472
|
default: {
|
|
3473
3473
|
const t = this.getEquation();
|
|
3474
|
-
return s(this,
|
|
3474
|
+
return s(this, B).isNegative() && t.multiply(-1), t.display;
|
|
3475
3475
|
}
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
3478
|
get normal() {
|
|
3479
|
-
return new E(s(this,
|
|
3479
|
+
return new E(s(this, B), s(this, z));
|
|
3480
3480
|
}
|
|
3481
3481
|
get director() {
|
|
3482
3482
|
return s(this, J).clone();
|
|
3483
3483
|
}
|
|
3484
3484
|
get slope() {
|
|
3485
|
-
return s(this,
|
|
3485
|
+
return s(this, B).clone().opposite().divide(s(this, z));
|
|
3486
3486
|
}
|
|
3487
3487
|
get height() {
|
|
3488
3488
|
return s(this, W).clone().opposite().divide(s(this, z));
|
|
@@ -3491,7 +3491,7 @@ const De = class De {
|
|
|
3491
3491
|
return this.fromPointAndDirection(e, new E(e, t));
|
|
3492
3492
|
}
|
|
3493
3493
|
distanceTo(e) {
|
|
3494
|
-
const t = e.x.clone().multiply(s(this,
|
|
3494
|
+
const t = e.x.clone().multiply(s(this, B)).add(e.y.clone().multiply(s(this, z))).add(s(this, W)).abs(), i = this.normal.normSquare;
|
|
3495
3495
|
if (i.isZero())
|
|
3496
3496
|
return {
|
|
3497
3497
|
value: NaN,
|
|
@@ -3521,17 +3521,17 @@ const De = class De {
|
|
|
3521
3521
|
canonicalAsFloatCoefficient(e) {
|
|
3522
3522
|
e === void 0 && (e = 2);
|
|
3523
3523
|
let t = "";
|
|
3524
|
-
return s(this,
|
|
3524
|
+
return s(this, B).isZero() || (s(this, B).isOne() ? t = "x" : s(this, B).clone().opposite().isOne() ? t = "-x" : t = s(this, B).value.toFixed(e) + "x"), s(this, z).isZero() || (s(this, z).isPositive() && (t += "+"), t += s(this, z).value.toFixed(e) + "y"), s(this, W).isZero() || (s(this, W).isPositive() && (t += "+"), t += s(this, W).value.toFixed(e)), t + "=0";
|
|
3525
3525
|
}
|
|
3526
3526
|
};
|
|
3527
|
-
|
|
3527
|
+
$e = new WeakMap(), B = new WeakMap(), z = new WeakMap(), W = new WeakMap(), he = new WeakMap(), J = new WeakMap(), Ie = new WeakMap(), xe = new WeakMap(), // A line is defined as the canonical form
|
|
3528
3528
|
a(De, "PERPENDICULAR", we.Perpendicular), a(De, "PARALLEL", we.Parallel);
|
|
3529
3529
|
let R = De;
|
|
3530
|
-
var
|
|
3530
|
+
var ae, j, qe, Ut, Wt, Gt, le, $i, Nt, Ii, Si, Bi, hi;
|
|
3531
3531
|
const Ht = class Ht {
|
|
3532
3532
|
constructor(...e) {
|
|
3533
3533
|
m(this, le);
|
|
3534
|
-
m(this,
|
|
3534
|
+
m(this, ae);
|
|
3535
3535
|
m(this, j);
|
|
3536
3536
|
m(this, qe);
|
|
3537
3537
|
/**
|
|
@@ -3540,9 +3540,9 @@ const Ht = class Ht {
|
|
|
3540
3540
|
* @returns {number}
|
|
3541
3541
|
*/
|
|
3542
3542
|
a(this, "relativePosition", (e) => {
|
|
3543
|
-
if (s(this,
|
|
3543
|
+
if (s(this, ae) === void 0 || s(this, j) === void 0)
|
|
3544
3544
|
throw new Error("Circle not defined");
|
|
3545
|
-
const t = e.distanceTo(s(this,
|
|
3545
|
+
const t = e.distanceTo(s(this, ae)), i = Math.sqrt(s(this, j).value);
|
|
3546
3546
|
return t.value - i > 1e-10 ? 0 : Math.abs(t.value - i) < 1e-10 ? 1 : 2;
|
|
3547
3547
|
});
|
|
3548
3548
|
a(this, "lineIntersection", (e) => {
|
|
@@ -3552,7 +3552,7 @@ const Ht = class Ht {
|
|
|
3552
3552
|
const i = s(this, qe).clone(), n = e.getEquation().clone().isolate("x"), r = e.getEquation().clone().isolate("y");
|
|
3553
3553
|
return n instanceof H && r instanceof H && (i.replaceBy("y", r.right).simplify(), i.solve()), t;
|
|
3554
3554
|
});
|
|
3555
|
-
a(this, "tangents", (e) => e instanceof u ? s(this, Gt).call(this, e) : this.isPointOnCircle(e) ? s(this, Ut).call(this, e) : s(this,
|
|
3555
|
+
a(this, "tangents", (e) => e instanceof u ? s(this, Gt).call(this, e) : this.isPointOnCircle(e) ? s(this, Ut).call(this, e) : s(this, ae) !== void 0 && s(this, ae).distanceTo(e).value > this.radius.value ? s(this, Wt).call(this, e) : (console.log("No tangents as the point is inside !"), []));
|
|
3556
3556
|
a(this, "isPointOnCircle", (e) => {
|
|
3557
3557
|
var t;
|
|
3558
3558
|
return ((t = s(this, qe)) == null ? void 0 : t.test({ x: e.x, y: e.y })) ?? !1;
|
|
@@ -3562,7 +3562,7 @@ const Ht = class Ht {
|
|
|
3562
3562
|
return t.forEach((n) => {
|
|
3563
3563
|
for (const r of [[1, 1], [-1, 1], [-1, -1], [1, -1]])
|
|
3564
3564
|
i.push(
|
|
3565
|
-
new
|
|
3565
|
+
new S(
|
|
3566
3566
|
this.center.x.clone().add(r[0] * n[0]),
|
|
3567
3567
|
this.center.y.clone().add(r[1] * n[1])
|
|
3568
3568
|
)
|
|
@@ -3588,7 +3588,7 @@ const Ht = class Ht {
|
|
|
3588
3588
|
e.length > 0 && this.parse(...e);
|
|
3589
3589
|
}
|
|
3590
3590
|
get center() {
|
|
3591
|
-
return s(this,
|
|
3591
|
+
return s(this, ae) ?? new S();
|
|
3592
3592
|
}
|
|
3593
3593
|
get squareRadius() {
|
|
3594
3594
|
return s(this, j) ?? new u(0);
|
|
@@ -3631,7 +3631,7 @@ const Ht = class Ht {
|
|
|
3631
3631
|
return t ? h(this, j, new u(e)) : h(this, j, new u(e).pow(2)), A(this, le, Nt).call(this), this;
|
|
3632
3632
|
}
|
|
3633
3633
|
parse(...e) {
|
|
3634
|
-
return A(this, le,
|
|
3634
|
+
return A(this, le, $i).call(this), typeof e[0] == "string" ? A(this, le, hi).call(this, new H(e[0])) : e[0] instanceof H ? A(this, le, hi).call(this, e[0]) : e[0] instanceof Ht ? A(this, le, Ii).call(this, e[0]) : e[0] instanceof S && e.length > 1 && (e[1] instanceof S ? e[2] instanceof S || A(this, le, Bi).call(this, e[0], e[1]) : (e[1] instanceof u || typeof e[1] == "number") && A(this, le, Si).call(this, e[0], e[1], typeof e[2] == "boolean" ? e[2] : !1)), A(this, le, Nt).call(this), this;
|
|
3635
3635
|
}
|
|
3636
3636
|
// private _parseThroughtThreePoints(A: Point, B: Point, C: Point): this {
|
|
3637
3637
|
// const T = new Triangle(A, B, C), mAB = T.remarquables.mediators.AB.clone(),
|
|
@@ -3640,24 +3640,24 @@ const Ht = class Ht {
|
|
|
3640
3640
|
// return this
|
|
3641
3641
|
// }
|
|
3642
3642
|
};
|
|
3643
|
-
|
|
3644
|
-
return h(this,
|
|
3643
|
+
ae = new WeakMap(), j = new WeakMap(), qe = new WeakMap(), Ut = new WeakMap(), Wt = new WeakMap(), Gt = new WeakMap(), le = new WeakSet(), $i = function() {
|
|
3644
|
+
return h(this, ae, void 0), h(this, j, void 0), h(this, qe, void 0), this;
|
|
3645
3645
|
}, Nt = function() {
|
|
3646
3646
|
h(this, qe, new H(
|
|
3647
3647
|
new O(`(x-(${this.center.x.display}))^2+(y-(${this.center.y.display}))^2`),
|
|
3648
3648
|
new O(this.squareRadius.display)
|
|
3649
3649
|
).moveLeft());
|
|
3650
3650
|
}, Ii = function(e) {
|
|
3651
|
-
return h(this,
|
|
3652
|
-
},
|
|
3653
|
-
return h(this,
|
|
3654
|
-
},
|
|
3655
|
-
return h(this,
|
|
3651
|
+
return h(this, ae, e.center.clone()), h(this, j, e.squareRadius.clone()), A(this, le, Nt).call(this), this;
|
|
3652
|
+
}, Si = function(e, t, i) {
|
|
3653
|
+
return h(this, ae, e.clone()), i ? h(this, j, new u(t)) : h(this, j, new u(t).pow(2)), this;
|
|
3654
|
+
}, Bi = function(e, t) {
|
|
3655
|
+
return h(this, ae, e.clone()), h(this, j, new E(s(this, ae), t).normSquare), this;
|
|
3656
3656
|
}, hi = function(e) {
|
|
3657
3657
|
if (e.moveLeft(), e.degree("x").value === 2 && e.degree("y").value === 2) {
|
|
3658
3658
|
const t = e.left.monomByDegree(2, "x"), i = e.left.monomByDegree(2, "y");
|
|
3659
3659
|
let n, r, l;
|
|
3660
|
-
t.coefficient.isEqual(i.coefficient) ? (e.divide(t.coefficient), n = e.left.monomByDegree(1, "x"), r = e.left.monomByDegree(1, "y"), l = e.left.monomByDegree(0), h(this,
|
|
3660
|
+
t.coefficient.isEqual(i.coefficient) ? (e.divide(t.coefficient), n = e.left.monomByDegree(1, "x"), r = e.left.monomByDegree(1, "y"), l = e.left.monomByDegree(0), h(this, ae, new S(n.coefficient.clone().divide(2).opposite(), r.coefficient.clone().divide(2).opposite())), h(this, j, l.coefficient.clone().opposite().add(s(this, ae).x.clone().pow(2)).add(s(this, ae).y.clone().pow(2)))) : (h(this, ae, void 0), h(this, j, void 0));
|
|
3661
3661
|
}
|
|
3662
3662
|
return this;
|
|
3663
3663
|
};
|
|
@@ -3666,7 +3666,7 @@ var L, G;
|
|
|
3666
3666
|
const ct = class ct {
|
|
3667
3667
|
constructor(e, t) {
|
|
3668
3668
|
// ax + by + c = 0
|
|
3669
|
-
m(this, L, new
|
|
3669
|
+
m(this, L, new S());
|
|
3670
3670
|
m(this, G, new E());
|
|
3671
3671
|
a(this, "clone", () => (h(this, G, s(this, G).clone()), h(this, L, s(this, L).clone()), this));
|
|
3672
3672
|
// ------------------------------------------
|
|
@@ -3709,7 +3709,7 @@ const ct = class ct {
|
|
|
3709
3709
|
// }
|
|
3710
3710
|
a(this, "randomPoint", (e = 5) => {
|
|
3711
3711
|
const t = s(this, L).clone(), i = new u(Q(e, !1));
|
|
3712
|
-
return new
|
|
3712
|
+
return new S(
|
|
3713
3713
|
t.x.clone().add(s(this, G).x.clone().multiply(i)),
|
|
3714
3714
|
t.y.clone().add(s(this, G).y.clone().multiply(i)),
|
|
3715
3715
|
t.z.clone().add(s(this, G).z.clone().multiply(i))
|
|
@@ -3736,9 +3736,9 @@ const ct = class ct {
|
|
|
3736
3736
|
return {
|
|
3737
3737
|
parametric: `${E.asTex("x", "y", "z")} = ${E.asTex(s(this, L).x.tex, s(this, L).y.tex, s(this, L).z.tex)} + k\\cdot ${E.asTex(s(this, G).x.tex, s(this, G).y.tex, s(this, G).z.tex)}`,
|
|
3738
3738
|
system: `\\left\\{\\begin{aligned}
|
|
3739
|
-
x &= ${new O(s(this, L).x).add(new
|
|
3740
|
-
y &= ${new O(s(this, L).y).add(new
|
|
3741
|
-
z &= ${new O(s(this, L).z).add(new
|
|
3739
|
+
x &= ${new O(s(this, L).x).add(new M(s(this, G).x).multiply(new M("k"))).reorder("k", !0).tex}\\\\
|
|
3740
|
+
y &= ${new O(s(this, L).y).add(new M(s(this, G).y).multiply(new M("k"))).reorder("k", !0).tex}\\\\
|
|
3741
|
+
z &= ${new O(s(this, L).z).add(new M(s(this, G).z).multiply(new M("k"))).reorder("k", !0).tex}
|
|
3742
3742
|
\\end{aligned}\\right.`,
|
|
3743
3743
|
cartesian: `\\frac{ ${new O("x", 1, s(this, L).x.clone().opposite()).tex} }{ ${this.direction.x.tex} } = \\frac{ ${new O("y", 1, s(this, L).y.clone().opposite()).tex} }{ ${this.direction.y.tex} } = \\frac{ ${new O("z", 1, s(this, L).z.clone().opposite()).tex} }{ ${this.direction.z.tex} }`
|
|
3744
3744
|
};
|
|
@@ -3772,23 +3772,23 @@ const ct = class ct {
|
|
|
3772
3772
|
L = new WeakMap(), G = new WeakMap(), // A line is defined as the canonical form
|
|
3773
3773
|
a(ct, "PERPENDICULAR", oi.Perpendicular), a(ct, "PARALLEL", oi.Parallel);
|
|
3774
3774
|
let Ot = ct;
|
|
3775
|
-
var
|
|
3775
|
+
var ke;
|
|
3776
3776
|
class cs {
|
|
3777
3777
|
constructor(...e) {
|
|
3778
|
-
m(this,
|
|
3779
|
-
return h(this,
|
|
3778
|
+
m(this, ke, []);
|
|
3779
|
+
return h(this, ke, e), this;
|
|
3780
3780
|
}
|
|
3781
3781
|
get values() {
|
|
3782
|
-
return s(this,
|
|
3782
|
+
return s(this, ke);
|
|
3783
3783
|
}
|
|
3784
3784
|
get array() {
|
|
3785
|
-
return s(this,
|
|
3785
|
+
return s(this, ke).map((e) => e.array);
|
|
3786
3786
|
}
|
|
3787
3787
|
get dimension() {
|
|
3788
|
-
return [s(this,
|
|
3788
|
+
return [s(this, ke).length, s(this, ke)[0].dimension];
|
|
3789
3789
|
}
|
|
3790
3790
|
isSquare() {
|
|
3791
|
-
return s(this,
|
|
3791
|
+
return s(this, ke).length === s(this, ke)[0].dimension;
|
|
3792
3792
|
}
|
|
3793
3793
|
determinant() {
|
|
3794
3794
|
if (!this.isSquare())
|
|
@@ -3796,19 +3796,19 @@ class cs {
|
|
|
3796
3796
|
return hs(...this.values);
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
3799
|
-
|
|
3800
|
-
var
|
|
3799
|
+
ke = new WeakMap();
|
|
3800
|
+
var Me, Ue;
|
|
3801
3801
|
const mi = class mi {
|
|
3802
3802
|
constructor(e) {
|
|
3803
|
-
m(this,
|
|
3804
|
-
m(this, Ue, new
|
|
3803
|
+
m(this, Me, new E(0, 0, 1));
|
|
3804
|
+
m(this, Ue, new S(0, 0, 0));
|
|
3805
3805
|
return e && this.parse(e), this;
|
|
3806
3806
|
}
|
|
3807
3807
|
get normal() {
|
|
3808
|
-
return s(this,
|
|
3808
|
+
return s(this, Me);
|
|
3809
3809
|
}
|
|
3810
3810
|
set normal(e) {
|
|
3811
|
-
h(this,
|
|
3811
|
+
h(this, Me, e), s(this, Me).asPoint = !1;
|
|
3812
3812
|
}
|
|
3813
3813
|
get point() {
|
|
3814
3814
|
return s(this, Ue);
|
|
@@ -3817,16 +3817,16 @@ const mi = class mi {
|
|
|
3817
3817
|
h(this, Ue, e), s(this, Ue).asPoint = !0;
|
|
3818
3818
|
}
|
|
3819
3819
|
get a() {
|
|
3820
|
-
return s(this,
|
|
3820
|
+
return s(this, Me).x;
|
|
3821
3821
|
}
|
|
3822
3822
|
get b() {
|
|
3823
|
-
return s(this,
|
|
3823
|
+
return s(this, Me).y;
|
|
3824
3824
|
}
|
|
3825
3825
|
get c() {
|
|
3826
|
-
return s(this,
|
|
3826
|
+
return s(this, Me).z;
|
|
3827
3827
|
}
|
|
3828
3828
|
get d() {
|
|
3829
|
-
return s(this,
|
|
3829
|
+
return s(this, Me).dot(s(this, Ue)).opposite();
|
|
3830
3830
|
}
|
|
3831
3831
|
get tex() {
|
|
3832
3832
|
return new H(
|
|
@@ -3848,7 +3848,7 @@ const mi = class mi {
|
|
|
3848
3848
|
}
|
|
3849
3849
|
if (e.equation) {
|
|
3850
3850
|
const r = e.equation.moveLeft().reduce().left, l = r.monomByLetter("x").coefficient, c = r.monomByLetter("y").coefficient, f = r.monomByLetter("z").coefficient, d = r.monomByDegree(0).coefficient;
|
|
3851
|
-
this.normal = new E(l, c, f), l.isNotZero() ? this.point = new
|
|
3851
|
+
this.normal = new E(l, c, f), l.isNotZero() ? this.point = new S(d.clone().divide(l).opposite(), 0, 0) : c.isNotZero() ? this.point = new S(0, d.clone().divide(c).opposite(), 0) : this.point = new S(0, 0, d.clone().divide(f).opposite());
|
|
3852
3852
|
return;
|
|
3853
3853
|
}
|
|
3854
3854
|
if (((i = e.points) == null ? void 0 : i.length) === 3 && e.points.every((r) => r instanceof E)) {
|
|
@@ -3858,7 +3858,7 @@ const mi = class mi {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
if (((n = e.coefficients) == null ? void 0 : n.length) === 4) {
|
|
3860
3860
|
const [r, l, c, f] = e.coefficients;
|
|
3861
|
-
this.normal = new E(r, l, c), this.point = new
|
|
3861
|
+
this.normal = new E(r, l, c), this.point = new S(0, 0, -f);
|
|
3862
3862
|
return;
|
|
3863
3863
|
}
|
|
3864
3864
|
}
|
|
@@ -3882,29 +3882,29 @@ const mi = class mi {
|
|
|
3882
3882
|
return t.clone().add(i.clone().multiplyByScalar(n));
|
|
3883
3883
|
}
|
|
3884
3884
|
intersectWithPlane(e) {
|
|
3885
|
-
throw this.normal.cross(e.normal), new
|
|
3885
|
+
throw this.normal.cross(e.normal), new S(0, 0, 0), new Error("Intersection with plane not yet implemented !");
|
|
3886
3886
|
}
|
|
3887
3887
|
isPointOnPlane(e) {
|
|
3888
3888
|
return this.normal.dot(e).add(this.d).isZero();
|
|
3889
3889
|
}
|
|
3890
3890
|
};
|
|
3891
|
-
|
|
3891
|
+
Me = new WeakMap(), Ue = new WeakMap();
|
|
3892
3892
|
let ai = mi;
|
|
3893
|
-
var Y, _, ee, st, Ce, yt, Xt, wt,
|
|
3893
|
+
var Y, _, ee, st, Ce, yt, Xt, wt, Se, Yt, nt;
|
|
3894
3894
|
const Qt = class Qt {
|
|
3895
3895
|
constructor(...e) {
|
|
3896
|
-
m(this, Y, new
|
|
3897
|
-
m(this, _, new
|
|
3898
|
-
m(this, ee, new
|
|
3896
|
+
m(this, Y, new S());
|
|
3897
|
+
m(this, _, new S());
|
|
3898
|
+
m(this, ee, new S());
|
|
3899
3899
|
m(this, st, {
|
|
3900
3900
|
AB: new R(),
|
|
3901
3901
|
AC: new R(),
|
|
3902
3902
|
BC: new R()
|
|
3903
3903
|
});
|
|
3904
3904
|
m(this, Ce, {
|
|
3905
|
-
AB: new
|
|
3906
|
-
AC: new
|
|
3907
|
-
BC: new
|
|
3905
|
+
AB: new S(),
|
|
3906
|
+
AC: new S(),
|
|
3907
|
+
BC: new S()
|
|
3908
3908
|
});
|
|
3909
3909
|
m(this, yt, null);
|
|
3910
3910
|
// ------------------------------------------
|
|
@@ -3947,7 +3947,7 @@ const Qt = class Qt {
|
|
|
3947
3947
|
h(this, Y, r.point.clone());
|
|
3948
3948
|
else
|
|
3949
3949
|
throw new Error("Lines do not intersect !");
|
|
3950
|
-
} else e.every((t) => t instanceof
|
|
3950
|
+
} else e.every((t) => t instanceof S) && (h(this, Y, e[0].clone()), h(this, _, e[1].clone()), h(this, ee, e[2].clone()), h(this, st, {
|
|
3951
3951
|
AB: new R(s(this, Y), s(this, _)),
|
|
3952
3952
|
BC: new R(s(this, _), s(this, ee)),
|
|
3953
3953
|
AC: new R(s(this, Y), s(this, ee))
|
|
@@ -3972,9 +3972,9 @@ const Qt = class Qt {
|
|
|
3972
3972
|
*/
|
|
3973
3973
|
m(this, Xt, () => {
|
|
3974
3974
|
s(this, Y).asPoint = !0, s(this, _).asPoint = !0, s(this, ee).asPoint = !0, h(this, Ce, {
|
|
3975
|
-
AB: new
|
|
3976
|
-
AC: new
|
|
3977
|
-
BC: new
|
|
3975
|
+
AB: new S().middleOf(s(this, Y), s(this, _)),
|
|
3976
|
+
AC: new S().middleOf(s(this, Y), s(this, ee)),
|
|
3977
|
+
BC: new S().middleOf(s(this, _), s(this, ee))
|
|
3978
3978
|
}), h(this, yt, s(this, Yt).call(this));
|
|
3979
3979
|
});
|
|
3980
3980
|
/**
|
|
@@ -3997,7 +3997,7 @@ const Qt = class Qt {
|
|
|
3997
3997
|
* @param ptName1
|
|
3998
3998
|
* @param ptName2
|
|
3999
3999
|
*/
|
|
4000
|
-
m(this,
|
|
4000
|
+
m(this, Se, (e, t) => new E(
|
|
4001
4001
|
s(this, wt).call(this, e),
|
|
4002
4002
|
s(this, wt).call(this, t)
|
|
4003
4003
|
));
|
|
@@ -4059,22 +4059,22 @@ const Qt = class Qt {
|
|
|
4059
4059
|
return s(this, ee);
|
|
4060
4060
|
}
|
|
4061
4061
|
get AB() {
|
|
4062
|
-
return s(this,
|
|
4062
|
+
return s(this, Se).call(this, "A", "B");
|
|
4063
4063
|
}
|
|
4064
4064
|
get BA() {
|
|
4065
|
-
return s(this,
|
|
4065
|
+
return s(this, Se).call(this, "B", "A");
|
|
4066
4066
|
}
|
|
4067
4067
|
get BC() {
|
|
4068
|
-
return s(this,
|
|
4068
|
+
return s(this, Se).call(this, "B", "C");
|
|
4069
4069
|
}
|
|
4070
4070
|
get CB() {
|
|
4071
|
-
return s(this,
|
|
4071
|
+
return s(this, Se).call(this, "C", "B");
|
|
4072
4072
|
}
|
|
4073
4073
|
get AC() {
|
|
4074
|
-
return s(this,
|
|
4074
|
+
return s(this, Se).call(this, "A", "C");
|
|
4075
4075
|
}
|
|
4076
4076
|
get CA() {
|
|
4077
|
-
return s(this,
|
|
4077
|
+
return s(this, Se).call(this, "C", "A");
|
|
4078
4078
|
}
|
|
4079
4079
|
get isRectangle() {
|
|
4080
4080
|
return !!(this.AB.isNormalTo(this.BC) || this.AB.isNormalTo(this.AC) || this.BC.isNormalTo(this.AC));
|
|
@@ -4092,7 +4092,7 @@ const Qt = class Qt {
|
|
|
4092
4092
|
return s(this, yt);
|
|
4093
4093
|
}
|
|
4094
4094
|
};
|
|
4095
|
-
Y = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), st = new WeakMap(), Ce = new WeakMap(), yt = new WeakMap(), Xt = new WeakMap(), wt = new WeakMap(),
|
|
4095
|
+
Y = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), st = new WeakMap(), Ce = new WeakMap(), yt = new WeakMap(), Xt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Yt = new WeakMap(), nt = new WeakMap();
|
|
4096
4096
|
let li = Qt;
|
|
4097
4097
|
function qt(o) {
|
|
4098
4098
|
const e = Object.assign(
|
|
@@ -4123,7 +4123,7 @@ function Ri(o) {
|
|
|
4123
4123
|
zero: !1
|
|
4124
4124
|
},
|
|
4125
4125
|
o
|
|
4126
|
-
), t = new
|
|
4126
|
+
), t = new M();
|
|
4127
4127
|
if (t.coefficient = qt({
|
|
4128
4128
|
zero: e.zero,
|
|
4129
4129
|
reduced: !0,
|
|
@@ -4213,7 +4213,7 @@ function ci(o) {
|
|
|
4213
4213
|
},
|
|
4214
4214
|
o
|
|
4215
4215
|
), t = e.axis === "x", i = e.axis === "y", n = e.fraction ? qt({ max: e.max, zero: t }) : new u(Q(e.max, t)), r = e.fraction ? qt({ max: e.max, zero: i }) : new u(Q(e.max, i));
|
|
4216
|
-
return Number(e.quadrant) === 1 && (n.abs(), r.abs()), Number(e.quadrant) === 2 && (n.isPositive() && n.opposite(), r.isNegative() && r.opposite()), Number(e.quadrant) === 3 && (n.isPositive() && n.opposite(), r.isPositive() && r.opposite()), Number(e.quadrant) === 4 && (n.isNegative() && n.opposite(), r.isPositive() && r.opposite()), new
|
|
4216
|
+
return Number(e.quadrant) === 1 && (n.abs(), r.abs()), Number(e.quadrant) === 2 && (n.isPositive() && n.opposite(), r.isNegative() && r.opposite()), Number(e.quadrant) === 3 && (n.isPositive() && n.opposite(), r.isPositive() && r.opposite()), Number(e.quadrant) === 4 && (n.isNegative() && n.opposite(), r.isPositive() && r.opposite()), new S(n, r);
|
|
4217
4217
|
}
|
|
4218
4218
|
function ds(o) {
|
|
4219
4219
|
const e = Object.assign(
|
|
@@ -4244,7 +4244,7 @@ function ps(o) {
|
|
|
4244
4244
|
);
|
|
4245
4245
|
for (; t.isNull; )
|
|
4246
4246
|
t.x = Q(10), t.y = Q(10);
|
|
4247
|
-
return e.slope === 1 ? t.x.sign() !== t.y.sign() && t.y.opposite() : e.slope === -1 && t.x.sign() !== t.y.sign() && t.y.opposite(), new R(new E(e.A.x, e.A.y), t);
|
|
4247
|
+
return e.slope === 1 ? t.x.sign() !== t.y.sign() && t.y.opposite() : e.slope === -1 && t.x.sign() !== t.y.sign() && t.y.opposite(), new R().fromPointAndDirection(new E(e.A.x, e.A.y), t);
|
|
4248
4248
|
}
|
|
4249
4249
|
function ms(o) {
|
|
4250
4250
|
const e = Object.assign(
|
|
@@ -4261,7 +4261,7 @@ function ms(o) {
|
|
|
4261
4261
|
}
|
|
4262
4262
|
},
|
|
4263
4263
|
o
|
|
4264
|
-
), t = new
|
|
4264
|
+
), t = new S(e.A.x, e.A.y, e.A.z), i = new E(e.direction.x, e.direction.y, e.direction.z);
|
|
4265
4265
|
return new Ot(t, i);
|
|
4266
4266
|
}
|
|
4267
4267
|
const gs = {
|
|
@@ -4275,7 +4275,7 @@ const gs = {
|
|
|
4275
4275
|
bool: (o) => Ci(o),
|
|
4276
4276
|
array: (o, e) => ls(o, e),
|
|
4277
4277
|
item: (o) => di(o),
|
|
4278
|
-
shuffle: (o) =>
|
|
4278
|
+
shuffle: (o) => Pi(o),
|
|
4279
4279
|
line: (o) => ps(o),
|
|
4280
4280
|
line3: (o) => ms(o),
|
|
4281
4281
|
vector: (o) => ci(o),
|
|
@@ -4288,18 +4288,18 @@ const gs = {
|
|
|
4288
4288
|
Numeric: U,
|
|
4289
4289
|
Fraction: u,
|
|
4290
4290
|
Root: vt,
|
|
4291
|
-
Monom:
|
|
4291
|
+
Monom: M,
|
|
4292
4292
|
Polynom: O,
|
|
4293
4293
|
Equation: H,
|
|
4294
4294
|
Matrix: cs,
|
|
4295
4295
|
LinearSystem: ti,
|
|
4296
|
-
Factor:
|
|
4296
|
+
Factor: se,
|
|
4297
4297
|
PolyFactor: si,
|
|
4298
4298
|
LogicalSet: ss,
|
|
4299
4299
|
Random: gs,
|
|
4300
4300
|
Geometry: {
|
|
4301
4301
|
Vector: E,
|
|
4302
|
-
Point:
|
|
4302
|
+
Point: S,
|
|
4303
4303
|
Line: R,
|
|
4304
4304
|
Triangle: li,
|
|
4305
4305
|
Circle: Tt,
|
|
@@ -4313,19 +4313,19 @@ export {
|
|
|
4313
4313
|
H as Equation,
|
|
4314
4314
|
At as EquationSolver,
|
|
4315
4315
|
lt as FACTOR_DISPLAY,
|
|
4316
|
-
|
|
4316
|
+
se as Factor,
|
|
4317
4317
|
u as Fraction,
|
|
4318
4318
|
R as Line,
|
|
4319
4319
|
Ot as Line3,
|
|
4320
4320
|
ti as LinearSystem,
|
|
4321
4321
|
ss as LogicalSet,
|
|
4322
4322
|
cs as Matrix,
|
|
4323
|
-
|
|
4323
|
+
M as Monom,
|
|
4324
4324
|
vt as NthRoot,
|
|
4325
4325
|
is as NumExp,
|
|
4326
4326
|
U as Numeric,
|
|
4327
4327
|
ai as Plane3,
|
|
4328
|
-
|
|
4328
|
+
S as Point,
|
|
4329
4329
|
si as PolyFactor,
|
|
4330
4330
|
O as Polynom,
|
|
4331
4331
|
gs as Random,
|