COS()

Description

The COS() function returns the cosine of input number(given in radians).

Syntax

  1. > COS(number)

Arguments

ArgumentsDescription
numberRequired. Any numeric data type supported now.

Examples

  1. drop table if exists t1;
  2. create table t1(a int,b float);
  3. insert into t1 values(1,3.14159);
  4. insert into t1 values(-1,1.57);
  5. mysql> select cos(a),cos(b) from t1;
  6. +--------------------+----------------------+
  7. | cos(a) | cos(b) |
  8. +--------------------+----------------------+
  9. | 0.5403023058681398 | -0.9999999999967865 |
  10. | 0.5403023058681398 | 0.000796274258662553 |
  11. +--------------------+----------------------+
  12. 2 rows in set (0.01 sec)