COS (Transact-SQL)

THIS TOPIC APPLIES TO: yesSQL Server (starting with 2008)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Is a mathematical function that returns the trigonometric cosine of the specified angle, in radians, in the specified expression.

Topic link icon Transact-SQL Syntax Conventions

Syntax

-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse  

COS ( float_expression )  

Arguments

float_expression
Is an expression of type float.

Return Types

float

Examples

The following example returns the COS of the specific angle.

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

Here is the result set.

The COS of the angle is: -0.599465                        

(1 row(s) affected)  

Examples: Azure SQL Data Warehouse and Parallel Data Warehouse

The following example returns the COS of the specific angle.

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)