Open In App

COT() Function in MySQL

Improve
Improve
Like Article
Like
Save
Share
Report

COT() function :
This function in MySQL is used to return the cotangent of a specified number. If the specified number is 0, an error or NULL will be returned. In a right triangle, the cotangent of an angle is the length of it’s adjacent side divided by the length of the opposite side. Similarly, this can also be defined as cotangent of x is the cosine of x divided by the sine of x, where x is the angle.

Syntax :

COT(number)

Parameter :
This method accepts a parameter as given below as follows.

  • number – Specified numeric value.

Returns :
It returns the cotangent of a specified number.

Example-1 :
The cotangent of 1 is 0.6420926159343306.

SELECT COT(1);

Output :

0.6420926159343306

Example-2 :
The cotangent of 0 returns an errors.

SELECT COT(0);

Output :

Error in SQL:
DOUBLE value is out of range in 'cot(0)'

Example-3 :
The cotangent of -3 is 0.6420926159343306.

SELECT COT(-3);

Output :

7.015252551434534

Example-4 :
The cotangent of 3 is -7.015252551434534.

SELECT COT(3);

Output :

-7.015252551434534

Application :
This function is used to return the cotangent of a specified number.


Last Updated : 09 Dec, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads