COS (Transact-SQL)

Applies to: yesSQL Server (all supported versions) YesAzure SQL Database YesAzure SQL Managed Instance yesAzure Synapse Analytics yesParallel Data Warehouse

A mathematical function that returns the trigonometric cosine of the specified angle - measured in radians - in the specified expression.

Topic link icon Transact-SQL Syntax Conventions


COS ( float_expression )  


To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.


An expression of type float.

Return types



This example returns the COS value of the specified angle:

  DECLARE @angle FLOAT;  
SET @angle = 14.78;  
SELECT 'The COS of the angle is: ' + CONVERT(VARCHAR,COS(@angle));  

Here is the result set.

The COS of the angle is: -0.599465                        
(1 row(s) affected)  

Azure Synapse Analytics (SQL Data Warehouse) and Parallel Data Warehouse

This example returns the COS values of the specified angles:

SELECT COS(14.76) AS cosCalc1, COS(-0.1472738) AS cosCalc2;   

Here is the result set.

cosCalc1  cosCalc2
--------  --------
-0.58     0.99

See also

Mathematical Functions (Transact-SQL)