pimath 0.0.117 → 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 +10 -1
- package/dist/pi.js.map +1 -1
- package/dist/pi.min.js +1 -1
- package/dist/pi.min.js.map +1 -1
- package/esm/maths/geometry/line.js +1 -1
- package/esm/maths/geometry/vector.d.ts +3 -0
- package/esm/maths/geometry/vector.js +9 -0
- package/esm/maths/geometry/vector.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/geometry/line.ts +1 -1
- package/src/maths/geometry/vector.ts +12 -0
package/dist/pi.js
CHANGED
|
@@ -6113,7 +6113,7 @@ class Line {
|
|
|
6113
6113
|
x &= ${(new polynom_1.Polynom(this._OA.x)
|
|
6114
6114
|
.add(new monom_1.Monom(this._d.x).multiply(new monom_1.Monom('k'))))
|
|
6115
6115
|
.reorder('k', true)
|
|
6116
|
-
.tex}
|
|
6116
|
+
.tex}\\\\\
|
|
6117
6117
|
y &= ${(new polynom_1.Polynom(this._OA.y)
|
|
6118
6118
|
.add(new monom_1.Monom(this._d.y).multiply(new monom_1.Monom('k'))))
|
|
6119
6119
|
.reorder('k', true)
|
|
@@ -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
|
/***/ }),
|