From 7b8f3565dd186a539ab8f9caca83a9068368c656 Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 6 Oct 2023 23:41:52 +0200 Subject: [PATCH] now using absolute values for vsqrmagnitudef --- src/vmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmath.h b/src/vmath.h index 58d6ed1..87749c3 100644 --- a/src/vmath.h +++ b/src/vmath.h @@ -75,7 +75,7 @@ float vmagnitudef(Vector a) { } static inline float vsqrmagnitudef(Vector a) { - return a.x*a.x + a.y*a.y; + return fabsf(a.x*a.x) + fabsf(a.y*a.y); } static inline Vector vnormalizedf(Vector a) {