diff options
Diffstat (limited to 'src/Vector.ts')
| -rw-r--r-- | src/Vector.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Vector.ts b/src/Vector.ts index 3cebf6d..2be8e57 100644 --- a/src/Vector.ts +++ b/src/Vector.ts @@ -33,4 +33,8 @@ export class Vector { norm(): number { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } + + negative(): Vector { + return new Vector(-this.x, -this.y, -this.z); + } } |