//[MenuItem("LockstepEngine/Math/TestATan2")] static void TestATan2() { StringBuilder sb = new StringBuilder(); var v1 = Mathf.Atan2(1, 1); var v2 = Mathf.Atan2(1, -1); var v3 = Mathf.Atan2(-1, -1); var v4 = Mathf.Atan2(-1, 1); int testSize = 100; for (int y = -testSize; y < testSize; y++) { for (int x = -testSize; x < testSize; x++) { var rawVal = Mathf.Atan2(y, x); var myVal = new LFloat(true, LMath._Atan2(y, x)).ToFloat(); var diff = rawVal - myVal; if (diff > 0.01f) { sb.AppendLine($"y:{y} x:{x} diff:{diff}"); } } } UnityEngine.Debug.Log(sb.ToString()); }