pimath 0.0.118 → 0.0.119

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/pi.js CHANGED
@@ -6794,12 +6794,18 @@ class Vector {
6794
6794
  return Vector.scalarProduct(this, V);
6795
6795
  // return this._x.clone().multiply(V.x).add(this._y.clone().multiply(V.y));
6796
6796
  };
6797
+ this.determinantWithVector = (V) => {
6798
+ return Vector.determinant(this, V);
6799
+ };
6797
6800
  this.normal = () => {
6798
6801
  let x = this.x.clone().opposed(), y = this.y.clone();
6799
6802
  this._x = y;
6800
6803
  this._y = x;
6801
6804
  return this;
6802
6805
  };
6806
+ this.isColinearTo = (v) => {
6807
+ return this.determinantWithVector(v).isZero();
6808
+ };
6803
6809
  this.isNormalTo = (v) => {
6804
6810
  return this.scalarProductWithVector(v).isZero();
6805
6811
  };
@@ -6875,6 +6881,9 @@ exports.Vector = Vector;
6875
6881
  Vector.scalarProduct = (v1, v2) => {
6876
6882
  return v1.x.clone().multiply(v2.x).add(v1.y.clone().multiply(v2.y));
6877
6883
  };
6884
+ Vector.determinant = (v1, v2) => {
6885
+ return v1.x.clone().multiply(v2.y).subtract(v1.y.clone().multiply(v2.x));
6886
+ };
6878
6887
 
6879
6888
 
6880
6889
  /***/ }),