pimath 0.1.29 → 0.1.32

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.
@@ -14,7 +14,7 @@ export declare enum SPHERE3_RELATIVE_POSITION {
14
14
  export declare class Sphere3 {
15
15
  #private;
16
16
  constructor(center?: Point, radius?: InputValue<Fraction>);
17
- fromPolynom(polynom: Equation | string): this;
17
+ fromEquation(equation: Equation | string): this;
18
18
  get center(): Point;
19
19
  get squareRadius(): Fraction;
20
20
  get radius(): {
@@ -28,6 +28,7 @@ export declare class Sphere3 {
28
28
  get developped(): this;
29
29
  get tex(): string;
30
30
  get display(): string;
31
+ static RELATIVE_POSITION: typeof SPHERE3_RELATIVE_POSITION;
31
32
  relativePosition: (S: Sphere3) => SPHERE3_RELATIVE_POSITION;
32
33
  isPointOnSphere: (P: Point) => boolean;
33
34
  }
package/dist/pimath.js CHANGED
@@ -1,18 +1,18 @@
1
- var Gi = Object.defineProperty;
1
+ var Xi = Object.defineProperty;
2
2
  var Ni = (o) => {
3
3
  throw TypeError(o);
4
4
  };
5
- var Wi = (o, e, t) => e in o ? Gi(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
6
- var a = (o, e, t) => Wi(o, typeof e != "symbol" ? e + "" : e, t), ri = (o, e, t) => e.has(o) || Ni("Cannot " + t);
5
+ var Yi = (o, e, t) => e in o ? Xi(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
6
+ var a = (o, e, t) => Yi(o, typeof e != "symbol" ? e + "" : e, t), ri = (o, e, t) => e.has(o) || Ni("Cannot " + t);
7
7
  var s = (o, e, t) => (ri(o, e, "read from private field"), t ? t.call(o) : e.get(o)), m = (o, e, t) => e.has(o) ? Ni("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), h = (o, e, t, i) => (ri(o, e, "write to private field"), i ? i.call(o, t) : e.set(o, t), t), A = (o, e, t) => (ri(o, e, "access private method"), t);
8
- function Xi(o) {
8
+ function Qi(o) {
9
9
  const e = Ai(o), t = [];
10
10
  let i, n;
11
11
  for (; e.length > 0; )
12
12
  i = e.shift() ?? 1, n = (e.length > 0 ? e.pop() : +i) ?? 1, t.push([i, n]);
13
13
  return t;
14
14
  }
15
- function Yi(...o) {
15
+ function Hi(...o) {
16
16
  const e = wi(...o);
17
17
  return o.map((t) => t / e);
18
18
  }
@@ -39,44 +39,44 @@ function wi(...o) {
39
39
  ;
40
40
  return Math.abs(t);
41
41
  }
42
- function Qi(...o) {
42
+ function Ki(...o) {
43
43
  return o.reduce(function(e, t) {
44
44
  return Math.abs(e * t / wi(e, t));
45
45
  });
46
46
  }
47
- function Hi(o, e = 3) {
47
+ function Ji(o, e = 3) {
48
48
  return +o.toFixed(e);
49
49
  }
50
- function Ki(o) {
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 Ji(o) {
55
+ function es(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 _i(o, e) {
59
+ function ts(o, e) {
60
60
  const t = [], i = e === !0 ? +o : o ** 2;
61
61
  for (let n = 0; n <= o; n++)
62
62
  for (let r = 0; r <= o; r++)
63
63
  n ** 2 + r ** 2 === i && t.push([n, r, o]);
64
64
  return t;
65
65
  }
66
- function es(o, e = 2) {
66
+ function is(o, e = 2) {
67
67
  return +`${Math.round(+`${o}e${e}`)}e-${e}`;
68
68
  }
69
69
  const G = {
70
- decompose: Xi,
70
+ decompose: Qi,
71
71
  dividers: Ai,
72
- divideNumbersByGCD: Yi,
72
+ divideNumbersByGCD: Hi,
73
73
  gcd: wi,
74
- lcm: Qi,
75
- numberCorrection: Hi,
76
- periodic: Ki,
77
- primes: Ji,
78
- pythagoreanTripletsWithTarget: _i,
79
- round: es
74
+ lcm: Ki,
75
+ numberCorrection: Ji,
76
+ periodic: _i,
77
+ primes: es,
78
+ pythagoreanTripletsWithTarget: ts,
79
+ round: is
80
80
  };
81
81
  var mt, x, v, Le;
82
82
  const B = class B {
@@ -565,15 +565,15 @@ K = new WeakMap(), Ge = new WeakMap(), M = new WeakSet(), Qe = function(e, t) {
565
565
  ].sort((ge, pe) => ge.value - pe.value);
566
566
  };
567
567
  let Mt = xi;
568
- var ts = Object.defineProperty, Pi = (o) => {
568
+ var ss = Object.defineProperty, Pi = (o) => {
569
569
  throw TypeError(o);
570
- }, is = (o, e, t) => e in o ? ts(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, oi = (o, e, t) => is(o, typeof e != "symbol" ? e + "" : e, t), Si = (o, e, t) => e.has(o) || Pi("Cannot " + t), te = (o, e, t) => (Si(o, e, "read from private field"), t ? t.call(o) : e.get(o)), ct = (o, e, t) => e.has(o) ? Pi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), Ne = (o, e, t, i) => (Si(o, e, "write to private field"), e.set(o, t), t);
570
+ }, ns = (o, e, t) => e in o ? ss(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, oi = (o, e, t) => ns(o, typeof e != "symbol" ? e + "" : e, t), Si = (o, e, t) => e.has(o) || Pi("Cannot " + t), te = (o, e, t) => (Si(o, e, "read from private field"), t ? t.call(o) : e.get(o)), ct = (o, e, t) => e.has(o) ? Pi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), Ne = (o, e, t, i) => (Si(o, e, "write to private field"), e.set(o, t), t);
571
571
  const vi = {
572
572
  pi: Math.PI,
573
573
  e: Math.exp(1)
574
574
  };
575
575
  var g = /* @__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))(g || {}), Ue = /* @__PURE__ */ ((o) => (o.EXPRESSION = "expression", o.POLYNOM = "polynom", o.SET = "set", o.NUMERIC = "numeric", o))(Ue || {});
576
- function ss(o, e) {
576
+ function rs(o, e) {
577
577
  if (o.length <= 1)
578
578
  return o;
579
579
  const t = Object.keys(e).filter((w) => e[w].type === g.FUNCTION).map((w) => w);
@@ -615,20 +615,20 @@ function ss(o, e) {
615
615
  }
616
616
  if (p === void 0 || d === void 0)
617
617
  throw new Error("The token is undefined");
618
- c += ns(f, d), c += p;
618
+ c += os(f, d), c += p;
619
619
  }
620
620
  return c;
621
621
  }
622
- function ns(o, e) {
622
+ function os(o, e) {
623
623
  return o === void 0 || o === g.OPERATION || e === g.OPERATION || o === g.LEFT_PARENTHESIS || o === g.FUNCTION || o === g.FUNCTION_ARGUMENT || e === g.RIGHT_PARENTHESIS || e === g.FUNCTION_ARGUMENT ? "" : "*";
624
624
  }
625
- const rs = {
625
+ const hs = {
626
626
  "^": { precedence: 4, associative: "right", type: g.OPERATION },
627
627
  "*": { precedence: 3, associative: "left", type: g.OPERATION },
628
628
  "/": { precedence: 3, associative: "left", type: g.OPERATION },
629
629
  "+": { precedence: 2, associative: "left", type: g.OPERATION },
630
630
  "-": { precedence: 2, associative: "left", type: g.OPERATION }
631
- }, os = {
631
+ }, as = {
632
632
  "^": { precedence: 4, associative: "right", type: g.OPERATION },
633
633
  "*": { precedence: 3, associative: "left", type: g.OPERATION },
634
634
  "/": { precedence: 3, associative: "left", type: g.OPERATION },
@@ -641,7 +641,7 @@ const rs = {
641
641
  sqrt: { precedence: 4, associative: "right", type: g.FUNCTION },
642
642
  nthrt: { precedence: 4, associative: "right", type: g.FUNCTION },
643
643
  ",": { precedence: 2, associative: "left", type: g.FUNCTION_ARGUMENT }
644
- }, hs = {
644
+ }, ls = {
645
645
  "^": { precedence: 4, associative: "right", type: g.OPERATION },
646
646
  "*": { precedence: 3, associative: "left", type: g.OPERATION },
647
647
  "/": { precedence: 3, associative: "left", type: g.OPERATION },
@@ -655,7 +655,7 @@ const rs = {
655
655
  nthrt: { precedence: 4, associative: "right", type: g.FUNCTION },
656
656
  ln: { precedence: 4, associative: "right", type: g.FUNCTION },
657
657
  log: { precedence: 4, associative: "right", type: g.FUNCTION }
658
- }, as = {
658
+ }, cs = {
659
659
  "&": { precedence: 3, associative: "left", type: g.OPERATION },
660
660
  "|": { precedence: 3, associative: "left", type: g.OPERATION },
661
661
  "!": { precedence: 4, associative: "right", type: g.OPERATION },
@@ -674,7 +674,7 @@ class si {
674
674
  return te(this, ft).map((e) => e.token);
675
675
  }
676
676
  tokenConfigInitialization() {
677
- return te(this, He) === Ue.SET ? (Ne(this, ne, as), Ne(this, Fe, !1)) : te(this, He) === Ue.NUMERIC ? (Ne(this, ne, hs), Ne(this, Fe, !0)) : te(this, He) === Ue.EXPRESSION ? (Ne(this, ne, os), Ne(this, Fe, !0)) : (Ne(this, ne, rs), Ne(this, Fe, !0)), Ne(this, Tt, Object.keys(te(this, ne)).sort((e, t) => t.length - e.length)), te(this, ne);
677
+ return te(this, He) === Ue.SET ? (Ne(this, ne, cs), Ne(this, Fe, !1)) : te(this, He) === Ue.NUMERIC ? (Ne(this, ne, ls), Ne(this, Fe, !0)) : te(this, He) === Ue.EXPRESSION ? (Ne(this, ne, as), Ne(this, Fe, !0)) : (Ne(this, ne, hs), Ne(this, Fe, !0)), Ne(this, Tt, Object.keys(te(this, ne)).sort((e, t) => t.length - e.length)), te(this, ne);
678
678
  }
679
679
  /**
680
680
  * Get the next token to analyse.
@@ -723,7 +723,7 @@ class si {
723
723
  parse(e, t) {
724
724
  const i = [], n = [];
725
725
  let r = "", l = 0, c;
726
- (t ?? te(this, Fe)) && (e = ss(e, te(this, ne)));
726
+ (t ?? te(this, Fe)) && (e = rs(e, te(this, ne)));
727
727
  const f = 50;
728
728
  let d = 50, p;
729
729
  for (; l < e.length; ) {
@@ -791,7 +791,7 @@ class si {
791
791
  }
792
792
  }
793
793
  He = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap();
794
- class ls {
794
+ class us {
795
795
  constructor(e, t) {
796
796
  oi(this, "_rpn"), oi(this, "_expression"), oi(this, "_isValid"), this._expression = e;
797
797
  try {
@@ -2518,7 +2518,7 @@ const Ke = class Ke {
2518
2518
  Z = new WeakMap(), Se = new WeakMap(), Yt = new WeakMap(), Qt = new WeakMap();
2519
2519
  let hi = Ke;
2520
2520
  var ke, vt, ai;
2521
- class cs {
2521
+ class fs {
2522
2522
  /**
2523
2523
  *
2524
2524
  * @param {string} value (optional) Default polynom to parse on class creation
@@ -2947,12 +2947,12 @@ function ut(o) {
2947
2947
  }, {}), { numerator: n, denominator: r } = e.divide(t).reduce();
2948
2948
  return n !== 1 && (i[n.toString()] = [new se(n, 1)]), r !== 1 && (i[r.toString()] = [new se(r, -1)]), i;
2949
2949
  }
2950
- function us(o, e) {
2950
+ function ds(o, e) {
2951
2951
  return o.dimension === e.dimension && o.array.every(
2952
2952
  (t, i) => e.array[i].isEqual(t)
2953
2953
  );
2954
2954
  }
2955
- function fs(o, e) {
2955
+ function ps(o, e) {
2956
2956
  if (o.dimension !== e.dimension)
2957
2957
  return !1;
2958
2958
  const t = e.array[0].value / o.array[0].value;
@@ -2960,13 +2960,13 @@ function fs(o, e) {
2960
2960
  (i, n) => e.array[n].value === i.value * t
2961
2961
  );
2962
2962
  }
2963
- function ds(o, e) {
2963
+ function ms(o, e) {
2964
2964
  return o.dimension !== e.dimension ? new u().invalid() : o.array.reduce(
2965
2965
  (t, i, n) => t.add(i.clone().multiply(e.array[n])),
2966
2966
  new u(0)
2967
2967
  );
2968
2968
  }
2969
- function ps(...o) {
2969
+ function gs(...o) {
2970
2970
  if (o.some((e) => e.dimension !== o[0].dimension))
2971
2971
  throw new Error("All vectors must have the same dimension");
2972
2972
  if (o[0].dimension !== o.length)
@@ -2993,15 +2993,15 @@ const De = class De {
2993
2993
  const e = this.norm;
2994
2994
  return e === 0 ? this : this.divideByScalar(e);
2995
2995
  });
2996
- a(this, "dot", (e) => ds(this, e));
2996
+ a(this, "dot", (e) => ms(this, e));
2997
2997
  a(this, "normal", () => {
2998
2998
  if (this.dimension >= 3)
2999
2999
  throw new Error("Normal vector can only be determined in 2D");
3000
3000
  const e = this.x.clone().opposite(), t = this.y.clone();
3001
3001
  return s(this, j)[0] = t, s(this, j)[1] = e, this;
3002
3002
  });
3003
- a(this, "isEqual", (e) => us(this, e));
3004
- a(this, "isColinearTo", (e) => fs(this, e));
3003
+ a(this, "isEqual", (e) => ds(this, e));
3004
+ a(this, "isColinearTo", (e) => ps(this, e));
3005
3005
  a(this, "isNormalTo", (e) => this.dot(e).isZero());
3006
3006
  a(this, "multiplyByScalar", (e) => {
3007
3007
  const t = new u(e);
@@ -3187,11 +3187,11 @@ function me(o, e, t) {
3187
3187
  function H(o, e) {
3188
3188
  return e === !1 ? Ri() ? me(1, o) : -me(1, o) : me(-o, o);
3189
3189
  }
3190
- function ms(o) {
3190
+ function ys(o) {
3191
3191
  let e = G.primes();
3192
3192
  return o !== void 0 && (e = e.filter((t) => t < o)), bi(e);
3193
3193
  }
3194
- function gs(o, e) {
3194
+ function ws(o, e) {
3195
3195
  return e === void 0 && (e = 1), o.length <= 0 ? Object.values(o) : Di(o).slice(0, e);
3196
3196
  }
3197
3197
  function bi(o) {
@@ -3780,7 +3780,7 @@ D = new WeakMap(), X = new WeakMap(), // A line is defined as the canonical form
3780
3780
  a(pt, "PERPENDICULAR", fi.Perpendicular), a(pt, "PARALLEL", fi.Parallel);
3781
3781
  let Bt = pt;
3782
3782
  var $e;
3783
- class ys {
3783
+ class vs {
3784
3784
  constructor(...e) {
3785
3785
  m(this, $e, []);
3786
3786
  return h(this, $e, e), this;
@@ -3800,7 +3800,7 @@ class ys {
3800
3800
  determinant() {
3801
3801
  if (!this.isSquare())
3802
3802
  throw new Error("Matrix is not square");
3803
- return ps(...this.values);
3803
+ return gs(...this.values);
3804
3804
  }
3805
3805
  }
3806
3806
  $e = new WeakMap();
@@ -4107,8 +4107,8 @@ const ii = class ii {
4107
4107
  };
4108
4108
  Q = new WeakMap(), _ = new WeakMap(), ee = new WeakMap(), ot = new WeakMap(), Pe = new WeakMap(), xt = new WeakMap(), ei = new WeakMap(), Et = new WeakMap(), Re = new WeakMap(), ti = new WeakMap(), ht = new WeakMap();
4109
4109
  let mi = ii;
4110
- var ws = /* @__PURE__ */ ((o) => (o[o.INTERIOR = 0] = "INTERIOR", o[o.EXTERIOR = 1] = "EXTERIOR", o[o.SECANT = 2] = "SECANT", o[o.TANGENT_INSIDE = 3] = "TANGENT_INSIDE", o[o.TANGENT_OUTSIDE = 4] = "TANGENT_OUTSIDE", o[o.SUPERPOSED = 5] = "SUPERPOSED", o[o.CONCENTRIC = 6] = "CONCENTRIC", o))(ws || {}), Te, de, Oe, at, Nt, qt, gi;
4111
- class vs {
4110
+ var ji = /* @__PURE__ */ ((o) => (o[o.INTERIOR = 0] = "INTERIOR", o[o.EXTERIOR = 1] = "EXTERIOR", o[o.SECANT = 2] = "SECANT", o[o.TANGENT_INSIDE = 3] = "TANGENT_INSIDE", o[o.TANGENT_OUTSIDE = 4] = "TANGENT_OUTSIDE", o[o.SUPERPOSED = 5] = "SUPERPOSED", o[o.CONCENTRIC = 6] = "CONCENTRIC", o))(ji || {}), Te, de, Oe, at, Nt, qt, gi;
4111
+ class Ui {
4112
4112
  constructor(e, t) {
4113
4113
  m(this, qt);
4114
4114
  m(this, Te);
@@ -4134,7 +4134,7 @@ class vs {
4134
4134
  });
4135
4135
  a(this, "relativePosition", (e) => {
4136
4136
  const t = this.center.distanceTo(e.center).value, i = this.radius.value, n = e.radius.value;
4137
- return t > i + n ? 1 : t === i + n ? 4 : t === Math.abs(i - n) ? 3 : t < Math.abs(i - n) ? 0 : t === 0 ? i === n ? 5 : 6 : 2;
4137
+ return t > i + n ? 1 : t === i + n ? 4 : t === 0 ? i === n ? 5 : 6 : t === Math.abs(i - n) ? 3 : t < Math.abs(i - n) ? 0 : 2;
4138
4138
  });
4139
4139
  a(this, "isPointOnSphere", (e) => {
4140
4140
  var t;
@@ -4146,7 +4146,7 @@ class vs {
4146
4146
  });
4147
4147
  return e && t && (h(this, Te, e), h(this, de, new u(t).clone().pow(2)), A(this, qt, gi).call(this)), this;
4148
4148
  }
4149
- fromPolynom(e) {
4149
+ fromEquation(e) {
4150
4150
  const t = new V(e).moveLeft().reduce(), i = ["x", "y", "z"];
4151
4151
  if (i.some((r) => t.degree(r).value !== 2))
4152
4152
  return this.makeUndefined();
@@ -4210,7 +4210,7 @@ Te = new WeakMap(), de = new WeakMap(), Oe = new WeakMap(), at = new WeakMap(),
4210
4210
  ),
4211
4211
  new N(this.squareRadius)
4212
4212
  ).reduce());
4213
- };
4213
+ }, a(Ui, "RELATIVE_POSITION", ji);
4214
4214
  function Pt(o) {
4215
4215
  const e = Object.assign(
4216
4216
  {
@@ -4231,7 +4231,7 @@ function Pt(o) {
4231
4231
  }
4232
4232
  return e.reduced ? t.reduce() : t;
4233
4233
  }
4234
- function ji(o) {
4234
+ function Gi(o) {
4235
4235
  const e = Object.assign(
4236
4236
  {
4237
4237
  letters: "x",
@@ -4267,14 +4267,14 @@ const bs = {
4267
4267
  numberOfMonoms: 0,
4268
4268
  positive: !0
4269
4269
  };
4270
- function Ui(o) {
4270
+ function Wi(o) {
4271
4271
  const e = Object.assign(
4272
4272
  bs,
4273
4273
  o
4274
4274
  ), t = new N().empty();
4275
4275
  let i;
4276
4276
  for (let n = e.degree; n >= 0; n--)
4277
- i = ji({
4277
+ i = Gi({
4278
4278
  letters: e.letters,
4279
4279
  degree: n,
4280
4280
  fraction: e.fraction,
@@ -4309,7 +4309,7 @@ function xs(o) {
4309
4309
  o
4310
4310
  ), t = new N().one();
4311
4311
  for (let i = 0; i < e.degree; i++) {
4312
- const n = Ui({
4312
+ const n = Wi({
4313
4313
  degree: 1,
4314
4314
  unit: e.unit,
4315
4315
  fraction: e.fraction,
@@ -4383,14 +4383,14 @@ function qs(o) {
4383
4383
  }
4384
4384
  const As = {
4385
4385
  equation: (o) => xs(o),
4386
- polynom: (o) => Ui(o),
4387
- monom: (o) => ji(o),
4386
+ polynom: (o) => Wi(o),
4387
+ monom: (o) => Gi(o),
4388
4388
  fraction: (o) => Pt(o),
4389
4389
  number: (o, e, t) => me(o, e, t),
4390
4390
  numberSym: (o, e) => H(o, e),
4391
- prime: (o) => ms(o),
4391
+ prime: (o) => ys(o),
4392
4392
  bool: (o) => Ri(o),
4393
- array: (o, e) => gs(o, e),
4393
+ array: (o, e) => ws(o, e),
4394
4394
  item: (o) => bi(o),
4395
4395
  shuffle: (o) => Di(o),
4396
4396
  line: (o) => Ns(o),
@@ -4408,11 +4408,11 @@ const As = {
4408
4408
  Monom: k,
4409
4409
  Polynom: N,
4410
4410
  Equation: V,
4411
- Matrix: ys,
4411
+ Matrix: vs,
4412
4412
  LinearSystem: hi,
4413
4413
  Factor: se,
4414
4414
  PolyFactor: li,
4415
- LogicalSet: cs,
4415
+ LogicalSet: fs,
4416
4416
  Random: As,
4417
4417
  Geometry: {
4418
4418
  Vector: E,
@@ -4422,9 +4422,9 @@ const As = {
4422
4422
  Circle: $t,
4423
4423
  Line3: Bt,
4424
4424
  Plane3: pi,
4425
- Sphere3: vs
4425
+ Sphere3: Ui
4426
4426
  },
4427
- NumExp: ls
4427
+ NumExp: us
4428
4428
  };
4429
4429
  export {
4430
4430
  $t as Circle,
@@ -4436,25 +4436,25 @@ export {
4436
4436
  z as Line,
4437
4437
  Bt as Line3,
4438
4438
  hi as LinearSystem,
4439
- cs as LogicalSet,
4440
- ys as Matrix,
4439
+ fs as LogicalSet,
4440
+ vs as Matrix,
4441
4441
  k as Monom,
4442
4442
  At as NthRoot,
4443
- ls as NumExp,
4443
+ us as NumExp,
4444
4444
  G as Numeric,
4445
4445
  pi as Plane3,
4446
4446
  S as Point,
4447
4447
  li as PolyFactor,
4448
4448
  N as Polynom,
4449
4449
  As as Random,
4450
- ws as SPHERE3_RELATIVE_POSITION,
4451
- vs as Sphere3,
4450
+ ji as SPHERE3_RELATIVE_POSITION,
4451
+ Ui as Sphere3,
4452
4452
  mi as Triangle,
4453
4453
  E as Vector,
4454
- fs as areVectorsColinears,
4455
- us as areVectorsEquals,
4454
+ ps as areVectorsColinears,
4455
+ ds as areVectorsEquals,
4456
4456
  Os as default,
4457
- ps as determinant,
4458
- ds as dotProduct
4457
+ gs as determinant,
4458
+ ms as dotProduct
4459
4459
  };
4460
4460
  //# sourceMappingURL=pimath.js.map