|
@@ -110,6 +110,20 @@ export class Vector3
|
110
|
110
|
}
|
111
|
111
|
|
112
|
112
|
/**
|
|
113
|
+ * The cross product of this and v
|
|
114
|
+ * @param v a vector
|
|
115
|
+ * @returns the cross product this x v
|
|
116
|
+ */
|
|
117
|
+ cross(v: Vector3): Vector3
|
|
118
|
+ {
|
|
119
|
+ const x = this.y * v.z - this.z * v.y;
|
|
120
|
+ const y = this.z * v.x - this.x * v.z;
|
|
121
|
+ const z = this.x * v.y - this.y * v.x;
|
|
122
|
+
|
|
123
|
+ return new Vector3(x, y, z);
|
|
124
|
+ }
|
|
125
|
+
|
|
126
|
+ /**
|
113
|
127
|
* Check if this and v have the same coordinates
|
114
|
128
|
* @param v a vector
|
115
|
129
|
* @returns true if this and v have the same coordinates
|