Explorar o código

Fix atrig functions

gingerBill %!s(int64=2) %!d(string=hai) anos
pai
achega
ff36b754cb
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      core/math/math.odin

+ 3 - 3
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) {