From 5af174eceebb5ba139d09de29400def1f38e70ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Tue, 5 Sep 2023 23:15:48 +0200 Subject: [PATCH] ScriptCore: atan2 --- ScriptCore/Math/Math.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ScriptCore/Math/Math.cs b/ScriptCore/Math/Math.cs index fead2a7..6d548c7 100644 --- a/ScriptCore/Math/Math.cs +++ b/ScriptCore/Math/Math.cs @@ -838,4 +838,24 @@ public static class Math // transpose und determinante für Matrizen // sin, cos, tan, asin, acos, atan, atan2, cosh, sinh, tanh + + public static float atan2(float y, float x) + { + return (float)System.Math.Atan2(y, x); + } + + public static float2 atan2(float2 y, float2 x) + { + return new float2((float)System.Math.Atan2(y.X, x.X), (float)System.Math.Atan2(y.Y, x.Y)); + } + + public static float3 atan2(float3 y, float3 x) + { + return new float3((float)System.Math.Atan2(y.X, x.X), (float)System.Math.Atan2(y.Y, x.Y), (float)System.Math.Atan2(y.Z, x.Z)); + } + + public static float4 atan2(float4 y, float4 x) + { + return new float4((float)System.Math.Atan2(y.X, x.X), (float)System.Math.Atan2(y.Y, x.Y), (float)System.Math.Atan2(y.Z, x.Z), (float)System.Math.Atan2(y.W, x.W)); + } }