* calculate the cross product of this vector and the passed one * @param v other vector * @returns Reference to this object for method chaining
(v: Vector3d)
| 345 | * @returns Reference to this object for method chaining |
| 346 | */ |
| 347 | cross(v: Vector3d) { |
| 348 | const ax = this.x; |
| 349 | const ay = this.y; |
| 350 | const az = this.z; |
| 351 | const bx = v.x; |
| 352 | const by = v.y; |
| 353 | const bz = v.z; |
| 354 | |
| 355 | this.x = ay * bz - az * by; |
| 356 | this.y = az * bx - ax * bz; |
| 357 | this.z = ax * by - ay * bx; |
| 358 | |
| 359 | return this; |
| 360 | } |
| 361 | |
| 362 | /** |
| 363 | * return the square length of this vector |
no outgoing calls