{"ScriptPreparationCode":"function rand(min, max) {\r\n return Math.floor(Math.random() * (max - min \u002B 1)) \u002B min;\r\n}\r\n\r\nfunction angle(x, y) {\r\n let result = Math.atan(y / x);\r\n if (x \u003C 0) {\r\n result \u002B= Math.PI;\r\n } else if (y \u003C 0) {\r\n result \u002B= 2 * Math.PI;\r\n }\r\n return result;\r\n}\r\n\r\nfunction angle2(x, y) {\r\n if (x == 0)\r\n return (y == 0) ? 0 : (y \u003E 0 ? Math.PI/2 : -Math.PI/2)\r\n \r\n var atan_xy = Math.atan(y / x)\r\n if (x \u003E 0)\r\n return atan_xy\r\n else // x \u003C 0\r\n return atan_xy \u002B (y \u003C 0 ? -Math.PI : Math.PI)\r\n}","TestCases":[{"Name":"native","Code":"var xO = rand(1, 1000);\r\nvar yO = rand(1, 1000);\r\n\r\nMath.atan(yO, xO);","IsDeferred":false},{"Name":"alt","Code":"var xT = rand(1, 1000);\r\nvar yT = rand(1, 1000);\r\n\r\nangle(xT, yT);","IsDeferred":false},{"Name":"alt2","Code":"var xD = rand(1, 1000);\r\nvar yD = rand(1, 1000);\r\n\r\nangle2(xD, yD);","IsDeferred":false}]}