pimath 0.1.4 → 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 +168 -172
- package/package.json +1 -1
- package/types/geometry/point.d.ts.map +1 -1
- package/types/geometry/vector.d.ts +1 -0
- package/types/geometry/vector.d.ts.map +1 -1
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;
|
|
@@ -2173,7 +2173,7 @@ const xe = class xe {
|
|
|
2173
2173
|
};
|
|
2174
2174
|
q = new WeakMap(), A = new WeakMap(), re = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), St = new WeakMap();
|
|
2175
2175
|
let H = xe;
|
|
2176
|
-
var N, Ve, lt,
|
|
2176
|
+
var N, Ve, lt, Xt;
|
|
2177
2177
|
const me = class me {
|
|
2178
2178
|
// #endregion Class fields (1)
|
|
2179
2179
|
// #region Constructors (1)
|
|
@@ -2269,7 +2269,7 @@ const me = class me {
|
|
|
2269
2269
|
throw new Error("Method not implemented.");
|
|
2270
2270
|
}
|
|
2271
2271
|
reduce() {
|
|
2272
|
-
const e =
|
|
2272
|
+
const e = Gt(this);
|
|
2273
2273
|
return h(this, N, Object.values(e).map((t) => {
|
|
2274
2274
|
const s = t[0].polynom, r = t.reduce((n, l) => n.add(l.power), new c("0"));
|
|
2275
2275
|
return new fe(s, r.reduce());
|
|
@@ -2297,11 +2297,11 @@ const me = class me {
|
|
|
2297
2297
|
if (e.length === 1)
|
|
2298
2298
|
return e[0];
|
|
2299
2299
|
if (e.length === 2)
|
|
2300
|
-
return M(s = me, lt,
|
|
2300
|
+
return M(s = me, lt, Xt).call(s, e[0], e[1]);
|
|
2301
2301
|
let t = e[0];
|
|
2302
2302
|
return e.shift(), e.forEach((r) => {
|
|
2303
2303
|
var n;
|
|
2304
|
-
return t = M(n = me, lt,
|
|
2304
|
+
return t = M(n = me, lt, Xt).call(n, t, r);
|
|
2305
2305
|
}), t;
|
|
2306
2306
|
}
|
|
2307
2307
|
// #endregion Properties and methods (25)
|
|
@@ -2343,15 +2343,15 @@ const me = class me {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
// #endregion Private methods (1)
|
|
2345
2345
|
};
|
|
2346
|
-
N = new WeakMap(), Ve = new WeakMap(), lt = new WeakSet(),
|
|
2347
|
-
const s =
|
|
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
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
2349
|
return new fe(u, c.min(p, m));
|
|
2350
2350
|
});
|
|
2351
2351
|
return new me(...l);
|
|
2352
2352
|
}, f(me, lt);
|
|
2353
|
-
let
|
|
2354
|
-
function
|
|
2353
|
+
let Ht = me;
|
|
2354
|
+
function Gt(o) {
|
|
2355
2355
|
const e = new c().one(), t = o.factors.reduce((s, r) => {
|
|
2356
2356
|
if (r.polynom.degree().isZero())
|
|
2357
2357
|
return r.polynom.monoms.length > 0 && e.multiply(r.polynom.monoms[0].coefficient), s;
|
|
@@ -2532,13 +2532,13 @@ const Ge = class Ge {
|
|
|
2532
2532
|
}
|
|
2533
2533
|
};
|
|
2534
2534
|
k = new WeakMap(), Ie = new WeakMap(), Bt = new WeakMap(), Rt = new WeakMap();
|
|
2535
|
-
let
|
|
2536
|
-
function
|
|
2535
|
+
let Yt = Ge;
|
|
2536
|
+
function Vi(o, e) {
|
|
2537
2537
|
return o.dimension === e.dimension && o.array.every(
|
|
2538
2538
|
(t, s) => e.array[s].isEqual(t)
|
|
2539
2539
|
);
|
|
2540
2540
|
}
|
|
2541
|
-
function
|
|
2541
|
+
function Fi(o, e) {
|
|
2542
2542
|
if (o.dimension !== e.dimension)
|
|
2543
2543
|
return !1;
|
|
2544
2544
|
const t = e.array[0].value / o.array[0].value;
|
|
@@ -2546,13 +2546,13 @@ function ji(o, e) {
|
|
|
2546
2546
|
(s, r) => e.array[r].value === s.value * t
|
|
2547
2547
|
);
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function ji(o, e) {
|
|
2550
2550
|
return o.dimension !== e.dimension ? new c().invalid() : o.array.reduce(
|
|
2551
2551
|
(t, s, r) => t.add(s.clone().multiply(e.array[r])),
|
|
2552
2552
|
new c(0)
|
|
2553
2553
|
);
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2555
|
+
function Ui(...o) {
|
|
2556
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(
|
|
2557
2557
|
o[1].array[1].clone().multiply(o[2].array[2]).subtract(o[1].array[2].clone().multiply(o[2].array[1]))
|
|
2558
2558
|
).subtract(
|
|
@@ -2561,7 +2561,7 @@ function Gi(...o) {
|
|
|
2561
2561
|
)
|
|
2562
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]))));
|
|
2563
2563
|
}
|
|
2564
|
-
var V, ze
|
|
2564
|
+
var V, ze;
|
|
2565
2565
|
const Se = class Se {
|
|
2566
2566
|
constructor(...e) {
|
|
2567
2567
|
f(this, V, []);
|
|
@@ -2575,15 +2575,15 @@ const Se = class Se {
|
|
|
2575
2575
|
const e = this.norm;
|
|
2576
2576
|
return e === 0 ? this : this.divideByScalar(e);
|
|
2577
2577
|
});
|
|
2578
|
-
a(this, "dot", (e) =>
|
|
2578
|
+
a(this, "dot", (e) => ji(this, e));
|
|
2579
2579
|
a(this, "normal", () => {
|
|
2580
2580
|
if (this.dimension >= 3)
|
|
2581
2581
|
throw new Error("Normal vector can only be determined in 2D");
|
|
2582
2582
|
const e = this.x.clone().opposite(), t = this.y.clone();
|
|
2583
2583
|
return i(this, V)[0] = t, i(this, V)[1] = e, this;
|
|
2584
2584
|
});
|
|
2585
|
-
a(this, "isEqual", (e) =>
|
|
2586
|
-
a(this, "isColinearTo", (e) =>
|
|
2585
|
+
a(this, "isEqual", (e) => Vi(this, e));
|
|
2586
|
+
a(this, "isColinearTo", (e) => Fi(this, e));
|
|
2587
2587
|
a(this, "isNormalTo", (e) => this.dot(e).isZero());
|
|
2588
2588
|
a(this, "multiplyByScalar", (e) => {
|
|
2589
2589
|
const t = new c(e);
|
|
@@ -2601,7 +2601,7 @@ const Se = class Se {
|
|
|
2601
2601
|
let r = this.dot(e).value;
|
|
2602
2602
|
return t && (r = Math.abs(r)), (s ? 1 : 180 / Math.PI) * Math.acos(r / (this.norm * e.norm));
|
|
2603
2603
|
});
|
|
2604
|
-
|
|
2604
|
+
a(this, "fromString", (e) => {
|
|
2605
2605
|
e.startsWith("(") && (e = e.substring(1)), e.endsWith(")") && (e = e.substring(0, e.length - 1));
|
|
2606
2606
|
const t = e.split(/[,;\s]/g).filter((s) => s.trim() !== "");
|
|
2607
2607
|
return t.length < 2 ? this : (h(this, V, t.map((s) => new c(s))), this);
|
|
@@ -2692,7 +2692,7 @@ const Se = class Se {
|
|
|
2692
2692
|
if (e[0] instanceof Se)
|
|
2693
2693
|
return e[0].clone();
|
|
2694
2694
|
if (typeof e[0] == "string")
|
|
2695
|
-
return
|
|
2695
|
+
return this.fromString(e[0]);
|
|
2696
2696
|
throw new Error("Invalid value");
|
|
2697
2697
|
}
|
|
2698
2698
|
if (e.length === 2) {
|
|
@@ -2746,9 +2746,9 @@ const Se = class Se {
|
|
|
2746
2746
|
};
|
|
2747
2747
|
}
|
|
2748
2748
|
};
|
|
2749
|
-
V = new WeakMap(), ze = new WeakMap()
|
|
2749
|
+
V = new WeakMap(), ze = new WeakMap();
|
|
2750
2750
|
let x = Se;
|
|
2751
|
-
function
|
|
2751
|
+
function mi(o = 0.5) {
|
|
2752
2752
|
return Math.random() < o;
|
|
2753
2753
|
}
|
|
2754
2754
|
function de(o, e, t) {
|
|
@@ -2766,19 +2766,19 @@ function de(o, e, t) {
|
|
|
2766
2766
|
return s;
|
|
2767
2767
|
}
|
|
2768
2768
|
function X(o, e) {
|
|
2769
|
-
return e === !1 ?
|
|
2769
|
+
return e === !1 ? mi() ? de(1, o) : -de(1, o) : de(-o, o);
|
|
2770
2770
|
}
|
|
2771
|
-
function
|
|
2771
|
+
function Gi(o) {
|
|
2772
2772
|
let e = G.primes();
|
|
2773
|
-
return o !== void 0 && (e = e.filter((t) => t < o)),
|
|
2773
|
+
return o !== void 0 && (e = e.filter((t) => t < o)), ei(e);
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2776
|
-
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);
|
|
2777
2777
|
}
|
|
2778
|
-
function
|
|
2778
|
+
function ei(o) {
|
|
2779
2779
|
return o.length === 0 ? null : o[de(0, o.length - 1)];
|
|
2780
2780
|
}
|
|
2781
|
-
function
|
|
2781
|
+
function gi(o) {
|
|
2782
2782
|
const e = Object.values(o);
|
|
2783
2783
|
for (let t = e.length - 1; t > 0; t--) {
|
|
2784
2784
|
const s = Math.floor(Math.random() * (t + 1)), r = e[t];
|
|
@@ -2791,15 +2791,11 @@ class D extends x {
|
|
|
2791
2791
|
super(), e.length > 0 && this.parse(...e);
|
|
2792
2792
|
}
|
|
2793
2793
|
parse(...e) {
|
|
2794
|
-
if (this.asPoint = !0, e.length ===
|
|
2794
|
+
if (this.asPoint = !0, e.length === 1) {
|
|
2795
2795
|
if (e[0] instanceof x)
|
|
2796
2796
|
return this.array = e[0].copy(), this;
|
|
2797
|
-
if (typeof e[0] == "string")
|
|
2798
|
-
|
|
2799
|
-
if (t.some((s) => s.isNaN()))
|
|
2800
|
-
throw new Error("The value is not a valid point sting (a,b): " + e[0]);
|
|
2801
|
-
this.array = t;
|
|
2802
|
-
}
|
|
2797
|
+
if (typeof e[0] == "string")
|
|
2798
|
+
return this.fromString(e[0]), this;
|
|
2803
2799
|
}
|
|
2804
2800
|
if (e.length > 1) {
|
|
2805
2801
|
if (e.some((s) => s instanceof x))
|
|
@@ -2816,7 +2812,7 @@ class D extends x {
|
|
|
2816
2812
|
return e.array = this.copy(), e.asPoint = !0, e;
|
|
2817
2813
|
}
|
|
2818
2814
|
}
|
|
2819
|
-
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;
|
|
2820
2816
|
const Le = class Le {
|
|
2821
2817
|
/**
|
|
2822
2818
|
* Value can be a mix of:
|
|
@@ -3122,8 +3118,8 @@ const Le = class Le {
|
|
|
3122
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
|
|
3123
3119
|
a(Le, "PERPENDICULAR", "perpendicular"), a(Le, "PARALLEL", "parallel");
|
|
3124
3120
|
let j = Le;
|
|
3125
|
-
var oe, F, qe, kt, Lt,
|
|
3126
|
-
const
|
|
3121
|
+
var oe, F, qe, zt, kt, Lt, he, wi, mt, vi, bi, xi, Qt;
|
|
3122
|
+
const Dt = class Dt {
|
|
3127
3123
|
constructor(...e) {
|
|
3128
3124
|
f(this, he);
|
|
3129
3125
|
f(this, oe);
|
|
@@ -3147,7 +3143,7 @@ const Zt = class Zt {
|
|
|
3147
3143
|
const s = i(this, qe).clone(), r = e.getEquation().clone().isolate("x"), n = e.getEquation().clone().isolate("y");
|
|
3148
3144
|
return r instanceof H && n instanceof H && (s.replaceBy("y", n.right).simplify(), s.solve()), t;
|
|
3149
3145
|
});
|
|
3150
|
-
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 !"), []));
|
|
3151
3147
|
a(this, "isPointOnCircle", (e) => {
|
|
3152
3148
|
var t;
|
|
3153
3149
|
return ((t = i(this, qe)) == null ? void 0 : t.test({ x: e.x, y: e.y })) ?? !1;
|
|
@@ -3164,15 +3160,15 @@ const Zt = class Zt {
|
|
|
3164
3160
|
);
|
|
3165
3161
|
}), s;
|
|
3166
3162
|
});
|
|
3167
|
-
f(this,
|
|
3163
|
+
f(this, zt, (e) => {
|
|
3168
3164
|
const t = new D(this.center, e);
|
|
3169
|
-
return [new j(e, t,
|
|
3165
|
+
return [new j(e, t, yi.Perpendicular)];
|
|
3170
3166
|
});
|
|
3171
|
-
f(this,
|
|
3167
|
+
f(this, kt, (e) => {
|
|
3172
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");
|
|
3173
3169
|
r.multiply(t).subtract(s).pow(2), n.multiply(this.squareRadius), new H(r, n).moveLeft().simplify().solve();
|
|
3174
3170
|
});
|
|
3175
|
-
f(this,
|
|
3171
|
+
f(this, Lt, (e) => {
|
|
3176
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());
|
|
3177
3173
|
return [new j(t, s, u), new j(t, s, p)];
|
|
3178
3174
|
});
|
|
@@ -3212,7 +3208,7 @@ const Zt = class Zt {
|
|
|
3212
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}`;
|
|
3213
3209
|
}
|
|
3214
3210
|
clone() {
|
|
3215
|
-
return new
|
|
3211
|
+
return new Dt(
|
|
3216
3212
|
this.center.clone(),
|
|
3217
3213
|
this.squareRadius.clone(),
|
|
3218
3214
|
!0
|
|
@@ -3222,7 +3218,7 @@ const Zt = class Zt {
|
|
|
3222
3218
|
return t ? h(this, F, new c(e)) : h(this, F, new c(e).pow(2)), M(this, he, mt).call(this), this;
|
|
3223
3219
|
}
|
|
3224
3220
|
parse(...e) {
|
|
3225
|
-
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;
|
|
3226
3222
|
}
|
|
3227
3223
|
// private _parseThroughtThreePoints(A: Point, B: Point, C: Point): this {
|
|
3228
3224
|
// const T = new Triangle(A, B, C), mAB = T.remarquables.mediators.AB.clone(),
|
|
@@ -3231,20 +3227,20 @@ const Zt = class Zt {
|
|
|
3231
3227
|
// return this
|
|
3232
3228
|
// }
|
|
3233
3229
|
};
|
|
3234
|
-
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() {
|
|
3235
3231
|
return h(this, oe, void 0), h(this, F, void 0), h(this, qe, void 0), this;
|
|
3236
3232
|
}, mt = function() {
|
|
3237
3233
|
h(this, qe, new H(
|
|
3238
3234
|
new T(`(x-(${this.center.x.display}))^2+(y-(${this.center.y.display}))^2`),
|
|
3239
3235
|
new T(this.squareRadius.display)
|
|
3240
3236
|
).moveLeft());
|
|
3241
|
-
},
|
|
3237
|
+
}, vi = function(e) {
|
|
3242
3238
|
return h(this, oe, e.center.clone()), h(this, F, e.squareRadius.clone()), M(this, he, mt).call(this), this;
|
|
3243
|
-
},
|
|
3239
|
+
}, bi = function(e, t, s) {
|
|
3244
3240
|
return h(this, oe, e.clone()), s ? h(this, F, new c(t)) : h(this, F, new c(t).pow(2)), this;
|
|
3245
|
-
},
|
|
3241
|
+
}, xi = function(e, t) {
|
|
3246
3242
|
return h(this, oe, e.clone()), h(this, F, new x(i(this, oe), t).normSquare), this;
|
|
3247
|
-
},
|
|
3243
|
+
}, Qt = function(e) {
|
|
3248
3244
|
if (e.moveLeft(), e.degree("x").value === 2 && e.degree("y").value === 2) {
|
|
3249
3245
|
const t = e.left.monomByDegree(2, "x"), s = e.left.monomByDegree(2, "y");
|
|
3250
3246
|
let r, n, l;
|
|
@@ -3252,9 +3248,9 @@ oe = new WeakMap(), F = new WeakMap(), qe = new WeakMap(), kt = new WeakMap(), L
|
|
|
3252
3248
|
}
|
|
3253
3249
|
return this;
|
|
3254
3250
|
};
|
|
3255
|
-
let yt =
|
|
3256
|
-
var Q, _, ee, Je, Te, ct,
|
|
3257
|
-
const
|
|
3251
|
+
let yt = Dt;
|
|
3252
|
+
var Q, _, ee, Je, Te, ct, Zt, ut, Pe, Vt, _e;
|
|
3253
|
+
const Ft = class Ft {
|
|
3258
3254
|
constructor(...e) {
|
|
3259
3255
|
f(this, Q);
|
|
3260
3256
|
f(this, _);
|
|
@@ -3306,14 +3302,14 @@ const jt = class jt {
|
|
|
3306
3302
|
BC: new j(i(this, _), i(this, ee)),
|
|
3307
3303
|
AC: new j(i(this, Q), i(this, ee))
|
|
3308
3304
|
}));
|
|
3309
|
-
} else if (e.length === 1 && e[0] instanceof
|
|
3305
|
+
} else if (e.length === 1 && e[0] instanceof Ft)
|
|
3310
3306
|
return e[0].clone();
|
|
3311
|
-
return i(this,
|
|
3307
|
+
return i(this, Zt).call(this), this;
|
|
3312
3308
|
});
|
|
3313
3309
|
/**
|
|
3314
3310
|
* Clone the Triangle class
|
|
3315
3311
|
*/
|
|
3316
|
-
a(this, "clone", () => new
|
|
3312
|
+
a(this, "clone", () => new Ft(
|
|
3317
3313
|
i(this, Q).clone(),
|
|
3318
3314
|
i(this, _).clone(),
|
|
3319
3315
|
i(this, ee).clone()
|
|
@@ -3324,12 +3320,12 @@ const jt = class jt {
|
|
|
3324
3320
|
/**
|
|
3325
3321
|
* Generate the Line object for the three segments of the triangle
|
|
3326
3322
|
*/
|
|
3327
|
-
f(this,
|
|
3323
|
+
f(this, Zt, () => {
|
|
3328
3324
|
h(this, Te, {
|
|
3329
3325
|
AB: new D().middleOf(i(this, Q), i(this, _)),
|
|
3330
3326
|
AC: new D().middleOf(i(this, Q), i(this, ee)),
|
|
3331
3327
|
BC: new D().middleOf(i(this, _), i(this, ee))
|
|
3332
|
-
}), h(this, ct, i(this,
|
|
3328
|
+
}), h(this, ct, i(this, Vt).call(this));
|
|
3333
3329
|
});
|
|
3334
3330
|
/**
|
|
3335
3331
|
* Get the Vector2D class for the given name
|
|
@@ -3355,7 +3351,7 @@ const jt = class jt {
|
|
|
3355
3351
|
i(this, ut).call(this, e),
|
|
3356
3352
|
i(this, ut).call(this, t)
|
|
3357
3353
|
));
|
|
3358
|
-
f(this,
|
|
3354
|
+
f(this, Vt, () => {
|
|
3359
3355
|
const e = {
|
|
3360
3356
|
A: new j(i(this, Q), i(this, Te).BC),
|
|
3361
3357
|
B: new j(i(this, _), i(this, Te).AC),
|
|
@@ -3446,8 +3442,8 @@ const jt = class jt {
|
|
|
3446
3442
|
return i(this, ct);
|
|
3447
3443
|
}
|
|
3448
3444
|
};
|
|
3449
|
-
Q = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), Je = new WeakMap(), Te = new WeakMap(), ct = new WeakMap(),
|
|
3450
|
-
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;
|
|
3451
3447
|
var z, W;
|
|
3452
3448
|
const nt = class nt {
|
|
3453
3449
|
constructor(e, t) {
|
|
@@ -3559,7 +3555,7 @@ z = new WeakMap(), W = new WeakMap(), // A line is defined as the canonical form
|
|
|
3559
3555
|
a(nt, "PERPENDICULAR", "perpendicular"), a(nt, "PARALLEL", "parallel");
|
|
3560
3556
|
let wt = nt;
|
|
3561
3557
|
var Ae, Fe;
|
|
3562
|
-
const
|
|
3558
|
+
const ii = class ii {
|
|
3563
3559
|
constructor(e) {
|
|
3564
3560
|
f(this, Ae, new x(0, 0, 1));
|
|
3565
3561
|
f(this, Fe, new D(0, 0, 0));
|
|
@@ -3624,7 +3620,7 @@ const si = class si {
|
|
|
3624
3620
|
}
|
|
3625
3621
|
}
|
|
3626
3622
|
angle(e, t, s) {
|
|
3627
|
-
if (e instanceof
|
|
3623
|
+
if (e instanceof ii)
|
|
3628
3624
|
return this.normal.angle(e.normal, t, s);
|
|
3629
3625
|
let r;
|
|
3630
3626
|
if (e instanceof x) {
|
|
@@ -3650,9 +3646,9 @@ const si = class si {
|
|
|
3650
3646
|
}
|
|
3651
3647
|
};
|
|
3652
3648
|
Ae = new WeakMap(), Fe = new WeakMap();
|
|
3653
|
-
let
|
|
3649
|
+
let Jt = ii;
|
|
3654
3650
|
var Me;
|
|
3655
|
-
class
|
|
3651
|
+
class Hi {
|
|
3656
3652
|
constructor(...e) {
|
|
3657
3653
|
f(this, Me, []);
|
|
3658
3654
|
return h(this, Me, e), this;
|
|
@@ -3672,7 +3668,7 @@ class Xi {
|
|
|
3672
3668
|
determinant() {
|
|
3673
3669
|
if (!this.isSquare())
|
|
3674
3670
|
throw new Error("Matrix is not square");
|
|
3675
|
-
return
|
|
3671
|
+
return Ui(...this.values);
|
|
3676
3672
|
}
|
|
3677
3673
|
}
|
|
3678
3674
|
Me = new WeakMap();
|
|
@@ -3696,7 +3692,7 @@ function vt(o) {
|
|
|
3696
3692
|
}
|
|
3697
3693
|
return e.reduced ? t.reduce() : t;
|
|
3698
3694
|
}
|
|
3699
|
-
function
|
|
3695
|
+
function Ei(o) {
|
|
3700
3696
|
const e = Object.assign(
|
|
3701
3697
|
{
|
|
3702
3698
|
letters: "x",
|
|
@@ -3714,14 +3710,14 @@ function Ni(o) {
|
|
|
3714
3710
|
for (const s of e.letters.split(""))
|
|
3715
3711
|
t.setLetter(s, 0);
|
|
3716
3712
|
for (let s = 0; s < e.degree; s++) {
|
|
3717
|
-
const r =
|
|
3713
|
+
const r = ei(e.letters.split(""));
|
|
3718
3714
|
t.setLetter(r, t.degree(r).clone().add(1));
|
|
3719
3715
|
}
|
|
3720
3716
|
} else
|
|
3721
3717
|
t.setLetter(e.letters, e.degree);
|
|
3722
3718
|
return t;
|
|
3723
3719
|
}
|
|
3724
|
-
const
|
|
3720
|
+
const Xi = {
|
|
3725
3721
|
letters: "x",
|
|
3726
3722
|
degree: 2,
|
|
3727
3723
|
fraction: !1,
|
|
@@ -3732,14 +3728,14 @@ const Yi = {
|
|
|
3732
3728
|
numberOfMonoms: 0,
|
|
3733
3729
|
positive: !0
|
|
3734
3730
|
};
|
|
3735
|
-
function
|
|
3731
|
+
function Ni(o) {
|
|
3736
3732
|
const e = Object.assign(
|
|
3737
|
-
|
|
3733
|
+
Xi,
|
|
3738
3734
|
o
|
|
3739
3735
|
), t = new T().empty();
|
|
3740
3736
|
let s;
|
|
3741
3737
|
for (let r = e.degree; r >= 0; r--)
|
|
3742
|
-
s =
|
|
3738
|
+
s = Ei({
|
|
3743
3739
|
letters: e.letters,
|
|
3744
3740
|
degree: r,
|
|
3745
3741
|
fraction: e.fraction,
|
|
@@ -3752,7 +3748,7 @@ function Oi(o) {
|
|
|
3752
3748
|
}
|
|
3753
3749
|
return t;
|
|
3754
3750
|
}
|
|
3755
|
-
function
|
|
3751
|
+
function Yi(o) {
|
|
3756
3752
|
const e = Object.assign(
|
|
3757
3753
|
{
|
|
3758
3754
|
letters: "x",
|
|
@@ -3774,7 +3770,7 @@ function Qi(o) {
|
|
|
3774
3770
|
o
|
|
3775
3771
|
), t = new T().one();
|
|
3776
3772
|
for (let s = 0; s < e.degree; s++) {
|
|
3777
|
-
const r =
|
|
3773
|
+
const r = Ni({
|
|
3778
3774
|
degree: 1,
|
|
3779
3775
|
unit: e.unit,
|
|
3780
3776
|
fraction: e.fraction,
|
|
@@ -3785,7 +3781,7 @@ function Qi(o) {
|
|
|
3785
3781
|
}
|
|
3786
3782
|
return new H(t, 0);
|
|
3787
3783
|
}
|
|
3788
|
-
function
|
|
3784
|
+
function Oi(o) {
|
|
3789
3785
|
const e = Object.assign(
|
|
3790
3786
|
{
|
|
3791
3787
|
axis: !0,
|
|
@@ -3797,7 +3793,7 @@ function qi(o) {
|
|
|
3797
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));
|
|
3798
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);
|
|
3799
3795
|
}
|
|
3800
|
-
function
|
|
3796
|
+
function Qi(o) {
|
|
3801
3797
|
const e = Object.assign(
|
|
3802
3798
|
{
|
|
3803
3799
|
center: {
|
|
@@ -3807,11 +3803,11 @@ function Ki(o) {
|
|
|
3807
3803
|
pointsOnCircle: 8
|
|
3808
3804
|
},
|
|
3809
3805
|
o
|
|
3810
|
-
), t =
|
|
3806
|
+
), t = Oi(e.center);
|
|
3811
3807
|
let s, r;
|
|
3812
3808
|
return e.pointsOnCircle === 8 ? (s = de(1, 3), r = s ** 2 + (s + 1) ** 2) : r = de(1, 20), new yt(t, r, !0);
|
|
3813
3809
|
}
|
|
3814
|
-
function
|
|
3810
|
+
function Ki(o) {
|
|
3815
3811
|
const e = Object.assign(
|
|
3816
3812
|
{
|
|
3817
3813
|
A: {
|
|
@@ -3828,7 +3824,7 @@ function Ji(o) {
|
|
|
3828
3824
|
t.x = X(10), t.y = X(10);
|
|
3829
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);
|
|
3830
3826
|
}
|
|
3831
|
-
function
|
|
3827
|
+
function Ji(o) {
|
|
3832
3828
|
const e = Object.assign(
|
|
3833
3829
|
{
|
|
3834
3830
|
A: {
|
|
@@ -3846,45 +3842,45 @@ function _i(o) {
|
|
|
3846
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);
|
|
3847
3843
|
return new wt(t, s);
|
|
3848
3844
|
}
|
|
3849
|
-
const
|
|
3850
|
-
equation: (o) =>
|
|
3851
|
-
polynom: (o) =>
|
|
3852
|
-
monom: (o) =>
|
|
3845
|
+
const _i = {
|
|
3846
|
+
equation: (o) => Yi(o),
|
|
3847
|
+
polynom: (o) => Ni(o),
|
|
3848
|
+
monom: (o) => Ei(o),
|
|
3853
3849
|
fraction: (o) => vt(o),
|
|
3854
3850
|
number: (o, e, t) => de(o, e, t),
|
|
3855
3851
|
numberSym: (o, e) => X(o, e),
|
|
3856
|
-
prime: (o) =>
|
|
3857
|
-
bool: (o) =>
|
|
3858
|
-
array: (o, e) =>
|
|
3859
|
-
item: (o) =>
|
|
3860
|
-
shuffle: (o) =>
|
|
3861
|
-
line: (o) =>
|
|
3862
|
-
line3: (o) =>
|
|
3863
|
-
point: (o) =>
|
|
3864
|
-
circle: (o) =>
|
|
3865
|
-
},
|
|
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 = {
|
|
3866
3862
|
Vector: x,
|
|
3867
3863
|
Point: D,
|
|
3868
3864
|
Line: j,
|
|
3869
|
-
Triangle:
|
|
3865
|
+
Triangle: Kt,
|
|
3870
3866
|
Circle: yt,
|
|
3871
3867
|
Line3: wt,
|
|
3872
|
-
Plane3:
|
|
3873
|
-
},
|
|
3868
|
+
Plane3: Jt
|
|
3869
|
+
}, is = {
|
|
3874
3870
|
Numeric: G,
|
|
3875
3871
|
Fraction: c,
|
|
3876
3872
|
Root: ft,
|
|
3877
3873
|
Monom: I,
|
|
3878
3874
|
Polynom: T,
|
|
3879
3875
|
Equation: H,
|
|
3880
|
-
Matrix:
|
|
3881
|
-
LinearSystem:
|
|
3876
|
+
Matrix: Hi,
|
|
3877
|
+
LinearSystem: Yt,
|
|
3882
3878
|
Factor: fe,
|
|
3883
|
-
PolyFactor:
|
|
3879
|
+
PolyFactor: Ht,
|
|
3884
3880
|
// LogicalSet,
|
|
3885
|
-
Random:
|
|
3886
|
-
Geometry:
|
|
3881
|
+
Random: _i,
|
|
3882
|
+
Geometry: es
|
|
3887
3883
|
};
|
|
3888
3884
|
export {
|
|
3889
|
-
|
|
3885
|
+
is as default
|
|
3890
3886
|
};
|
package/package.json
CHANGED
|
@@ -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,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAGzC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAItC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAIpC,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;IAkCzD,KAAK,IAAI,MAAM;IAOf,IAAI,IAAI,QAAQ,EAAE;IAIzB,IAAI,QAAO,IAAI,CAGd;IAED,GAAG,QAAO,IAAI,CAIb;IAED,QAAQ,QAAO,IAAI,CAGlB;IAED,GAAG,MAAO,MAAM,KAAG,IAAI,CAGtB;IAED,QAAQ,MAAO,MAAM,KAAG,IAAI,CAE3B;IAED,IAAI,QAAO,IAAI,CAOd;IAED,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAWtC,SAAS,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI;IAMtC,GAAG,MAAO,MAAM,KAAG,QAAQ,CAE1B;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAY5B,MAAM,QAAO,IAAI,CAQhB;IAED,MAAM,IAAI,OAAO;IAGjB,KAAK,IAAI,OAAO;IAIhB,OAAO,MAAO,MAAM,KAAG,OAAO,CAE7B;IAED,YAAY,MAAO,MAAM,KAAG,OAAO,CAElC;IAED,UAAU,MAAO,MAAM,KAAG,OAAO,CAEhC;IAED,gBAAgB,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAIjD;IAED,cAAc,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAE/C;IAED,QAAQ,QAAO,IAAI,CAYlB;IAED,KAAK,MAAO,MAAM,UAAU,OAAO,WAAW,OAAO,KAAG,MAAM,CAU7D;
|
|
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,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAGzC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;IAItC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAIpC,KAAK,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI;IAkCzD,KAAK,IAAI,MAAM;IAOf,IAAI,IAAI,QAAQ,EAAE;IAIzB,IAAI,QAAO,IAAI,CAGd;IAED,GAAG,QAAO,IAAI,CAIb;IAED,QAAQ,QAAO,IAAI,CAGlB;IAED,GAAG,MAAO,MAAM,KAAG,IAAI,CAGtB;IAED,QAAQ,MAAO,MAAM,KAAG,IAAI,CAE3B;IAED,IAAI,QAAO,IAAI,CAOd;IAED,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAWtC,SAAS,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI;IAMtC,GAAG,MAAO,MAAM,KAAG,QAAQ,CAE1B;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAY5B,MAAM,QAAO,IAAI,CAQhB;IAED,MAAM,IAAI,OAAO;IAGjB,KAAK,IAAI,OAAO;IAIhB,OAAO,MAAO,MAAM,KAAG,OAAO,CAE7B;IAED,YAAY,MAAO,MAAM,KAAG,OAAO,CAElC;IAED,UAAU,MAAO,MAAM,KAAG,OAAO,CAEhC;IAED,gBAAgB,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAIjD;IAED,cAAc,MAAO,WAAW,QAAQ,CAAC,KAAG,IAAI,CAE/C;IAED,QAAQ,QAAO,IAAI,CAYlB;IAED,KAAK,MAAO,MAAM,UAAU,OAAO,WAAW,OAAO,KAAG,MAAM,CAU7D;IAGD,UAAU,UAAW,MAAM,KAAG,IAAI,CAuBjC;IAED,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;CAS/E"}
|