MySQL TAN() function

TAN(X) returns the tangent of X, where X is in radians. Near angles where cosine approaches zero, floating-point results can become extremely large rather than representing mathematical infinity exactly.

SELECT ROUND(TAN(PI()), 2); -- Output: -0.00 (floating-point approximation)
SELECT TAN(PI() / 2); -- Very large finite floating-point value
SELECT ROUND(TAN(PI() / 3), 2); -- Output: 1.73

Syntax

SELECT TAN(X);

TAN() with RADIANS()

RADIANS() converts degrees to radians.

SELECT TAN(RADIANS(0)); -- Output: 0
SELECT TAN(RADIANS(45)); -- Output: 1
SELECT TAN(RADIANS(90)); -- Very large finite floating-point value
SELECT ROUND(TAN(RADIANS(180)), 2); -- Output: -0.00



Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer