MySQL TAN() Function
The TAN()
function in MySQL calculates the trigonometric tangent of an angle. The input to the function is the angle in radians, and the output is the tangent of that angle.
TAN(): Definition and Usage
The tangent function (tan) is a fundamental trigonometric function frequently used in various mathematical, scientific, and engineering calculations involving angles and triangles. The TAN()
function in MySQL provides a convenient way to perform this computation directly within your SQL queries. The input is an angle in radians, and the output is the tangent of that angle.
Syntax
Syntax
TAN(number)
Parameter Values
Parameter | Description |
---|---|
number |
The angle in radians. This is required and must be a numeric value. |
Examples
Calculating the Tangent of a Positive Number
This example calculates the tangent of 1.75 radians.
Syntax
SELECT TAN(1.75);
Output
-1.02963856809667
Calculating the Tangent of a Negative Number
This example demonstrates calculating the tangent of -3 radians.
Syntax
SELECT TAN(-3);
Output
0.142546543074278