Function Reference

TAN

Returns the tangent of an angle given in radians.

MySQL 8.1
TAN(angle)

Parameters

angleDOUBLE
Angle in radians

Return value

A floating-point number of any sign

Examples

Tangent of a 45° angle

MySQL 8.1
SELECT TAN(PI() / 4);
TAN(PI() / 4)
0.9999999999999999

Tangent of a right angle

MySQL 8.1
SELECT TAN(PI() / 2);
TAN(PI() / 2)
16331239353195370

Details

To convert degrees to radians, use the RADIANS function: TAN(RADIANS(45)).

The result is approximate: for a right angle you get a very large number instead of an error.

See also

Where to learn