From 496c63266d02bc9369e3406353b877a8ebbae60a Mon Sep 17 00:00:00 2001 From: James Barnett Date: Mon, 3 Jan 2022 21:09:23 +0000 Subject: Implement refraction --- src/Vector.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Vector.ts') 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); + } } -- cgit v1.2.3