This tutorial explains how to use the MySQL COS function with syntax and examples.
The MySQL COS function returns the cosine of a number.
The syntax for the COS function in MySQL is:
COS( number )
The value used to calculate the cosine. It is expressed in radians.
The COS function can be used in the following versions of MySQL:
Let's look at some MySQL COS function examples and explore how to use the COS function in MySQL.
For example:
mysql> SELECT COS(2);
Output: -0.4161468365471424
mysql> SELECT COS(PI());
Output: -1
mysql> SELECT COS(-0.9);
Output: 0.6216099682706644