Skip to content

COS

COS(X)Here, X represents a numeric expression.

Section titled “COS(X)Here, X represents a numeric expression.”
  • x: Represents the angle in radians for which the cosine value is to be calculated.
SELECT COS(PI());
-1.0

The COS function in MySQL returns the cosine of a number. In the provided example, the number used is the mathematical constant PI. The cosine of PI, in mathematics, is -1, therefore, the output of the function is -1.0.