Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

COS (Transact-SQL)

Applies to: 👁 Image
SQL Server 👁 Image
Azure SQL Database 👁 Image
Azure SQL Managed Instance 👁 Image
Azure Synapse Analytics 👁 Image
Analytics Platform System (PDW) 👁 Image
SQL analytics endpoint in Microsoft Fabric 👁 Image
Warehouse in Microsoft Fabric 👁 Image
SQL database in Microsoft Fabric

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

👁 Image
Transact-SQL syntax conventions

Syntax

COS ( float_expression ) 

Arguments

float_expression
An expression of type float.

Return types

float

Examples

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)); 
GO 

Here's the result set.

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

Azure Synapse Analytics and Analytics Platform System (PDW)

This example returns the COS values of the specified angles:

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

Here's the result set.

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

See also

Mathematical Functions (Transact-SQL)


Feedback

Was this page helpful?

Additional resources