* Substracts a vector or number from this vector. * @param {Vector | number} a: Vector or number to subtract * @returns {Vector} New vector
(v: Vector | number)
| 49 | * @returns {Vector} New vector |
| 50 | */ |
| 51 | subtract(v: Vector | number) { |
| 52 | if (v instanceof Vector) return new Vector(this.x - v.x, this.y - v.y, this.z - v.z); |
| 53 | else return new Vector(this.x - v, this.y - v, this.z - v); |
| 54 | } |
| 55 | /** |
| 56 | * Multiplies a vector or a number to a vector. |
| 57 | * @param {Vector | number} a: Vector or number to multiply |
no outgoing calls
no test coverage detected