TAN | Syntax: | TAN(Number) | Return value: | FLOAT | Function type: | Numeric function | |
|
|
The TAN() function returns the tangent value of "Number", where "Number" is in radians.
SIN() returns NULL if the value of "Number" is NULL.
The RADIANS() function can also be used to calculate a tangent from an angle value. |
SQL Examples for the TAN function |
|
select radians(45);
select tan(0.7853981633974483);
select tan(radians(45));
select tan(radians(-45));
select round(tan(radians(90)),2);
select round(tan(radians(180)),16);
select round(tan(radians(270)),2);
select round(tan(radians(360)),16);
|
|
radians(45) |
double(23) |
0.7853981633974483 |
|
|
tan(0.7853981633974483) |
double(23) |
0.9999999999999999 |
|
|
tan(radians(45)) |
double(23) |
0.9999999999999999 |
|
|
tan(radians(-45)) |
double(23) |
-0.9999999999999999 |
|
|
round(tan(radians(90)),2) |
double(19) |
16331239353195368.00 |
|
|
round(tan(radians(180)),16) |
double(33) |
-0.0000000000000001 |
|
|
round(tan(radians(270)),2) |
double(19) |
5443746451065123.00 |
|
|
round(tan(radians(360)),16) |
double(33) |
-0.0000000000000002 |
|
|
|
The examples were created with the MyWAY SQL manager: |
How to use the TAN() function in MySQL and MariaDB databases |
The TAN() function in MySQL and MariaDB takes an angle in radians as input. A radian is equal to the angle subtended at the center of a circle by an arc whose length is equal to the radius of the circle. The function can be used in conjunction with other mathematical functions and operators to perform more complex calculations involving trigonometric operations. |
|
Further MySQL und MariaDB SQL Numeric functions |
|