From ff36b754cb626f9250794e94d89b429f84e95c29 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 4 Nov 2022 13:53:28 +0000 Subject: [PATCH] Fix atrig functions --- core/math/math.odin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/math/math.odin b/core/math/math.odin index 7687d65ef..e2249dcb9 100644 --- a/core/math/math.odin +++ b/core/math/math.odin @@ -1385,15 +1385,15 @@ atan2 :: proc{ } atan :: proc "contextless" (x: $T) -> T where intrinsics.type_is_float(T) { - return atan2(x, 1) + return atan2(1, x) } asin :: proc "contextless" (x: $T) -> T where intrinsics.type_is_float(T) { - return atan2(x, sqrt(1 - x*x)) + return atan2(sqrt(1 - x*x), x) } acos :: proc "contextless" (x: $T) -> T where intrinsics.type_is_float(T) { - return 2 * atan2(sqrt(1 - x), sqrt(1 + x)) + return 2 * atan2(sqrt(1 + x), sqrt(1 - x)) } sinh :: proc "contextless" (x: $T) -> T where intrinsics.type_is_float(T) {