From fa2ca7241cb3452c95794f4520faebd0de170e45 Mon Sep 17 00:00:00 2001 From: Sara Date: Mon, 23 Oct 2023 21:52:44 +0200 Subject: [PATCH] added anglebetween to vmathf --- src/vmath.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vmath.h b/src/vmath.h index 3697372..07e5e02 100644 --- a/src/vmath.h +++ b/src/vmath.h @@ -120,6 +120,10 @@ Vector vrotatef(Vector a, float t) { }; } static inline +float vanglebetweenf(Vector a, Vector b) { + return vdotf(a, b) / (vmagnitudef(a) * vmagnitudef(b)); +} +static inline Vector vprojectf(Vector onto, Vector from) { float dot = vdotf(onto, from); return vmulff(onto, dot);