©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMySQLMariaDB

The TAN SQL Function in MySQL and MariaDB - Tangent calculation

TANSyntax:TAN(Number)
Return value:FLOAT
Function type:Numeric function
Function Description

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

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: Download

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.
SYS_GUIDSYSDATESYSTEM_USERTANTIMETIME_FORMATTIME_TO_SEC

Further MySQL und MariaDB SQL Numeric functions

BIT_COUNTBIT_COUNT(Integer)
More about BIT_COUNT Function

CEILCEIL(Number)
More about CEIL Function

CEILINGCEILING(Number)
More about CEILING Function

CRC32CRC32(String)
More about CRC32 Function

CRC32CCRC32C([Parameter], String)

FLOORFLOOR(Number)
More about FLOOR Function

SIGNSIGN(Number)
More about SIGN Function

ABSABS(Number)
More about ABS Function

ACOSACOS(Number)
More about ACOS Function

ASINASIN(Number)
More about ASIN Function

ATANATAN(Number [, Number2])
More about ATAN Function

ATAN2ATAN2(Number [, Number2])
More about ATAN2 Function

COSCOS(Number)
More about COS Function

COTCOT(Number)
More about COT Function

DEGREESDEGREES(Number)
More about DEGREES Function

EXPEXP(Number)
More about EXP Function

LNLN(Number)
More about LN Function

LOGLOG([Base], Number)
More about LOG Function

LOG10LOG10(Number)
More about LOG10 Function

LOG2LOG2(Number)
More about LOG2 Function

MODMOD(Number, Divider)
More about MOD Function

POWPOW(Number, Exponent)
More about POW Function

POWERPOWER(Number, Exponent)
More about POWER Function

PIPI()
More about PI Function

RADIANSRADIANS(Number)
More about RADIANS Function

RANDRAND([Number])
More about RAND Function

ROUNDROUND(Number [, Decimals])
More about ROUND Function

SINSIN(Number)
More about SIN Function

SQRTSQRT(Number)
More about SQRT Function

TRUNCATETRUNCATE(Number, Decimals)
More about TRUNCATE Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the TAN SQL function: mysql.com and mariadb.com and w3schools.com
Updated: 2023-09-24ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer