pimath 0.2.9 → 0.2.10

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
@@ -4076,7 +4076,7 @@ function N(e) {
4076
4076
  //#region src/algebra/matrix.ts
4077
4077
  var le = class e {
4078
4078
  #e = null;
4079
- #t = !0;
4079
+ #t = 0;
4080
4080
  #n = [];
4081
4081
  constructor(e, t) {
4082
4082
  return e && (t ??= e, this.fromDimensions(e, t)), this;
@@ -4095,16 +4095,22 @@ var le = class e {
4095
4095
  }
4096
4096
  get tex() {
4097
4097
  if (this.#n.length === 0) return "";
4098
- let e = this.#t ? "pmatrix" : "bmatrix", t = [
4098
+ let e = this.resolveTeXwrapper(), t = [
4099
4099
  `\\begin{${e}}`,
4100
4100
  ...this.rows.map((e) => " " + e.map((e) => this.#e !== null && e.value ? +e.value.toFixed(this.#e) : e.tex).join(" & ") + "\\\\"),
4101
4101
  `\\end{${e}}`
4102
4102
  ].join("\n");
4103
4103
  return this.#e = null, t;
4104
4104
  }
4105
+ resolveWrapper() {
4106
+ return this.#t === 3 ? ["|", "|"] : this.#t === 4 ? ["||", "||"] : this.#t === 1 ? ["[", "]"] : this.#t === 2 ? ["{", "}"] : ["(", ")"];
4107
+ }
4108
+ resolveTeXwrapper() {
4109
+ return this.#t === 3 ? "vmatrix" : this.#t === 4 ? "Vmatrix" : this.#t === 1 ? "bmatrix" : this.#t === 2 ? "Bmatrix" : "pmatrix";
4110
+ }
4105
4111
  get display() {
4106
4112
  if (this.#n.length === 0) return "";
4107
- let e = this.#t ? ["(", ")"] : ["[", "]"], t = e[0] + this.map((e) => this.#e !== null && e.value ? +e.value.toFixed(this.#e) : e.display).map((e) => `(${e.join(",")})`).join(",") + e[1];
4113
+ let e = this.resolveWrapper(), t = e[0] + this.map((e) => this.#e !== null && e.value ? +e.value.toFixed(this.#e) : e.display).map((e) => `(${e.join(",")})`).join(",") + e[1];
4108
4114
  return this.#e = null, t;
4109
4115
  }
4110
4116
  add(e) {
@@ -4117,7 +4123,10 @@ var le = class e {
4117
4123
  return e < 0 || e > this.dimension.rows || t < 0 || t > this.dimension.cols ? null : this.#n[e][t];
4118
4124
  }
4119
4125
  get bmatrix() {
4120
- return this.#t = !1, this;
4126
+ return this.#t = 1, this;
4127
+ }
4128
+ get Bmatrix() {
4129
+ return this.#t = 2, this;
4121
4130
  }
4122
4131
  canBeAdded(e) {
4123
4132
  let { rows: t, cols: n } = this.dimension, { rows: r, cols: i } = e.dimension;
@@ -4257,7 +4266,13 @@ var le = class e {
4257
4266
  }), this;
4258
4267
  }
4259
4268
  get pmatrix() {
4260
- return this.#t = !0, this;
4269
+ return this.#t = 0, this;
4270
+ }
4271
+ get vmatrix() {
4272
+ return this.#t = 3, this;
4273
+ }
4274
+ get Vmatrix() {
4275
+ return this.#t = 4, this;
4261
4276
  }
4262
4277
  pow(e) {
4263
4278
  return D(this, e);
@@ -5428,11 +5443,11 @@ function ye(e) {
5428
5443
  fraction: !0,
5429
5444
  zero: !1
5430
5445
  }, e), n = new E();
5431
- if (n.coefficient = Y({
5446
+ if (n.coefficient = Y(Object.assign({}, {
5432
5447
  zero: t.zero,
5433
5448
  reduced: !0,
5434
- natural: !t.fraction
5435
- }), t.letters.length > 1) {
5449
+ natural: t.fraction === !1
5450
+ }, typeof t.fraction == "boolean" ? {} : t.fraction)), t.letters.length > 1) {
5436
5451
  for (let e of t.letters.split("")) n.setLetter(e, 0);
5437
5452
  for (let e = 0; e < t.degree; e++) {
5438
5453
  let e = U(t.letters.split(""));
@@ -5515,7 +5530,7 @@ function xe(e) {
5515
5530
  return new k(n, 0);
5516
5531
  }
5517
5532
  //#endregion
5518
- //#region src/randomization/geometry/rndVector.ts
5533
+ //#region src/randomization/geometry/rndPoint.ts
5519
5534
  function Q(e) {
5520
5535
  let t = Object.assign({
5521
5536
  axis: !0,
@@ -5593,8 +5608,8 @@ var $ = {
5593
5608
  shuffle: (e) => W(e),
5594
5609
  line: (e) => Ce(e),
5595
5610
  line3: (e) => we(e),
5596
- vector: (e) => Q(e),
5597
- point: (e) => new I(Q(e)),
5611
+ vector: (e) => new L(Q(e)),
5612
+ point: (e) => Q(e),
5598
5613
  circle: (e) => Se(e)
5599
5614
  }, Te = {
5600
5615
  Numeric: d,