From 87ddd29fc6956967e649d7a2afb994ee68af496b Mon Sep 17 00:00:00 2001 From: ncuxonaT Date: Fri, 20 Feb 2026 00:17:56 +0300 Subject: [PATCH] utils: mathlib: fix Atan2Fast --- utils/common/mathlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/common/mathlib.cpp b/utils/common/mathlib.cpp index cafe82dc..cc7a6a4c 100644 --- a/utils/common/mathlib.cpp +++ b/utils/common/mathlib.cpp @@ -227,7 +227,7 @@ float Atan2Fast( float y, float x ) float ydivx = y / x; float res = AcosFast( 1.0f / sqrtf( 1.0f + ydivx * ydivx ) ); - res = ( x >= 0.0f ) ? res : - res; + res = ( ydivx >= 0.0f ) ? res : - res; if( x < 0.0f ) res += (y >= 0.0f) ? M_PI : - M_PI;