X-Git-Url: http://git.localhorst.tv/?p=space.git;a=blobdiff_plain;f=src%2Fgraphics%2FVector.h;fp=src%2Fgraphics%2FVector.h;h=97dfd4ac70662c4a22eada8982bb116fbc8f89b3;hp=4cf920bd70b8a6eaeafb8f9f75ab04ce1570ace7;hb=501ffe20da16eaab69e668871001f735697c4a42;hpb=1cb5ed22d7772abe6f9893be90f26f46dbde39f7 diff --git a/src/graphics/Vector.h b/src/graphics/Vector.h index 4cf920b..97dfd4a 100644 --- a/src/graphics/Vector.h +++ b/src/graphics/Vector.h @@ -154,6 +154,10 @@ template constexpr Scalar Length(Vector v) { return std::sqrt(Dot(v, v)); } +template +constexpr Vector Norm(Vector v) { + return v / Length(v); +} template constexpr Vector Rotate90(Vector v) {