pimath 0.1.3 → 0.1.5
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
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var qi = Object.defineProperty;
|
|
2
|
+
var si = (o) => {
|
|
3
3
|
throw TypeError(o);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (o, e, t) =>
|
|
7
|
-
var i = (o, e, t) => (
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
5
|
+
var Ti = (o, e, t) => e in o ? qi(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
6
|
+
var a = (o, e, t) => Ti(o, typeof e != "symbol" ? e + "" : e, t), Ut = (o, e, t) => e.has(o) || si("Cannot " + t);
|
|
7
|
+
var i = (o, e, t) => (Ut(o, e, "read from private field"), t ? t.call(o) : e.get(o)), f = (o, e, t) => e.has(o) ? si("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), h = (o, e, t, s) => (Ut(o, e, "write to private field"), s ? s.call(o, t) : e.set(o, t), t), M = (o, e, t) => (Ut(o, e, "access private method"), t);
|
|
8
|
+
function Ai(o) {
|
|
9
|
+
const e = ni(o), t = [];
|
|
10
10
|
let s, r;
|
|
11
11
|
for (; e.length > 0; )
|
|
12
12
|
s = e.shift() ?? 1, r = (e.length > 0 ? e.pop() : +s) ?? 1, t.push([s, r]);
|
|
13
13
|
return t;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const e =
|
|
15
|
+
function Mi(...o) {
|
|
16
|
+
const e = _t(...o);
|
|
17
17
|
return o.map((t) => t / e);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function ni(o) {
|
|
20
20
|
const e = Math.abs(o), t = Math.sqrt(e), s = [];
|
|
21
21
|
for (let r = 1; r <= t; r++)
|
|
22
22
|
o % r === 0 && (s.push(r), s.push(e / r));
|
|
@@ -24,7 +24,7 @@ function oi(o) {
|
|
|
24
24
|
return r - n;
|
|
25
25
|
}), [...new Set(s)];
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function _t(...o) {
|
|
28
28
|
const e = function(r, n) {
|
|
29
29
|
return n === 0 ? r : e(n, r % n);
|
|
30
30
|
};
|
|
@@ -39,44 +39,44 @@ function ei(...o) {
|
|
|
39
39
|
;
|
|
40
40
|
return Math.abs(t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Ii(...o) {
|
|
43
43
|
return o.reduce(function(e, t) {
|
|
44
|
-
return Math.abs(e * t /
|
|
44
|
+
return Math.abs(e * t / _t(e, t));
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Ci(o, e = 3) {
|
|
48
48
|
return +o.toFixed(e);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function $i(o) {
|
|
51
51
|
if (Number.isSafeInteger(o) || o.toString().split(".")[0].length < 10)
|
|
52
52
|
return 0;
|
|
53
53
|
throw new Error("Periodic value: Not implemented yet");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Pi(o) {
|
|
56
56
|
const e = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973];
|
|
57
57
|
return o === void 0 ? e : e.slice(0, Math.min(e.length, o));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Si(o, e) {
|
|
60
60
|
const t = [], s = e === !0 ? +o : o ** 2;
|
|
61
61
|
for (let r = 0; r <= o; r++)
|
|
62
62
|
for (let n = 0; n <= o; n++)
|
|
63
63
|
r ** 2 + n ** 2 === s && t.push([r, n, o]);
|
|
64
64
|
return t;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Bi(o, e = 2) {
|
|
67
67
|
return +`${Math.round(+`${o}e${e}`)}e-${e}`;
|
|
68
68
|
}
|
|
69
69
|
const G = {
|
|
70
|
-
decompose:
|
|
71
|
-
dividers:
|
|
72
|
-
divideNumbersByGCD:
|
|
73
|
-
gcd:
|
|
74
|
-
lcm:
|
|
75
|
-
numberCorrection:
|
|
76
|
-
periodic:
|
|
77
|
-
primes:
|
|
78
|
-
pythagoreanTripletsWithTarget:
|
|
79
|
-
round:
|
|
70
|
+
decompose: Ai,
|
|
71
|
+
dividers: ni,
|
|
72
|
+
divideNumbersByGCD: Mi,
|
|
73
|
+
gcd: _t,
|
|
74
|
+
lcm: Ii,
|
|
75
|
+
numberCorrection: Ci,
|
|
76
|
+
periodic: $i,
|
|
77
|
+
primes: Pi,
|
|
78
|
+
pythagoreanTripletsWithTarget: Si,
|
|
79
|
+
round: Bi
|
|
80
80
|
};
|
|
81
81
|
var w, b, ot, Be;
|
|
82
82
|
const $ = class $ {
|
|
@@ -394,20 +394,20 @@ class ft {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
Z = new WeakMap(), J = new WeakMap(), se = new WeakMap(), We = new WeakMap();
|
|
397
|
-
var
|
|
397
|
+
var oi = (o) => {
|
|
398
398
|
throw TypeError(o);
|
|
399
|
-
},
|
|
400
|
-
const
|
|
399
|
+
}, hi = (o, e, t) => e.has(o) || oi("Cannot " + t), K = (o, e, t) => (hi(o, e, "read from private field"), t ? t.call(o) : e.get(o)), tt = (o, e, t) => e.has(o) ? oi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), be = (o, e, t, s) => (hi(o, e, "write to private field"), e.set(o, t), t);
|
|
400
|
+
const ai = {
|
|
401
401
|
pi: Math.PI,
|
|
402
402
|
e: Math.exp(1)
|
|
403
403
|
};
|
|
404
404
|
var d = /* @__PURE__ */ ((o) => (o.VARIABLE = "variable", o.COEFFICIENT = "coefficient", o.OPERATION = "operation", o.CONSTANT = "constant", o.FUNCTION = "function", o.FUNCTION_ARGUMENT = "function-argument", o.MONOM = "monom", o.LEFT_PARENTHESIS = "(", o.RIGHT_PARENTHESIS = ")", o))(d || {}), it = /* @__PURE__ */ ((o) => (o.EXPRESSION = "expression", o.POLYNOM = "polynom", o.SET = "set", o.NUMERIC = "numeric", o))(it || {});
|
|
405
|
-
function
|
|
405
|
+
function Ri(o, e) {
|
|
406
406
|
if (o.length <= 1)
|
|
407
407
|
return o;
|
|
408
408
|
const t = Object.keys(e).filter((E) => e[E].type === d.FUNCTION).map((E) => E);
|
|
409
409
|
t.sort((E, L) => L.length - E.length);
|
|
410
|
-
const s = new RegExp(`^(${t.join("|")})\\(`), r = Object.keys(
|
|
410
|
+
const s = new RegExp(`^(${t.join("|")})\\(`), r = Object.keys(ai);
|
|
411
411
|
r.sort((E, L) => L.length - E.length);
|
|
412
412
|
const n = new RegExp(`^(${r.join("|")})`), l = /^(\d+(\.\d+)?)/;
|
|
413
413
|
let u = "", p, m, g;
|
|
@@ -444,20 +444,20 @@ function zi(o, e) {
|
|
|
444
444
|
}
|
|
445
445
|
if (g === void 0 || m === void 0)
|
|
446
446
|
throw new Error("The token is undefined");
|
|
447
|
-
u +=
|
|
447
|
+
u += zi(p, m), u += g;
|
|
448
448
|
}
|
|
449
449
|
return u;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function zi(o, e) {
|
|
452
452
|
return o === void 0 || o === d.OPERATION || e === d.OPERATION || o === d.LEFT_PARENTHESIS || o === d.FUNCTION || o === d.FUNCTION_ARGUMENT || e === d.RIGHT_PARENTHESIS || e === d.FUNCTION_ARGUMENT ? "" : "*";
|
|
453
453
|
}
|
|
454
|
-
const
|
|
454
|
+
const ki = {
|
|
455
455
|
"^": { precedence: 4, associative: "right", type: d.OPERATION },
|
|
456
456
|
"*": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
457
457
|
"/": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
458
458
|
"+": { precedence: 2, associative: "left", type: d.OPERATION },
|
|
459
459
|
"-": { precedence: 2, associative: "left", type: d.OPERATION }
|
|
460
|
-
},
|
|
460
|
+
}, Li = {
|
|
461
461
|
"^": { precedence: 4, associative: "right", type: d.OPERATION },
|
|
462
462
|
"*": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
463
463
|
"/": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
@@ -470,7 +470,7 @@ const Li = {
|
|
|
470
470
|
sqrt: { precedence: 4, associative: "right", type: d.FUNCTION },
|
|
471
471
|
nthrt: { precedence: 4, associative: "right", type: d.FUNCTION },
|
|
472
472
|
",": { precedence: 2, associative: "left", type: d.FUNCTION_ARGUMENT }
|
|
473
|
-
},
|
|
473
|
+
}, Di = {
|
|
474
474
|
"^": { precedence: 4, associative: "right", type: d.OPERATION },
|
|
475
475
|
"*": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
476
476
|
"/": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
@@ -484,14 +484,14 @@ const Li = {
|
|
|
484
484
|
nthrt: { precedence: 4, associative: "right", type: d.FUNCTION },
|
|
485
485
|
ln: { precedence: 4, associative: "right", type: d.FUNCTION },
|
|
486
486
|
log: { precedence: 4, associative: "right", type: d.FUNCTION }
|
|
487
|
-
},
|
|
487
|
+
}, Zi = {
|
|
488
488
|
"&": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
489
489
|
"|": { precedence: 3, associative: "left", type: d.OPERATION },
|
|
490
490
|
"!": { precedence: 4, associative: "right", type: d.OPERATION },
|
|
491
491
|
"-": { precedence: 2, associative: "left", type: d.OPERATION }
|
|
492
492
|
};
|
|
493
493
|
var je, st, ie, dt, ke;
|
|
494
|
-
class
|
|
494
|
+
class li {
|
|
495
495
|
constructor(e) {
|
|
496
496
|
tt(this, je), tt(this, st, []), tt(this, ie, {}), tt(this, dt, []), tt(this, ke), be(this, je, typeof e > "u" ? it.POLYNOM : e), this.tokenConfigInitialization();
|
|
497
497
|
}
|
|
@@ -503,7 +503,7 @@ class ci {
|
|
|
503
503
|
return K(this, st).map((e) => e.token);
|
|
504
504
|
}
|
|
505
505
|
tokenConfigInitialization() {
|
|
506
|
-
return K(this, je) === it.SET ? (be(this, ie,
|
|
506
|
+
return K(this, je) === it.SET ? (be(this, ie, Zi), be(this, ke, !1)) : K(this, je) === it.NUMERIC ? (be(this, ie, Di), be(this, ke, !0)) : K(this, je) === it.EXPRESSION ? (be(this, ie, Li), be(this, ke, !0)) : (be(this, ie, ki), be(this, ke, !0)), be(this, dt, Object.keys(K(this, ie)).sort((e, t) => t.length - e.length)), K(this, ie);
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
* Get the next token to analyse.
|
|
@@ -524,7 +524,7 @@ class ci {
|
|
|
524
524
|
s += n, r = K(this, ie)[n].type;
|
|
525
525
|
break;
|
|
526
526
|
}
|
|
527
|
-
for (const n in
|
|
527
|
+
for (const n in ai)
|
|
528
528
|
if (e.substring(t, t + n.length) === n) {
|
|
529
529
|
s += n, r = d.CONSTANT;
|
|
530
530
|
break;
|
|
@@ -552,7 +552,7 @@ class ci {
|
|
|
552
552
|
parse(e, t) {
|
|
553
553
|
const s = [], r = [];
|
|
554
554
|
let n = "", l = 0, u;
|
|
555
|
-
(t ?? K(this, ke)) && (e =
|
|
555
|
+
(t ?? K(this, ke)) && (e = Ri(e, K(this, ie)));
|
|
556
556
|
const p = 50;
|
|
557
557
|
let m = 50, g;
|
|
558
558
|
for (; l < e.length; ) {
|
|
@@ -878,7 +878,7 @@ const P = class P {
|
|
|
878
878
|
return t;
|
|
879
879
|
});
|
|
880
880
|
f(this, bt, (e) => {
|
|
881
|
-
const s = new
|
|
881
|
+
const s = new li().parse(e).rpn, r = [];
|
|
882
882
|
if (s.length === 0)
|
|
883
883
|
return this.zero(), this;
|
|
884
884
|
if (s.length === 1) {
|
|
@@ -1097,8 +1097,8 @@ a(P, "xMultiply", (...e) => {
|
|
|
1097
1097
|
return t;
|
|
1098
1098
|
});
|
|
1099
1099
|
let I = P;
|
|
1100
|
-
var ue, De, S, ye, rt, ui, fi,
|
|
1101
|
-
const
|
|
1100
|
+
var ue, De, S, ye, rt, ci, ui, fi, Wt, di;
|
|
1101
|
+
const ti = class ti {
|
|
1102
1102
|
constructor(e, t, s = "x") {
|
|
1103
1103
|
f(this, S);
|
|
1104
1104
|
f(this, ue);
|
|
@@ -1111,20 +1111,20 @@ const ii = class ii {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
solve() {
|
|
1113
1113
|
if (i(this, ue).degree().isOne())
|
|
1114
|
-
return M(this, S,
|
|
1114
|
+
return M(this, S, ci).call(this);
|
|
1115
1115
|
if (i(this, ue).degree().value === 2)
|
|
1116
|
-
return M(this, S,
|
|
1117
|
-
const e = M(this, S,
|
|
1116
|
+
return M(this, S, ui).call(this);
|
|
1117
|
+
const e = M(this, S, di).call(this);
|
|
1118
1118
|
if (e.length > 0)
|
|
1119
1119
|
return e;
|
|
1120
1120
|
if (i(this, ue).degree().value === 3)
|
|
1121
|
-
return M(this, S,
|
|
1121
|
+
return M(this, S, Wt).call(this);
|
|
1122
1122
|
throw new Error("The equation degree is too high.");
|
|
1123
1123
|
}
|
|
1124
1124
|
solveAsCardan() {
|
|
1125
1125
|
if (i(this, ue).degree().value !== 3)
|
|
1126
1126
|
throw new Error("The equation is not cubic.");
|
|
1127
|
-
return M(this, S,
|
|
1127
|
+
return M(this, S, Wt).call(this);
|
|
1128
1128
|
}
|
|
1129
1129
|
};
|
|
1130
1130
|
ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
@@ -1146,12 +1146,12 @@ ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
|
1146
1146
|
tex: (t == null ? void 0 : t.tex) ?? "",
|
|
1147
1147
|
display: (t == null ? void 0 : t.display) ?? ""
|
|
1148
1148
|
};
|
|
1149
|
-
},
|
|
1149
|
+
}, ci = function() {
|
|
1150
1150
|
const e = i(this, ue).monomByDegree(0).coefficient.clone().opposite().divide(i(this, ue).monomByDegree(1).coefficient);
|
|
1151
1151
|
return [
|
|
1152
1152
|
M(this, S, ye).call(this, e)
|
|
1153
1153
|
];
|
|
1154
|
-
},
|
|
1154
|
+
}, ui = function() {
|
|
1155
1155
|
const e = i(this, ue), t = e.monomByDegree(2).coefficient, s = e.monomByDegree(1).coefficient, r = e.monomByDegree(0).coefficient, n = s.clone().pow(2).subtract(t.clone().multiply(r).multiply(4));
|
|
1156
1156
|
if (n.isNegative())
|
|
1157
1157
|
return [];
|
|
@@ -1162,14 +1162,14 @@ ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
|
1162
1162
|
M(this, S, ye).call(this, p)
|
|
1163
1163
|
].sort((m, g) => m.value - g.value);
|
|
1164
1164
|
}
|
|
1165
|
-
return M(this, S,
|
|
1166
|
-
},
|
|
1165
|
+
return M(this, S, fi).call(this, t, s, n);
|
|
1166
|
+
}, fi = function(e, t, s) {
|
|
1167
1167
|
const r = G.dividers(s.value).filter((pe) => Math.sqrt(pe) % 1 === 0).map((pe) => Math.sqrt(pe)).pop() ?? 1, n = G.gcd(2 * e.value, t.value, r) * (e.isNegative() ? -1 : 1), l = t.clone().divide(n).opposite(), u = e.clone().divide(n).multiply(2), p = s.clone().divide(r ** 2), m = Math.abs(r / n), g = r === 1 ? "-" : `-${m} `, E = r === 1 ? "+" : `+${m} `;
|
|
1168
|
-
function L(pe, ce, et,
|
|
1169
|
-
return `\\frac{ ${ce} ${et}\\sqrt{ ${
|
|
1168
|
+
function L(pe, ce, et, jt) {
|
|
1169
|
+
return `\\frac{ ${ce} ${et}\\sqrt{ ${jt} } }{ ${pe} }`;
|
|
1170
1170
|
}
|
|
1171
|
-
function te(pe, ce, et,
|
|
1172
|
-
return `(${ce}${et}sqrt(${
|
|
1171
|
+
function te(pe, ce, et, jt) {
|
|
1172
|
+
return `(${ce}${et}sqrt(${jt}))/${pe}`;
|
|
1173
1173
|
}
|
|
1174
1174
|
const ae = s.value ** 0.5, le = (-t.value - ae) / (2 * e.value), ge = (-t.value + ae) / (2 * e.value);
|
|
1175
1175
|
return [
|
|
@@ -1182,7 +1182,7 @@ ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
|
1182
1182
|
display: te(u.display, l.display, E.toString(), p.display)
|
|
1183
1183
|
})
|
|
1184
1184
|
].sort((pe, ce) => pe.value - ce.value);
|
|
1185
|
-
},
|
|
1185
|
+
}, Wt = function() {
|
|
1186
1186
|
const e = i(this, ue), t = e.monomByDegree(3).coefficient, s = e.monomByDegree(2).coefficient, r = e.monomByDegree(1).coefficient, n = e.monomByDegree(0).coefficient, l = s.clone().divide(t), u = r.clone().divide(t), p = n.clone().divide(t), m = u.clone().subtract(l.clone().pow(2).divide(3)), g = p.clone().subtract(l.clone().multiply(u).divide(3)).add(l.clone().pow(3).multiply(2).divide(27)), E = g.clone().opposite(), L = m.clone().opposite().pow(3).divide(27), te = E.clone().pow(2).subtract(L.clone().multiply(4)).opposite();
|
|
1187
1187
|
if (te.isNegative()) {
|
|
1188
1188
|
const ae = g.clone().opposite().add(te.clone().opposite().sqrt()).divide(2).root(3), le = g.clone().opposite().subtract(te.clone().opposite().sqrt()).divide(2).root(3), ge = ae.clone().add(le).subtract(l.clone().divide(3));
|
|
@@ -1202,7 +1202,7 @@ ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
|
1202
1202
|
return ae.map((ce) => M(this, S, rt).call(this, ce)).sort((ce, et) => ce.value - et.value);
|
|
1203
1203
|
}
|
|
1204
1204
|
return [];
|
|
1205
|
-
},
|
|
1205
|
+
}, di = function() {
|
|
1206
1206
|
let e = i(this, ue).clone(), t = [];
|
|
1207
1207
|
const s = e.lcmDenominator();
|
|
1208
1208
|
s !== 1 && e.multiply(s);
|
|
@@ -1229,11 +1229,11 @@ ue = new WeakMap(), De = new WeakMap(), S = new WeakSet(), ye = function(e) {
|
|
|
1229
1229
|
return [];
|
|
1230
1230
|
const p = e.clone().parse("0");
|
|
1231
1231
|
console.log(e.display), console.log(p.display);
|
|
1232
|
-
const m = new
|
|
1232
|
+
const m = new ti(e, e.clone().parse("0"), i(this, De));
|
|
1233
1233
|
return t = t.concat(m.solve()), t.sort((g, E) => g.value - E.value);
|
|
1234
1234
|
};
|
|
1235
|
-
let gt =
|
|
1236
|
-
var Ze, y, Xe, ht, Et, Nt, Ot, qt, at, Tt, At, Mt, It,
|
|
1235
|
+
let gt = ti;
|
|
1236
|
+
var Ze, y, Xe, ht, Et, Nt, Ot, qt, at, Tt, At, Mt, It, pi, Ct, Ye, $t;
|
|
1237
1237
|
const C = class C {
|
|
1238
1238
|
constructor(e, ...t) {
|
|
1239
1239
|
f(this, It);
|
|
@@ -1249,7 +1249,7 @@ const C = class C {
|
|
|
1249
1249
|
*/
|
|
1250
1250
|
a(this, "parse", (e, ...t) => {
|
|
1251
1251
|
if (h(this, y, []), h(this, Ze, []), typeof e == "string")
|
|
1252
|
-
return M(this, It,
|
|
1252
|
+
return M(this, It, pi).call(this, e, ...t);
|
|
1253
1253
|
if ((typeof e == "number" || e instanceof c || e instanceof I) && t.length === 0)
|
|
1254
1254
|
i(this, y).push(new I(e));
|
|
1255
1255
|
else if (e instanceof I && t.length > 0)
|
|
@@ -1693,7 +1693,7 @@ const C = class C {
|
|
|
1693
1693
|
* @param inputStr
|
|
1694
1694
|
*/
|
|
1695
1695
|
f(this, $t, (e) => {
|
|
1696
|
-
const s = new
|
|
1696
|
+
const s = new li().parse(e).rpn;
|
|
1697
1697
|
this.zero();
|
|
1698
1698
|
const r = [];
|
|
1699
1699
|
for (const n of s)
|
|
@@ -1758,7 +1758,7 @@ const C = class C {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
// #endregion Private methods (15)
|
|
1760
1760
|
};
|
|
1761
|
-
Ze = new WeakMap(), y = new WeakMap(), Xe = new WeakMap(), ht = new WeakMap(), Et = new WeakMap(), Nt = new WeakMap(), Ot = new WeakMap(), qt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), At = new WeakMap(), Mt = new WeakMap(), It = new WeakSet(),
|
|
1761
|
+
Ze = new WeakMap(), y = new WeakMap(), Xe = new WeakMap(), ht = new WeakMap(), Et = new WeakMap(), Nt = new WeakMap(), Ot = new WeakMap(), qt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), At = new WeakMap(), Mt = new WeakMap(), It = new WeakSet(), pi = function(e, ...t) {
|
|
1762
1762
|
if (t.length === 0) {
|
|
1763
1763
|
if (e = "" + e, e !== "" && !isNaN(Number(e))) {
|
|
1764
1764
|
this.empty();
|
|
@@ -1788,7 +1788,7 @@ Ze = new WeakMap(), y = new WeakMap(), Xe = new WeakMap(), ht = new WeakMap(), E
|
|
|
1788
1788
|
return this.zero();
|
|
1789
1789
|
}, Ct = new WeakMap(), Ye = new WeakMap(), $t = new WeakMap();
|
|
1790
1790
|
let T = C;
|
|
1791
|
-
function
|
|
1791
|
+
function ri(o, e = !0) {
|
|
1792
1792
|
return e ? `\\left( ${o} \\right)` : `(${o})`;
|
|
1793
1793
|
}
|
|
1794
1794
|
var Ee, Qe, Ne, Oe;
|
|
@@ -1843,7 +1843,7 @@ const we = class we {
|
|
|
1843
1843
|
get display() {
|
|
1844
1844
|
const e = this.power.numerator, t = this.power.denominator;
|
|
1845
1845
|
let s, r;
|
|
1846
|
-
return i(this, Ee) === 0 && t > 1 ? (s = `${t === 2 ? "sqrt" : `root(${t})`}(${this.polynom.display})`, r = Math.abs(e) === 1 ? "" : `^(${Math.abs(e)})`) : (s = i(this, Qe) && this.power.isOne() ? this.polynom.display :
|
|
1846
|
+
return i(this, Ee) === 0 && t > 1 ? (s = `${t === 2 ? "sqrt" : `root(${t})`}(${this.polynom.display})`, r = Math.abs(e) === 1 ? "" : `^(${Math.abs(e)})`) : (s = i(this, Qe) && this.power.isOne() ? this.polynom.display : ri(this.polynom.display, !1), r = t === 1 && Math.abs(e) === 1 ? "" : `^(${this.power.display})`), s = `${s}${r}`, i(this, Ee) === 0 && e < 0 && (s = `1/(${s})`), s;
|
|
1847
1847
|
}
|
|
1848
1848
|
divide(e) {
|
|
1849
1849
|
if (e instanceof we && this.isSameAs(e))
|
|
@@ -1922,7 +1922,7 @@ const we = class we {
|
|
|
1922
1922
|
get tex() {
|
|
1923
1923
|
const e = this.power.numerator, t = this.power.denominator;
|
|
1924
1924
|
let s, r;
|
|
1925
|
-
return i(this, Ee) === 0 && t > 1 ? (s = `\\sqrt${t === 2 ? "" : `[ ${t} ]`}{ ${this.polynom.tex} }`, r = Math.abs(e) === 1 ? "" : `^{ ${Math.abs(e)} }`) : (s = i(this, Qe) && this.power.isOne() ? this.polynom.tex :
|
|
1925
|
+
return i(this, Ee) === 0 && t > 1 ? (s = `\\sqrt${t === 2 ? "" : `[ ${t} ]`}{ ${this.polynom.tex} }`, r = Math.abs(e) === 1 ? "" : `^{ ${Math.abs(e)} }`) : (s = i(this, Qe) && this.power.isOne() ? this.polynom.tex : ri(this.polynom.tex), r = t === 1 && Math.abs(e) === 1 ? "" : `^{ ${this.power.tex} }`), s = `${s}${r}`, i(this, Ee) === 0 && e < 0 && (s = `\\frac{ 1 }{ ${s} }`), s;
|
|
1926
1926
|
}
|
|
1927
1927
|
get variables() {
|
|
1928
1928
|
return this.polynom.variables;
|
|
@@ -1933,191 +1933,7 @@ const we = class we {
|
|
|
1933
1933
|
};
|
|
1934
1934
|
Ee = new WeakMap(), Qe = new WeakMap(), Ne = new WeakMap(), Oe = new WeakMap();
|
|
1935
1935
|
let fe = we;
|
|
1936
|
-
var Ue = /* @__PURE__ */ ((o) => (o[o.ROOT = 0] = "ROOT", o[o.POWER = 1] = "POWER", o))(Ue || {}),
|
|
1937
|
-
const me = class me {
|
|
1938
|
-
// #endregion Class fields (1)
|
|
1939
|
-
// #region Constructors (1)
|
|
1940
|
-
constructor(...e) {
|
|
1941
|
-
// #region Class fields (1)
|
|
1942
|
-
f(this, N, []);
|
|
1943
|
-
f(this, Ve, Ue.POWER);
|
|
1944
|
-
return this.parse(...e), this;
|
|
1945
|
-
}
|
|
1946
|
-
// #endregion Constructors (1)
|
|
1947
|
-
// #region Properties and methods (25)
|
|
1948
|
-
parse(...e) {
|
|
1949
|
-
return e.length === 0 ? this : (h(this, N, []), e.forEach((t) => {
|
|
1950
|
-
if (typeof t == "string") {
|
|
1951
|
-
const s = t.split(")(").join(")*(").split("*");
|
|
1952
|
-
i(this, N).push(...s.map((r) => new fe(r)));
|
|
1953
|
-
} else t instanceof me ? i(this, N).push(...t.factors.map((s) => s.clone())) : i(this, N).push(new fe(t));
|
|
1954
|
-
}), this);
|
|
1955
|
-
}
|
|
1956
|
-
clone() {
|
|
1957
|
-
return new me(...i(this, N).map((e) => e.clone()));
|
|
1958
|
-
}
|
|
1959
|
-
add(...e) {
|
|
1960
|
-
let t = [this, ...e];
|
|
1961
|
-
const s = me.gcd(...t);
|
|
1962
|
-
t = t.map((n) => n.divide(s).reduce());
|
|
1963
|
-
const r = new T("0");
|
|
1964
|
-
return t.forEach((n) => r.add(n.develop())), h(this, N, [
|
|
1965
|
-
...s.factors,
|
|
1966
|
-
new fe(r)
|
|
1967
|
-
]), this;
|
|
1968
|
-
}
|
|
1969
|
-
degree(e) {
|
|
1970
|
-
return i(this, N).reduce((t, s) => t.add(s.degree(e)), new c("0"));
|
|
1971
|
-
}
|
|
1972
|
-
derivative() {
|
|
1973
|
-
const e = [], t = i(this, N).length;
|
|
1974
|
-
for (let r = 0; r < t; r++) {
|
|
1975
|
-
const n = i(this, N).slice(), l = n.splice(r, 1)[0];
|
|
1976
|
-
e.push(new me(...n).multiply(new me(...l.derivative())));
|
|
1977
|
-
}
|
|
1978
|
-
e.forEach((r) => r.reduce());
|
|
1979
|
-
const s = e.shift();
|
|
1980
|
-
return s !== void 0 && h(this, N, s.factors), this.add(...e);
|
|
1981
|
-
}
|
|
1982
|
-
develop() {
|
|
1983
|
-
const e = new T("1");
|
|
1984
|
-
return i(this, N).forEach((t) => {
|
|
1985
|
-
e.multiply(t.develop());
|
|
1986
|
-
}), e;
|
|
1987
|
-
}
|
|
1988
|
-
divide(e) {
|
|
1989
|
-
return h(this, N, i(this, N).concat(e.clone().factors.map((t) => t.inverse()))), this;
|
|
1990
|
-
}
|
|
1991
|
-
evaluate(e, t) {
|
|
1992
|
-
return t ? i(this, N).reduce((s, r) => s * r.evaluate(e, t), 1) : i(this, N).reduce((s, r) => s.multiply(r.evaluate(e)), new c("1"));
|
|
1993
|
-
}
|
|
1994
|
-
hasVariable(e) {
|
|
1995
|
-
return i(this, N).some((t) => t.hasVariable(e));
|
|
1996
|
-
}
|
|
1997
|
-
inverse() {
|
|
1998
|
-
return h(this, N, i(this, N).map((e) => e.inverse())), this;
|
|
1999
|
-
}
|
|
2000
|
-
isEqual(e) {
|
|
2001
|
-
const t = me.gcd(this, e), s = this.clone().divide(t).reduce(), r = e.clone().divide(t).reduce();
|
|
2002
|
-
return s.isOne() && r.isOne();
|
|
2003
|
-
}
|
|
2004
|
-
isOne() {
|
|
2005
|
-
return i(this, N).every((e) => e.isOne());
|
|
2006
|
-
}
|
|
2007
|
-
isZero() {
|
|
2008
|
-
return i(this, N).every((e) => e.isZero());
|
|
2009
|
-
}
|
|
2010
|
-
multiply(...e) {
|
|
2011
|
-
return e.forEach((t) => {
|
|
2012
|
-
h(this, N, i(this, N).concat(t.clone().factors));
|
|
2013
|
-
}), this;
|
|
2014
|
-
}
|
|
2015
|
-
one() {
|
|
2016
|
-
return h(this, N, [new fe("1", "1")]), this;
|
|
2017
|
-
}
|
|
2018
|
-
opposite() {
|
|
2019
|
-
const e = i(this, N).findIndex((t) => t.display === "(-1)");
|
|
2020
|
-
return e >= 0 ? i(this, N).splice(e, 1) : i(this, N).push(new fe("-1", "1")), this;
|
|
2021
|
-
}
|
|
2022
|
-
pow(e) {
|
|
2023
|
-
return h(this, N, i(this, N).map((t) => t.pow(e))), this;
|
|
2024
|
-
}
|
|
2025
|
-
primitive() {
|
|
2026
|
-
throw new Error("Method not implemented.");
|
|
2027
|
-
}
|
|
2028
|
-
reduce() {
|
|
2029
|
-
const e = Wt(this);
|
|
2030
|
-
return h(this, N, Object.values(e).map((t) => {
|
|
2031
|
-
const s = t[0].polynom, r = t.reduce((n, l) => n.add(l.power), new c("0"));
|
|
2032
|
-
return new fe(s, r.reduce());
|
|
2033
|
-
}).filter((t) => !t.power.isZero())), this;
|
|
2034
|
-
}
|
|
2035
|
-
root(e) {
|
|
2036
|
-
return h(this, N, i(this, N).map((t) => t.root(e))), this;
|
|
2037
|
-
}
|
|
2038
|
-
sort() {
|
|
2039
|
-
return h(this, N, i(this, N).sort((e, t) => e.degree().isLeq(t.degree()) ? -1 : 1)), this;
|
|
2040
|
-
}
|
|
2041
|
-
sqrt() {
|
|
2042
|
-
return h(this, N, i(this, N).map((e) => e.sqrt())), this;
|
|
2043
|
-
}
|
|
2044
|
-
subtract(...e) {
|
|
2045
|
-
return this.add(...e.map((t) => t.opposite()));
|
|
2046
|
-
}
|
|
2047
|
-
zero() {
|
|
2048
|
-
return h(this, N, [new fe("0", "1")]), this;
|
|
2049
|
-
}
|
|
2050
|
-
static gcd(...e) {
|
|
2051
|
-
var s;
|
|
2052
|
-
if (e.length === 0)
|
|
2053
|
-
return new me().one();
|
|
2054
|
-
if (e.length === 1)
|
|
2055
|
-
return e[0];
|
|
2056
|
-
if (e.length === 2)
|
|
2057
|
-
return M(s = me, lt, Yt).call(s, e[0], e[1]);
|
|
2058
|
-
let t = e[0];
|
|
2059
|
-
return e.shift(), e.forEach((r) => {
|
|
2060
|
-
var n;
|
|
2061
|
-
return t = M(n = me, lt, Yt).call(n, t, r);
|
|
2062
|
-
}), t;
|
|
2063
|
-
}
|
|
2064
|
-
// #endregion Properties and methods (25)
|
|
2065
|
-
// #region Getters And Setters (5)
|
|
2066
|
-
get factors() {
|
|
2067
|
-
return i(this, N);
|
|
2068
|
-
}
|
|
2069
|
-
set factors(e) {
|
|
2070
|
-
h(this, N, e);
|
|
2071
|
-
}
|
|
2072
|
-
get variables() {
|
|
2073
|
-
return i(this, N).reduce((e, t) => e.concat(t.variables), []);
|
|
2074
|
-
}
|
|
2075
|
-
get asRoot() {
|
|
2076
|
-
return h(this, Ve, Ue.ROOT), this;
|
|
2077
|
-
}
|
|
2078
|
-
get asPower() {
|
|
2079
|
-
return h(this, Ve, Ue.POWER), this;
|
|
2080
|
-
}
|
|
2081
|
-
get numerator() {
|
|
2082
|
-
return i(this, N).filter((e) => e.power.isPositive());
|
|
2083
|
-
}
|
|
2084
|
-
get denominator() {
|
|
2085
|
-
return i(this, N).filter((e) => e.power.isNegative());
|
|
2086
|
-
}
|
|
2087
|
-
get display() {
|
|
2088
|
-
let e = [], t = [];
|
|
2089
|
-
if (i(this, Ve) === Ue.ROOT ? (e = this.numerator, t = this.denominator.map((n) => n.clone().inverse())) : e = i(this, N), e.length === 0 && (e = [new fe("1")]), t.length === 0)
|
|
2090
|
-
return e.length === 1 ? e[0].asSingle.display : e.map((n) => n.display).join("");
|
|
2091
|
-
const s = e.length === 1 ? e[0].asSingle.display : e.map((n) => n.display).join(""), r = t.length === 1 ? t[0].asSingle.display : t.map((n) => n.display).join("");
|
|
2092
|
-
return `(${s})/(${r})`;
|
|
2093
|
-
}
|
|
2094
|
-
get tex() {
|
|
2095
|
-
let e = [], t = [];
|
|
2096
|
-
if (i(this, Ve) === Ue.ROOT ? (e = this.numerator, t = this.denominator.map((n) => n.clone().inverse())) : e = i(this, N), e.length === 0 && (e = [new fe("1")]), t.length === 0)
|
|
2097
|
-
return e.length === 1 ? e[0].asSingle.tex : e.map((n) => n.tex).join("");
|
|
2098
|
-
const s = e.length === 1 ? e[0].asSingle.tex : e.map((n) => n.tex).join(""), r = t.length === 1 ? t[0].asSingle.tex : t.map((n) => n.tex).join("");
|
|
2099
|
-
return `\\frac{ ${s} }{ ${r} }`;
|
|
2100
|
-
}
|
|
2101
|
-
// #endregion Private methods (1)
|
|
2102
|
-
};
|
|
2103
|
-
N = new WeakMap(), Ve = new WeakMap(), lt = new WeakSet(), Yt = function(e, t) {
|
|
2104
|
-
const s = Wt(e), r = Wt(t), l = Object.keys(s).filter((u) => Object.hasOwn(r, u)).map((u) => {
|
|
2105
|
-
const p = s[u].reduce((g, E) => g.add(E.power), new c("0")), m = r[u].reduce((g, E) => g.add(E.power), new c("0"));
|
|
2106
|
-
return new fe(u, c.min(p, m));
|
|
2107
|
-
});
|
|
2108
|
-
return new me(...l);
|
|
2109
|
-
}, f(me, lt);
|
|
2110
|
-
let Xt = me;
|
|
2111
|
-
function Wt(o) {
|
|
2112
|
-
const e = new c().one(), t = o.factors.reduce((s, r) => {
|
|
2113
|
-
if (r.polynom.degree().isZero())
|
|
2114
|
-
return r.polynom.monoms.length > 0 && e.multiply(r.polynom.monoms[0].coefficient), s;
|
|
2115
|
-
const n = r.polynom.display;
|
|
2116
|
-
return Object.hasOwn(s, n) ? s[n].push(r) : s[n] = [r], s;
|
|
2117
|
-
}, {});
|
|
2118
|
-
return e.isOne() || (t[e.display] = [new fe(e.display, 1)]), t;
|
|
2119
|
-
}
|
|
2120
|
-
var q, A, re, Pt, Ke, St;
|
|
1936
|
+
var Ue = /* @__PURE__ */ ((o) => (o[o.ROOT = 0] = "ROOT", o[o.POWER = 1] = "POWER", o))(Ue || {}), q, A, re, Pt, Ke, St;
|
|
2121
1937
|
const xe = class xe {
|
|
2122
1938
|
constructor(e, t, s) {
|
|
2123
1939
|
// Left part of the equation
|
|
@@ -2357,6 +2173,193 @@ const xe = class xe {
|
|
|
2357
2173
|
};
|
|
2358
2174
|
q = new WeakMap(), A = new WeakMap(), re = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), St = new WeakMap();
|
|
2359
2175
|
let H = xe;
|
|
2176
|
+
var N, Ve, lt, Xt;
|
|
2177
|
+
const me = class me {
|
|
2178
|
+
// #endregion Class fields (1)
|
|
2179
|
+
// #region Constructors (1)
|
|
2180
|
+
constructor(...e) {
|
|
2181
|
+
// #region Class fields (1)
|
|
2182
|
+
f(this, N, []);
|
|
2183
|
+
f(this, Ve, Ue.POWER);
|
|
2184
|
+
return this.parse(...e), this;
|
|
2185
|
+
}
|
|
2186
|
+
// #endregion Constructors (1)
|
|
2187
|
+
// #region Properties and methods (25)
|
|
2188
|
+
parse(...e) {
|
|
2189
|
+
return e.length === 0 ? this : (h(this, N, []), e.forEach((t) => {
|
|
2190
|
+
if (typeof t == "string") {
|
|
2191
|
+
const s = t.split(")(").join(")*(").split("*");
|
|
2192
|
+
i(this, N).push(...s.map((r) => new fe(r)));
|
|
2193
|
+
} else t instanceof me ? i(this, N).push(...t.factors.map((s) => s.clone())) : i(this, N).push(new fe(t));
|
|
2194
|
+
}), this);
|
|
2195
|
+
}
|
|
2196
|
+
fromPolynom(e, t) {
|
|
2197
|
+
return h(this, N, new T(e).factorize(t).map((s) => new fe(s))), this;
|
|
2198
|
+
}
|
|
2199
|
+
clone() {
|
|
2200
|
+
return new me(...i(this, N).map((e) => e.clone()));
|
|
2201
|
+
}
|
|
2202
|
+
add(...e) {
|
|
2203
|
+
let t = [this, ...e];
|
|
2204
|
+
const s = me.gcd(...t);
|
|
2205
|
+
t = t.map((n) => n.divide(s).reduce());
|
|
2206
|
+
const r = new T("0");
|
|
2207
|
+
return t.forEach((n) => r.add(n.develop())), h(this, N, [
|
|
2208
|
+
...s.factors,
|
|
2209
|
+
new fe(r)
|
|
2210
|
+
]), this;
|
|
2211
|
+
}
|
|
2212
|
+
degree(e) {
|
|
2213
|
+
return i(this, N).reduce((t, s) => t.add(s.degree(e)), new c("0"));
|
|
2214
|
+
}
|
|
2215
|
+
derivative() {
|
|
2216
|
+
const e = [], t = i(this, N).length;
|
|
2217
|
+
for (let r = 0; r < t; r++) {
|
|
2218
|
+
const n = i(this, N).slice(), l = n.splice(r, 1)[0];
|
|
2219
|
+
e.push(new me(...n).multiply(new me(...l.derivative())));
|
|
2220
|
+
}
|
|
2221
|
+
e.forEach((r) => r.reduce());
|
|
2222
|
+
const s = e.shift();
|
|
2223
|
+
return s !== void 0 && h(this, N, s.factors), this.add(...e);
|
|
2224
|
+
}
|
|
2225
|
+
develop() {
|
|
2226
|
+
const e = new T("1");
|
|
2227
|
+
return i(this, N).forEach((t) => {
|
|
2228
|
+
e.multiply(t.develop());
|
|
2229
|
+
}), e;
|
|
2230
|
+
}
|
|
2231
|
+
divide(e) {
|
|
2232
|
+
return h(this, N, i(this, N).concat(e.clone().factors.map((t) => t.inverse()))), this;
|
|
2233
|
+
}
|
|
2234
|
+
evaluate(e, t) {
|
|
2235
|
+
return t ? i(this, N).reduce((s, r) => s * r.evaluate(e, t), 1) : i(this, N).reduce((s, r) => s.multiply(r.evaluate(e)), new c("1"));
|
|
2236
|
+
}
|
|
2237
|
+
hasVariable(e) {
|
|
2238
|
+
return i(this, N).some((t) => t.hasVariable(e));
|
|
2239
|
+
}
|
|
2240
|
+
inverse() {
|
|
2241
|
+
return h(this, N, i(this, N).map((e) => e.inverse())), this;
|
|
2242
|
+
}
|
|
2243
|
+
isEqual(e) {
|
|
2244
|
+
const t = me.gcd(this, e), s = this.clone().divide(t).reduce(), r = e.clone().divide(t).reduce();
|
|
2245
|
+
return s.isOne() && r.isOne();
|
|
2246
|
+
}
|
|
2247
|
+
isOne() {
|
|
2248
|
+
return i(this, N).every((e) => e.isOne());
|
|
2249
|
+
}
|
|
2250
|
+
isZero() {
|
|
2251
|
+
return i(this, N).every((e) => e.isZero());
|
|
2252
|
+
}
|
|
2253
|
+
multiply(...e) {
|
|
2254
|
+
return e.forEach((t) => {
|
|
2255
|
+
h(this, N, i(this, N).concat(t.clone().factors));
|
|
2256
|
+
}), this;
|
|
2257
|
+
}
|
|
2258
|
+
one() {
|
|
2259
|
+
return h(this, N, [new fe("1", "1")]), this;
|
|
2260
|
+
}
|
|
2261
|
+
opposite() {
|
|
2262
|
+
const e = i(this, N).findIndex((t) => t.display === "(-1)");
|
|
2263
|
+
return e >= 0 ? i(this, N).splice(e, 1) : i(this, N).push(new fe("-1", "1")), this;
|
|
2264
|
+
}
|
|
2265
|
+
pow(e) {
|
|
2266
|
+
return h(this, N, i(this, N).map((t) => t.pow(e))), this;
|
|
2267
|
+
}
|
|
2268
|
+
primitive() {
|
|
2269
|
+
throw new Error("Method not implemented.");
|
|
2270
|
+
}
|
|
2271
|
+
reduce() {
|
|
2272
|
+
const e = Gt(this);
|
|
2273
|
+
return h(this, N, Object.values(e).map((t) => {
|
|
2274
|
+
const s = t[0].polynom, r = t.reduce((n, l) => n.add(l.power), new c("0"));
|
|
2275
|
+
return new fe(s, r.reduce());
|
|
2276
|
+
}).filter((t) => !t.power.isZero())), this;
|
|
2277
|
+
}
|
|
2278
|
+
root(e) {
|
|
2279
|
+
return h(this, N, i(this, N).map((t) => t.root(e))), this;
|
|
2280
|
+
}
|
|
2281
|
+
sort() {
|
|
2282
|
+
return h(this, N, i(this, N).sort((e, t) => e.degree().isLeq(t.degree()) ? -1 : 1)), this;
|
|
2283
|
+
}
|
|
2284
|
+
sqrt() {
|
|
2285
|
+
return h(this, N, i(this, N).map((e) => e.sqrt())), this;
|
|
2286
|
+
}
|
|
2287
|
+
subtract(...e) {
|
|
2288
|
+
return this.add(...e.map((t) => t.opposite()));
|
|
2289
|
+
}
|
|
2290
|
+
zero() {
|
|
2291
|
+
return h(this, N, [new fe("0", "1")]), this;
|
|
2292
|
+
}
|
|
2293
|
+
static gcd(...e) {
|
|
2294
|
+
var s;
|
|
2295
|
+
if (e.length === 0)
|
|
2296
|
+
return new me().one();
|
|
2297
|
+
if (e.length === 1)
|
|
2298
|
+
return e[0];
|
|
2299
|
+
if (e.length === 2)
|
|
2300
|
+
return M(s = me, lt, Xt).call(s, e[0], e[1]);
|
|
2301
|
+
let t = e[0];
|
|
2302
|
+
return e.shift(), e.forEach((r) => {
|
|
2303
|
+
var n;
|
|
2304
|
+
return t = M(n = me, lt, Xt).call(n, t, r);
|
|
2305
|
+
}), t;
|
|
2306
|
+
}
|
|
2307
|
+
// #endregion Properties and methods (25)
|
|
2308
|
+
// #region Getters And Setters (5)
|
|
2309
|
+
get factors() {
|
|
2310
|
+
return i(this, N);
|
|
2311
|
+
}
|
|
2312
|
+
set factors(e) {
|
|
2313
|
+
h(this, N, e);
|
|
2314
|
+
}
|
|
2315
|
+
get variables() {
|
|
2316
|
+
return i(this, N).reduce((e, t) => e.concat(t.variables), []);
|
|
2317
|
+
}
|
|
2318
|
+
get asRoot() {
|
|
2319
|
+
return h(this, Ve, Ue.ROOT), this;
|
|
2320
|
+
}
|
|
2321
|
+
get asPower() {
|
|
2322
|
+
return h(this, Ve, Ue.POWER), this;
|
|
2323
|
+
}
|
|
2324
|
+
get numerator() {
|
|
2325
|
+
return i(this, N).filter((e) => e.power.isPositive());
|
|
2326
|
+
}
|
|
2327
|
+
get denominator() {
|
|
2328
|
+
return i(this, N).filter((e) => e.power.isNegative());
|
|
2329
|
+
}
|
|
2330
|
+
get display() {
|
|
2331
|
+
let e = [], t = [];
|
|
2332
|
+
if (i(this, Ve) === Ue.ROOT ? (e = this.numerator, t = this.denominator.map((n) => n.clone().inverse())) : e = i(this, N), e.length === 0 && (e = [new fe("1")]), t.length === 0)
|
|
2333
|
+
return e.length === 1 ? e[0].asSingle.display : e.map((n) => n.display).join("");
|
|
2334
|
+
const s = e.length === 1 ? e[0].asSingle.display : e.map((n) => n.display).join(""), r = t.length === 1 ? t[0].asSingle.display : t.map((n) => n.display).join("");
|
|
2335
|
+
return `(${s})/(${r})`;
|
|
2336
|
+
}
|
|
2337
|
+
get tex() {
|
|
2338
|
+
let e = [], t = [];
|
|
2339
|
+
if (i(this, Ve) === Ue.ROOT ? (e = this.numerator, t = this.denominator.map((n) => n.clone().inverse())) : e = i(this, N), e.length === 0 && (e = [new fe("1")]), t.length === 0)
|
|
2340
|
+
return e.length === 1 ? e[0].asSingle.tex : e.map((n) => n.tex).join("");
|
|
2341
|
+
const s = e.length === 1 ? e[0].asSingle.tex : e.map((n) => n.tex).join(""), r = t.length === 1 ? t[0].asSingle.tex : t.map((n) => n.tex).join("");
|
|
2342
|
+
return `\\frac{ ${s} }{ ${r} }`;
|
|
2343
|
+
}
|
|
2344
|
+
// #endregion Private methods (1)
|
|
2345
|
+
};
|
|
2346
|
+
N = new WeakMap(), Ve = new WeakMap(), lt = new WeakSet(), Xt = function(e, t) {
|
|
2347
|
+
const s = Gt(e), r = Gt(t), l = Object.keys(s).filter((u) => Object.hasOwn(r, u)).map((u) => {
|
|
2348
|
+
const p = s[u].reduce((g, E) => g.add(E.power), new c("0")), m = r[u].reduce((g, E) => g.add(E.power), new c("0"));
|
|
2349
|
+
return new fe(u, c.min(p, m));
|
|
2350
|
+
});
|
|
2351
|
+
return new me(...l);
|
|
2352
|
+
}, f(me, lt);
|
|
2353
|
+
let Ht = me;
|
|
2354
|
+
function Gt(o) {
|
|
2355
|
+
const e = new c().one(), t = o.factors.reduce((s, r) => {
|
|
2356
|
+
if (r.polynom.degree().isZero())
|
|
2357
|
+
return r.polynom.monoms.length > 0 && e.multiply(r.polynom.monoms[0].coefficient), s;
|
|
2358
|
+
const n = r.polynom.display;
|
|
2359
|
+
return Object.hasOwn(s, n) ? s[n].push(r) : s[n] = [r], s;
|
|
2360
|
+
}, {});
|
|
2361
|
+
return e.isOne() || (t[e.display] = [new fe(e.display, 1)]), t;
|
|
2362
|
+
}
|
|
2360
2363
|
var k, Ie, Bt, Rt;
|
|
2361
2364
|
const Ge = class Ge {
|
|
2362
2365
|
constructor(...e) {
|
|
@@ -2529,13 +2532,13 @@ const Ge = class Ge {
|
|
|
2529
2532
|
}
|
|
2530
2533
|
};
|
|
2531
2534
|
k = new WeakMap(), Ie = new WeakMap(), Bt = new WeakMap(), Rt = new WeakMap();
|
|
2532
|
-
let
|
|
2533
|
-
function
|
|
2535
|
+
let Yt = Ge;
|
|
2536
|
+
function Vi(o, e) {
|
|
2534
2537
|
return o.dimension === e.dimension && o.array.every(
|
|
2535
2538
|
(t, s) => e.array[s].isEqual(t)
|
|
2536
2539
|
);
|
|
2537
2540
|
}
|
|
2538
|
-
function
|
|
2541
|
+
function Fi(o, e) {
|
|
2539
2542
|
if (o.dimension !== e.dimension)
|
|
2540
2543
|
return !1;
|
|
2541
2544
|
const t = e.array[0].value / o.array[0].value;
|
|
@@ -2543,13 +2546,13 @@ function ji(o, e) {
|
|
|
2543
2546
|
(s, r) => e.array[r].value === s.value * t
|
|
2544
2547
|
);
|
|
2545
2548
|
}
|
|
2546
|
-
function
|
|
2549
|
+
function ji(o, e) {
|
|
2547
2550
|
return o.dimension !== e.dimension ? new c().invalid() : o.array.reduce(
|
|
2548
2551
|
(t, s, r) => t.add(s.clone().multiply(e.array[r])),
|
|
2549
2552
|
new c(0)
|
|
2550
2553
|
);
|
|
2551
2554
|
}
|
|
2552
|
-
function
|
|
2555
|
+
function Ui(...o) {
|
|
2553
2556
|
return o.some((e) => e.dimension !== o[0].dimension) ? new c().invalid() : o[0].dimension === 2 && o.length !== 2 ? new c().invalid() : o[0].dimension === 3 && o.length !== 3 ? new c().invalid() : o[0].dimension === 2 ? o[0].array[0].clone().multiply(o[1].array[1]).subtract(o[0].array[1].clone().multiply(o[1].array[0])) : o[0].array[0].clone().multiply(
|
|
2554
2557
|
o[1].array[1].clone().multiply(o[2].array[2]).subtract(o[1].array[2].clone().multiply(o[2].array[1]))
|
|
2555
2558
|
).subtract(
|
|
@@ -2558,7 +2561,7 @@ function Gi(...o) {
|
|
|
2558
2561
|
)
|
|
2559
2562
|
).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]))));
|
|
2560
2563
|
}
|
|
2561
|
-
var V, ze
|
|
2564
|
+
var V, ze;
|
|
2562
2565
|
const Se = class Se {
|
|
2563
2566
|
constructor(...e) {
|
|
2564
2567
|
f(this, V, []);
|
|
@@ -2572,15 +2575,15 @@ const Se = class Se {
|
|
|
2572
2575
|
const e = this.norm;
|
|
2573
2576
|
return e === 0 ? this : this.divideByScalar(e);
|
|
2574
2577
|
});
|
|
2575
|
-
a(this, "dot", (e) =>
|
|
2578
|
+
a(this, "dot", (e) => ji(this, e));
|
|
2576
2579
|
a(this, "normal", () => {
|
|
2577
2580
|
if (this.dimension >= 3)
|
|
2578
2581
|
throw new Error("Normal vector can only be determined in 2D");
|
|
2579
2582
|
const e = this.x.clone().opposite(), t = this.y.clone();
|
|
2580
2583
|
return i(this, V)[0] = t, i(this, V)[1] = e, this;
|
|
2581
2584
|
});
|
|
2582
|
-
a(this, "isEqual", (e) =>
|
|
2583
|
-
a(this, "isColinearTo", (e) =>
|
|
2585
|
+
a(this, "isEqual", (e) => Vi(this, e));
|
|
2586
|
+
a(this, "isColinearTo", (e) => Fi(this, e));
|
|
2584
2587
|
a(this, "isNormalTo", (e) => this.dot(e).isZero());
|
|
2585
2588
|
a(this, "multiplyByScalar", (e) => {
|
|
2586
2589
|
const t = new c(e);
|
|
@@ -2598,7 +2601,7 @@ const Se = class Se {
|
|
|
2598
2601
|
let r = this.dot(e).value;
|
|
2599
2602
|
return t && (r = Math.abs(r)), (s ? 1 : 180 / Math.PI) * Math.acos(r / (this.norm * e.norm));
|
|
2600
2603
|
});
|
|
2601
|
-
|
|
2604
|
+
a(this, "fromString", (e) => {
|
|
2602
2605
|
e.startsWith("(") && (e = e.substring(1)), e.endsWith(")") && (e = e.substring(0, e.length - 1));
|
|
2603
2606
|
const t = e.split(/[,;\s]/g).filter((s) => s.trim() !== "");
|
|
2604
2607
|
return t.length < 2 ? this : (h(this, V, t.map((s) => new c(s))), this);
|
|
@@ -2689,7 +2692,7 @@ const Se = class Se {
|
|
|
2689
2692
|
if (e[0] instanceof Se)
|
|
2690
2693
|
return e[0].clone();
|
|
2691
2694
|
if (typeof e[0] == "string")
|
|
2692
|
-
return
|
|
2695
|
+
return this.fromString(e[0]);
|
|
2693
2696
|
throw new Error("Invalid value");
|
|
2694
2697
|
}
|
|
2695
2698
|
if (e.length === 2) {
|
|
@@ -2743,9 +2746,9 @@ const Se = class Se {
|
|
|
2743
2746
|
};
|
|
2744
2747
|
}
|
|
2745
2748
|
};
|
|
2746
|
-
V = new WeakMap(), ze = new WeakMap()
|
|
2749
|
+
V = new WeakMap(), ze = new WeakMap();
|
|
2747
2750
|
let x = Se;
|
|
2748
|
-
function
|
|
2751
|
+
function mi(o = 0.5) {
|
|
2749
2752
|
return Math.random() < o;
|
|
2750
2753
|
}
|
|
2751
2754
|
function de(o, e, t) {
|
|
@@ -2763,19 +2766,19 @@ function de(o, e, t) {
|
|
|
2763
2766
|
return s;
|
|
2764
2767
|
}
|
|
2765
2768
|
function X(o, e) {
|
|
2766
|
-
return e === !1 ?
|
|
2769
|
+
return e === !1 ? mi() ? de(1, o) : -de(1, o) : de(-o, o);
|
|
2767
2770
|
}
|
|
2768
|
-
function
|
|
2771
|
+
function Gi(o) {
|
|
2769
2772
|
let e = G.primes();
|
|
2770
|
-
return o !== void 0 && (e = e.filter((t) => t < o)),
|
|
2773
|
+
return o !== void 0 && (e = e.filter((t) => t < o)), ei(e);
|
|
2771
2774
|
}
|
|
2772
|
-
function
|
|
2773
|
-
return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) :
|
|
2775
|
+
function Wi(o, e) {
|
|
2776
|
+
return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) : gi(o).slice(0, e);
|
|
2774
2777
|
}
|
|
2775
|
-
function
|
|
2778
|
+
function ei(o) {
|
|
2776
2779
|
return o.length === 0 ? null : o[de(0, o.length - 1)];
|
|
2777
2780
|
}
|
|
2778
|
-
function
|
|
2781
|
+
function gi(o) {
|
|
2779
2782
|
const e = Object.values(o);
|
|
2780
2783
|
for (let t = e.length - 1; t > 0; t--) {
|
|
2781
2784
|
const s = Math.floor(Math.random() * (t + 1)), r = e[t];
|
|
@@ -2788,15 +2791,11 @@ class D extends x {
|
|
|
2788
2791
|
super(), e.length > 0 && this.parse(...e);
|
|
2789
2792
|
}
|
|
2790
2793
|
parse(...e) {
|
|
2791
|
-
if (this.asPoint = !0, e.length ===
|
|
2794
|
+
if (this.asPoint = !0, e.length === 1) {
|
|
2792
2795
|
if (e[0] instanceof x)
|
|
2793
2796
|
return this.array = e[0].copy(), this;
|
|
2794
|
-
if (typeof e[0] == "string")
|
|
2795
|
-
|
|
2796
|
-
if (t.some((s) => s.isNaN()))
|
|
2797
|
-
throw new Error("The value is not a valid point sting (a,b): " + e[0]);
|
|
2798
|
-
this.array = t;
|
|
2799
|
-
}
|
|
2797
|
+
if (typeof e[0] == "string")
|
|
2798
|
+
return this.fromString(e[0]), this;
|
|
2800
2799
|
}
|
|
2801
2800
|
if (e.length > 1) {
|
|
2802
2801
|
if (e.some((s) => s instanceof x))
|
|
@@ -2813,7 +2812,7 @@ class D extends x {
|
|
|
2813
2812
|
return e.array = this.copy(), e.asPoint = !0, e;
|
|
2814
2813
|
}
|
|
2815
2814
|
}
|
|
2816
|
-
var
|
|
2815
|
+
var yi = /* @__PURE__ */ ((o) => (o.None = "none", o.Parallel = "parallel", o.Perpendicular = "perpendicular", o.Tangent = "tangent", o))(yi || {}), Ce, B, R, U, ne, Y, $e, ve;
|
|
2817
2816
|
const Le = class Le {
|
|
2818
2817
|
/**
|
|
2819
2818
|
* Value can be a mix of:
|
|
@@ -3119,8 +3118,8 @@ const Le = class Le {
|
|
|
3119
3118
|
Ce = new WeakMap(), B = new WeakMap(), R = new WeakMap(), U = new WeakMap(), ne = new WeakMap(), Y = new WeakMap(), $e = new WeakMap(), ve = new WeakMap(), // A line is defined as the canonical form
|
|
3120
3119
|
a(Le, "PERPENDICULAR", "perpendicular"), a(Le, "PARALLEL", "parallel");
|
|
3121
3120
|
let j = Le;
|
|
3122
|
-
var oe, F, qe, kt, Lt,
|
|
3123
|
-
const
|
|
3121
|
+
var oe, F, qe, zt, kt, Lt, he, wi, mt, vi, bi, xi, Qt;
|
|
3122
|
+
const Dt = class Dt {
|
|
3124
3123
|
constructor(...e) {
|
|
3125
3124
|
f(this, he);
|
|
3126
3125
|
f(this, oe);
|
|
@@ -3144,7 +3143,7 @@ const Zt = class Zt {
|
|
|
3144
3143
|
const s = i(this, qe).clone(), r = e.getEquation().clone().isolate("x"), n = e.getEquation().clone().isolate("y");
|
|
3145
3144
|
return r instanceof H && n instanceof H && (s.replaceBy("y", n.right).simplify(), s.solve()), t;
|
|
3146
3145
|
});
|
|
3147
|
-
a(this, "tangents", (e) => e instanceof c ? i(this,
|
|
3146
|
+
a(this, "tangents", (e) => e instanceof c ? i(this, Lt).call(this, e) : this.isPointOnCircle(e) ? i(this, zt).call(this, e) : i(this, oe) !== void 0 && i(this, oe).distanceTo(e).value > this.radius.value ? (i(this, kt).call(this, e), []) : (console.log("No tangents as the point is inside !"), []));
|
|
3148
3147
|
a(this, "isPointOnCircle", (e) => {
|
|
3149
3148
|
var t;
|
|
3150
3149
|
return ((t = i(this, qe)) == null ? void 0 : t.test({ x: e.x, y: e.y })) ?? !1;
|
|
@@ -3161,15 +3160,15 @@ const Zt = class Zt {
|
|
|
3161
3160
|
);
|
|
3162
3161
|
}), s;
|
|
3163
3162
|
});
|
|
3164
|
-
f(this,
|
|
3163
|
+
f(this, zt, (e) => {
|
|
3165
3164
|
const t = new D(this.center, e);
|
|
3166
|
-
return [new j(e, t,
|
|
3165
|
+
return [new j(e, t, yi.Perpendicular)];
|
|
3167
3166
|
});
|
|
3168
|
-
f(this,
|
|
3167
|
+
f(this, kt, (e) => {
|
|
3169
3168
|
const t = this.center.x.clone().subtract(e.x), s = this.center.y.clone().subtract(e.y), r = new T("x"), n = new T("x^2+1");
|
|
3170
3169
|
r.multiply(t).subtract(s).pow(2), n.multiply(this.squareRadius), new H(r, n).moveLeft().simplify().solve();
|
|
3171
3170
|
});
|
|
3172
|
-
f(this,
|
|
3171
|
+
f(this, Lt, (e) => {
|
|
3173
3172
|
const t = e.numerator, s = -e.denominator, r = this.center.x.clone(), n = this.center.y.clone(), l = this.squareRadius.clone().multiply(e.numerator ** 2 + e.denominator ** 2), u = r.clone().multiply(t).opposite().subtract(n.clone().multiply(s)).add(l.clone().sqrt()), p = r.clone().multiply(t).opposite().subtract(n.clone().multiply(s)).subtract(l.clone().sqrt());
|
|
3174
3173
|
return [new j(t, s, u), new j(t, s, p)];
|
|
3175
3174
|
});
|
|
@@ -3209,7 +3208,7 @@ const Zt = class Zt {
|
|
|
3209
3208
|
return this.center.x.isZero() ? e = "x^2" : e = `(x${this.center.x.isNegative() ? "+" : "-"}${this.center.x.clone().abs().tex})^2`, this.center.y.isZero() ? t = "y^2" : t = `(y${this.center.y.isNegative() ? "+" : "-"}${this.center.y.clone().abs().tex})^2`, `${e}+${t}=${this.squareRadius.display}`;
|
|
3210
3209
|
}
|
|
3211
3210
|
clone() {
|
|
3212
|
-
return new
|
|
3211
|
+
return new Dt(
|
|
3213
3212
|
this.center.clone(),
|
|
3214
3213
|
this.squareRadius.clone(),
|
|
3215
3214
|
!0
|
|
@@ -3219,7 +3218,7 @@ const Zt = class Zt {
|
|
|
3219
3218
|
return t ? h(this, F, new c(e)) : h(this, F, new c(e).pow(2)), M(this, he, mt).call(this), this;
|
|
3220
3219
|
}
|
|
3221
3220
|
parse(...e) {
|
|
3222
|
-
return M(this, he,
|
|
3221
|
+
return M(this, he, wi).call(this), typeof e[0] == "string" ? M(this, he, Qt).call(this, new H(e[0])) : e[0] instanceof H ? M(this, he, Qt).call(this, e[0]) : e[0] instanceof Dt ? M(this, he, vi).call(this, e[0]) : e[0] instanceof D && e.length > 1 && (e[1] instanceof D ? e[2] instanceof D || M(this, he, xi).call(this, e[0], e[1]) : (e[1] instanceof c || typeof e[1] == "number") && M(this, he, bi).call(this, e[0], e[1], typeof e[2] == "boolean" ? e[2] : !1)), M(this, he, mt).call(this), this;
|
|
3223
3222
|
}
|
|
3224
3223
|
// private _parseThroughtThreePoints(A: Point, B: Point, C: Point): this {
|
|
3225
3224
|
// const T = new Triangle(A, B, C), mAB = T.remarquables.mediators.AB.clone(),
|
|
@@ -3228,20 +3227,20 @@ const Zt = class Zt {
|
|
|
3228
3227
|
// return this
|
|
3229
3228
|
// }
|
|
3230
3229
|
};
|
|
3231
|
-
oe = new WeakMap(), F = new WeakMap(), qe = new WeakMap(),
|
|
3230
|
+
oe = new WeakMap(), F = new WeakMap(), qe = new WeakMap(), zt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), he = new WeakSet(), wi = function() {
|
|
3232
3231
|
return h(this, oe, void 0), h(this, F, void 0), h(this, qe, void 0), this;
|
|
3233
3232
|
}, mt = function() {
|
|
3234
3233
|
h(this, qe, new H(
|
|
3235
3234
|
new T(`(x-(${this.center.x.display}))^2+(y-(${this.center.y.display}))^2`),
|
|
3236
3235
|
new T(this.squareRadius.display)
|
|
3237
3236
|
).moveLeft());
|
|
3238
|
-
},
|
|
3237
|
+
}, vi = function(e) {
|
|
3239
3238
|
return h(this, oe, e.center.clone()), h(this, F, e.squareRadius.clone()), M(this, he, mt).call(this), this;
|
|
3240
|
-
},
|
|
3239
|
+
}, bi = function(e, t, s) {
|
|
3241
3240
|
return h(this, oe, e.clone()), s ? h(this, F, new c(t)) : h(this, F, new c(t).pow(2)), this;
|
|
3242
|
-
},
|
|
3241
|
+
}, xi = function(e, t) {
|
|
3243
3242
|
return h(this, oe, e.clone()), h(this, F, new x(i(this, oe), t).normSquare), this;
|
|
3244
|
-
},
|
|
3243
|
+
}, Qt = function(e) {
|
|
3245
3244
|
if (e.moveLeft(), e.degree("x").value === 2 && e.degree("y").value === 2) {
|
|
3246
3245
|
const t = e.left.monomByDegree(2, "x"), s = e.left.monomByDegree(2, "y");
|
|
3247
3246
|
let r, n, l;
|
|
@@ -3249,9 +3248,9 @@ oe = new WeakMap(), F = new WeakMap(), qe = new WeakMap(), kt = new WeakMap(), L
|
|
|
3249
3248
|
}
|
|
3250
3249
|
return this;
|
|
3251
3250
|
};
|
|
3252
|
-
let yt =
|
|
3253
|
-
var Q, _, ee, Je, Te, ct,
|
|
3254
|
-
const
|
|
3251
|
+
let yt = Dt;
|
|
3252
|
+
var Q, _, ee, Je, Te, ct, Zt, ut, Pe, Vt, _e;
|
|
3253
|
+
const Ft = class Ft {
|
|
3255
3254
|
constructor(...e) {
|
|
3256
3255
|
f(this, Q);
|
|
3257
3256
|
f(this, _);
|
|
@@ -3303,14 +3302,14 @@ const jt = class jt {
|
|
|
3303
3302
|
BC: new j(i(this, _), i(this, ee)),
|
|
3304
3303
|
AC: new j(i(this, Q), i(this, ee))
|
|
3305
3304
|
}));
|
|
3306
|
-
} else if (e.length === 1 && e[0] instanceof
|
|
3305
|
+
} else if (e.length === 1 && e[0] instanceof Ft)
|
|
3307
3306
|
return e[0].clone();
|
|
3308
|
-
return i(this,
|
|
3307
|
+
return i(this, Zt).call(this), this;
|
|
3309
3308
|
});
|
|
3310
3309
|
/**
|
|
3311
3310
|
* Clone the Triangle class
|
|
3312
3311
|
*/
|
|
3313
|
-
a(this, "clone", () => new
|
|
3312
|
+
a(this, "clone", () => new Ft(
|
|
3314
3313
|
i(this, Q).clone(),
|
|
3315
3314
|
i(this, _).clone(),
|
|
3316
3315
|
i(this, ee).clone()
|
|
@@ -3321,12 +3320,12 @@ const jt = class jt {
|
|
|
3321
3320
|
/**
|
|
3322
3321
|
* Generate the Line object for the three segments of the triangle
|
|
3323
3322
|
*/
|
|
3324
|
-
f(this,
|
|
3323
|
+
f(this, Zt, () => {
|
|
3325
3324
|
h(this, Te, {
|
|
3326
3325
|
AB: new D().middleOf(i(this, Q), i(this, _)),
|
|
3327
3326
|
AC: new D().middleOf(i(this, Q), i(this, ee)),
|
|
3328
3327
|
BC: new D().middleOf(i(this, _), i(this, ee))
|
|
3329
|
-
}), h(this, ct, i(this,
|
|
3328
|
+
}), h(this, ct, i(this, Vt).call(this));
|
|
3330
3329
|
});
|
|
3331
3330
|
/**
|
|
3332
3331
|
* Get the Vector2D class for the given name
|
|
@@ -3352,7 +3351,7 @@ const jt = class jt {
|
|
|
3352
3351
|
i(this, ut).call(this, e),
|
|
3353
3352
|
i(this, ut).call(this, t)
|
|
3354
3353
|
));
|
|
3355
|
-
f(this,
|
|
3354
|
+
f(this, Vt, () => {
|
|
3356
3355
|
const e = {
|
|
3357
3356
|
A: new j(i(this, Q), i(this, Te).BC),
|
|
3358
3357
|
B: new j(i(this, _), i(this, Te).AC),
|
|
@@ -3443,8 +3442,8 @@ const jt = class jt {
|
|
|
3443
3442
|
return i(this, ct);
|
|
3444
3443
|
}
|
|
3445
3444
|
};
|
|
3446
|
-
Q = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), Je = new WeakMap(), Te = new WeakMap(), ct = new WeakMap(),
|
|
3447
|
-
let
|
|
3445
|
+
Q = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), Je = new WeakMap(), Te = new WeakMap(), ct = new WeakMap(), Zt = new WeakMap(), ut = new WeakMap(), Pe = new WeakMap(), Vt = new WeakMap(), _e = new WeakMap();
|
|
3446
|
+
let Kt = Ft;
|
|
3448
3447
|
var z, W;
|
|
3449
3448
|
const nt = class nt {
|
|
3450
3449
|
constructor(e, t) {
|
|
@@ -3556,7 +3555,7 @@ z = new WeakMap(), W = new WeakMap(), // A line is defined as the canonical form
|
|
|
3556
3555
|
a(nt, "PERPENDICULAR", "perpendicular"), a(nt, "PARALLEL", "parallel");
|
|
3557
3556
|
let wt = nt;
|
|
3558
3557
|
var Ae, Fe;
|
|
3559
|
-
const
|
|
3558
|
+
const ii = class ii {
|
|
3560
3559
|
constructor(e) {
|
|
3561
3560
|
f(this, Ae, new x(0, 0, 1));
|
|
3562
3561
|
f(this, Fe, new D(0, 0, 0));
|
|
@@ -3621,7 +3620,7 @@ const si = class si {
|
|
|
3621
3620
|
}
|
|
3622
3621
|
}
|
|
3623
3622
|
angle(e, t, s) {
|
|
3624
|
-
if (e instanceof
|
|
3623
|
+
if (e instanceof ii)
|
|
3625
3624
|
return this.normal.angle(e.normal, t, s);
|
|
3626
3625
|
let r;
|
|
3627
3626
|
if (e instanceof x) {
|
|
@@ -3647,9 +3646,9 @@ const si = class si {
|
|
|
3647
3646
|
}
|
|
3648
3647
|
};
|
|
3649
3648
|
Ae = new WeakMap(), Fe = new WeakMap();
|
|
3650
|
-
let
|
|
3649
|
+
let Jt = ii;
|
|
3651
3650
|
var Me;
|
|
3652
|
-
class
|
|
3651
|
+
class Hi {
|
|
3653
3652
|
constructor(...e) {
|
|
3654
3653
|
f(this, Me, []);
|
|
3655
3654
|
return h(this, Me, e), this;
|
|
@@ -3669,7 +3668,7 @@ class Xi {
|
|
|
3669
3668
|
determinant() {
|
|
3670
3669
|
if (!this.isSquare())
|
|
3671
3670
|
throw new Error("Matrix is not square");
|
|
3672
|
-
return
|
|
3671
|
+
return Ui(...this.values);
|
|
3673
3672
|
}
|
|
3674
3673
|
}
|
|
3675
3674
|
Me = new WeakMap();
|
|
@@ -3693,7 +3692,7 @@ function vt(o) {
|
|
|
3693
3692
|
}
|
|
3694
3693
|
return e.reduced ? t.reduce() : t;
|
|
3695
3694
|
}
|
|
3696
|
-
function
|
|
3695
|
+
function Ei(o) {
|
|
3697
3696
|
const e = Object.assign(
|
|
3698
3697
|
{
|
|
3699
3698
|
letters: "x",
|
|
@@ -3711,14 +3710,14 @@ function Ni(o) {
|
|
|
3711
3710
|
for (const s of e.letters.split(""))
|
|
3712
3711
|
t.setLetter(s, 0);
|
|
3713
3712
|
for (let s = 0; s < e.degree; s++) {
|
|
3714
|
-
const r =
|
|
3713
|
+
const r = ei(e.letters.split(""));
|
|
3715
3714
|
t.setLetter(r, t.degree(r).clone().add(1));
|
|
3716
3715
|
}
|
|
3717
3716
|
} else
|
|
3718
3717
|
t.setLetter(e.letters, e.degree);
|
|
3719
3718
|
return t;
|
|
3720
3719
|
}
|
|
3721
|
-
const
|
|
3720
|
+
const Xi = {
|
|
3722
3721
|
letters: "x",
|
|
3723
3722
|
degree: 2,
|
|
3724
3723
|
fraction: !1,
|
|
@@ -3729,14 +3728,14 @@ const Yi = {
|
|
|
3729
3728
|
numberOfMonoms: 0,
|
|
3730
3729
|
positive: !0
|
|
3731
3730
|
};
|
|
3732
|
-
function
|
|
3731
|
+
function Ni(o) {
|
|
3733
3732
|
const e = Object.assign(
|
|
3734
|
-
|
|
3733
|
+
Xi,
|
|
3735
3734
|
o
|
|
3736
3735
|
), t = new T().empty();
|
|
3737
3736
|
let s;
|
|
3738
3737
|
for (let r = e.degree; r >= 0; r--)
|
|
3739
|
-
s =
|
|
3738
|
+
s = Ei({
|
|
3740
3739
|
letters: e.letters,
|
|
3741
3740
|
degree: r,
|
|
3742
3741
|
fraction: e.fraction,
|
|
@@ -3749,7 +3748,7 @@ function Oi(o) {
|
|
|
3749
3748
|
}
|
|
3750
3749
|
return t;
|
|
3751
3750
|
}
|
|
3752
|
-
function
|
|
3751
|
+
function Yi(o) {
|
|
3753
3752
|
const e = Object.assign(
|
|
3754
3753
|
{
|
|
3755
3754
|
letters: "x",
|
|
@@ -3771,7 +3770,7 @@ function Qi(o) {
|
|
|
3771
3770
|
o
|
|
3772
3771
|
), t = new T().one();
|
|
3773
3772
|
for (let s = 0; s < e.degree; s++) {
|
|
3774
|
-
const r =
|
|
3773
|
+
const r = Ni({
|
|
3775
3774
|
degree: 1,
|
|
3776
3775
|
unit: e.unit,
|
|
3777
3776
|
fraction: e.fraction,
|
|
@@ -3782,7 +3781,7 @@ function Qi(o) {
|
|
|
3782
3781
|
}
|
|
3783
3782
|
return new H(t, 0);
|
|
3784
3783
|
}
|
|
3785
|
-
function
|
|
3784
|
+
function Oi(o) {
|
|
3786
3785
|
const e = Object.assign(
|
|
3787
3786
|
{
|
|
3788
3787
|
axis: !0,
|
|
@@ -3794,7 +3793,7 @@ function qi(o) {
|
|
|
3794
3793
|
), t = e.axis === "x", s = e.axis === "y", r = e.fraction ? vt({ max: e.max, zero: t }) : new c(X(e.max, t)), n = e.fraction ? vt({ max: e.max, zero: s }) : new c(X(e.max, s));
|
|
3795
3794
|
return Number(e.quadrant) === 1 && (r.abs(), n.abs()), Number(e.quadrant) === 2 && (r.isPositive() && r.opposite(), n.isNegative() && n.opposite()), Number(e.quadrant) === 3 && (r.isPositive() && r.opposite(), n.isPositive() && n.opposite()), Number(e.quadrant) === 4 && (r.isNegative() && r.opposite(), n.isPositive() && n.opposite()), new D(r, n);
|
|
3796
3795
|
}
|
|
3797
|
-
function
|
|
3796
|
+
function Qi(o) {
|
|
3798
3797
|
const e = Object.assign(
|
|
3799
3798
|
{
|
|
3800
3799
|
center: {
|
|
@@ -3804,11 +3803,11 @@ function Ki(o) {
|
|
|
3804
3803
|
pointsOnCircle: 8
|
|
3805
3804
|
},
|
|
3806
3805
|
o
|
|
3807
|
-
), t =
|
|
3806
|
+
), t = Oi(e.center);
|
|
3808
3807
|
let s, r;
|
|
3809
3808
|
return e.pointsOnCircle === 8 ? (s = de(1, 3), r = s ** 2 + (s + 1) ** 2) : r = de(1, 20), new yt(t, r, !0);
|
|
3810
3809
|
}
|
|
3811
|
-
function
|
|
3810
|
+
function Ki(o) {
|
|
3812
3811
|
const e = Object.assign(
|
|
3813
3812
|
{
|
|
3814
3813
|
A: {
|
|
@@ -3825,7 +3824,7 @@ function Ji(o) {
|
|
|
3825
3824
|
t.x = X(10), t.y = X(10);
|
|
3826
3825
|
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 j(new x(e.A.x, e.A.y), t);
|
|
3827
3826
|
}
|
|
3828
|
-
function
|
|
3827
|
+
function Ji(o) {
|
|
3829
3828
|
const e = Object.assign(
|
|
3830
3829
|
{
|
|
3831
3830
|
A: {
|
|
@@ -3843,45 +3842,45 @@ function _i(o) {
|
|
|
3843
3842
|
), t = new D(e.A.x, e.A.y, e.A.z), s = new x(e.direction.x, e.direction.y, e.direction.z);
|
|
3844
3843
|
return new wt(t, s);
|
|
3845
3844
|
}
|
|
3846
|
-
const
|
|
3847
|
-
equation: (o) =>
|
|
3848
|
-
polynom: (o) =>
|
|
3849
|
-
monom: (o) =>
|
|
3845
|
+
const _i = {
|
|
3846
|
+
equation: (o) => Yi(o),
|
|
3847
|
+
polynom: (o) => Ni(o),
|
|
3848
|
+
monom: (o) => Ei(o),
|
|
3850
3849
|
fraction: (o) => vt(o),
|
|
3851
3850
|
number: (o, e, t) => de(o, e, t),
|
|
3852
3851
|
numberSym: (o, e) => X(o, e),
|
|
3853
|
-
prime: (o) =>
|
|
3854
|
-
bool: (o) =>
|
|
3855
|
-
array: (o, e) =>
|
|
3856
|
-
item: (o) =>
|
|
3857
|
-
shuffle: (o) =>
|
|
3858
|
-
line: (o) =>
|
|
3859
|
-
line3: (o) =>
|
|
3860
|
-
point: (o) =>
|
|
3861
|
-
circle: (o) =>
|
|
3862
|
-
},
|
|
3852
|
+
prime: (o) => Gi(o),
|
|
3853
|
+
bool: (o) => mi(o),
|
|
3854
|
+
array: (o, e) => Wi(o, e),
|
|
3855
|
+
item: (o) => ei(o),
|
|
3856
|
+
shuffle: (o) => gi(o),
|
|
3857
|
+
line: (o) => Ki(o),
|
|
3858
|
+
line3: (o) => Ji(o),
|
|
3859
|
+
point: (o) => Oi(o),
|
|
3860
|
+
circle: (o) => Qi(o)
|
|
3861
|
+
}, es = {
|
|
3863
3862
|
Vector: x,
|
|
3864
3863
|
Point: D,
|
|
3865
3864
|
Line: j,
|
|
3866
|
-
Triangle:
|
|
3865
|
+
Triangle: Kt,
|
|
3867
3866
|
Circle: yt,
|
|
3868
3867
|
Line3: wt,
|
|
3869
|
-
Plane3:
|
|
3870
|
-
},
|
|
3868
|
+
Plane3: Jt
|
|
3869
|
+
}, is = {
|
|
3871
3870
|
Numeric: G,
|
|
3872
3871
|
Fraction: c,
|
|
3873
3872
|
Root: ft,
|
|
3874
3873
|
Monom: I,
|
|
3875
3874
|
Polynom: T,
|
|
3876
3875
|
Equation: H,
|
|
3877
|
-
Matrix:
|
|
3878
|
-
LinearSystem:
|
|
3876
|
+
Matrix: Hi,
|
|
3877
|
+
LinearSystem: Yt,
|
|
3879
3878
|
Factor: fe,
|
|
3880
|
-
PolyFactor:
|
|
3879
|
+
PolyFactor: Ht,
|
|
3881
3880
|
// LogicalSet,
|
|
3882
|
-
Random:
|
|
3883
|
-
Geometry:
|
|
3881
|
+
Random: _i,
|
|
3882
|
+
Geometry: es
|
|
3884
3883
|
};
|
|
3885
3884
|
export {
|
|
3886
|
-
|
|
3885
|
+
is as default
|
|
3887
3886
|
};
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export declare class PolyFactor implements IPiMathObject<PolyFactor>, IExpressio
|
|
|
7
7
|
#private;
|
|
8
8
|
constructor(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]);
|
|
9
9
|
parse(...values: (Factor | InputAlgebra<Polynom> | PolyFactor)[]): this;
|
|
10
|
+
fromPolynom(polynom: InputAlgebra<Polynom>, letter?: string): this;
|
|
10
11
|
clone(): PolyFactor;
|
|
11
12
|
add(...values: PolyFactor[]): this;
|
|
12
13
|
degree(letter?: string): Fraction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyFactor.d.ts","sourceRoot":"","sources":["../../src/algebra/polyFactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,qBAAa,KAAM,SAAQ,MAAM;;gBAGjB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;gBAC1B,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;IAU7B,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/geometry/point.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,qBAAa,KAAM,SAAQ,MAAM;;gBAGjB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;gBAC1B,GAAG,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;IAU7B,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;IAkCzD,KAAK,IAAI,KAAK;CAOjC"}
|
|
@@ -47,6 +47,7 @@ export declare class Vector implements IPiMathObject<Vector> {
|
|
|
47
47
|
divideByScalar: (k: InputValue<Fraction>) => this;
|
|
48
48
|
simplify: () => this;
|
|
49
49
|
angle: (V: Vector, sharp?: boolean, radian?: boolean) => number;
|
|
50
|
+
fromString: (value: string) => this;
|
|
50
51
|
distanceTo(item: Vector): {
|
|
51
52
|
value: number;
|
|
52
53
|
fraction: Fraction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/geometry/vector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAInD,qBAAa,MAAO,YAChB,aAAa,CAAC,MAAM,CAAC;;gBAIT,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE;IASxD,IAAI,KAAK,IAAI,QAAQ,EAAE,CAEtB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,EAE1B;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAEhB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAEtC;IAED,IAAI,CAAC,IAAI,QAAQ,CAGhB;IAED,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAGtC;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAGD,IAAI,UAAU,IAAI,QAAQ,CAGzB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,GAAG,IAAI,MAAM,CAMhB;IAED,IAAI,OAAO,IAAI,MAAM,CAMpB;IAED,YAAY,CAAC,KAAK,SAAI,GAAG,IAAI;IAe7B,IAAI,SAAS,IAAI,MAAM,CAEtB;IAKD,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,MAAM,CAAC,K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