* Vector addition * * @param vector The vector to be added. * @returns The sum-vector.
(vector)
| 64 | * @returns The sum-vector. |
| 65 | */ |
| 66 | add(vector) { |
| 67 | const x = this.x + vector.x |
| 68 | const y = this.y + vector.y |
| 69 | return new Vector2(x, y) |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Vector subtraction |