ATAN(X) returns the arc tangent of X in radians.
SELECT ATAN(0); -- Output: 0
SELECT ATAN(1); -- Output: 0.785398163397448
SELECT ATAN(-2); -- Output: -1.10714871779409
SELECT ROUND(ATAN(-2), 2); -- Output: -1.11
Use DEGREES() to convert radians to degrees.
SELECT DEGREES(ATAN(0)); -- Output: 0
SELECT DEGREES(ATAN(1)); -- Output: 45
SELECT DEGREES(ATAN(-1)); -- Output: -45
SELECT ATAN(X);
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.