* Vector scalar multiplication * * @param scalar The factor by which to multiply the vector. * @returns The scaled vector.
(scalar)
| 88 | * @returns The scaled vector. |
| 89 | */ |
| 90 | multiply(scalar) { |
| 91 | const x = this.x * scalar |
| 92 | const y = this.y * scalar |
| 93 | return new Vector2(x, y) |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Distance between this vector and another vector. |