fix asin & acos swapped

This commit is contained in:
jacob 2024-08-05 00:24:00 -05:00
parent c25afa72b9
commit 630afc411b

View File

@ -463,13 +463,13 @@ INLINE f32 math_atan2(f32 y, f32 x) {
INLINE f32 math_asin(f32 x) INLINE f32 math_asin(f32 x)
{ {
/* TODO: Dedicated arcsin approximation */ /* TODO: Dedicated arcsin approximation */
return (PI / 2.0f) - math_atan2(x, math_sqrt(1.0f - (x*x))); return math_atan2(x, math_sqrt(1.0f - (x * x)));
} }
INLINE f32 math_acos(f32 x) INLINE f32 math_acos(f32 x)
{ {
/* TODO: Dedicated arccos approximation */ /* TODO: Dedicated arccos approximation */
return math_atan2(x, math_sqrt(1.0f - (x*x))); return (PI / 2.0f) - math_atan2(x, math_sqrt(1.0f - (x * x)));
} }
/* ========================== * /* ========================== *