Delen via


COS (Transact-SQL)

Van toepassing op:SQL ServerAzure SQL DatabaseAzure SQL Managed InstanceAzure Synapse AnalyticsAnalytics Platform System (PDW)SQL Analytics-eindpunt in Microsoft FabricMagazijn in Microsoft FabricSQL-database in Microsoft Fabric

Een wiskundige functie die de trigonometrische cosinus van de gespecificeerde hoek - gemeten in radialen - teruggeeft in de gespecificeerde uitdrukking.

Transact-SQL syntaxis-conventies

Syntaxis

COS ( float_expression )  

Arguments

float_expression
Een uitdrukking van type float.

Retourtypen

float

Voorbeelden

Dit voorbeeld geeft de COS waarde van de gespecificeerde hoek terug:

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

Hier is het resultatenoverzicht.

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

Azure Synapse Analytics and Analytics Platform System (PDW)

Dit voorbeeld geeft de COS-waarden van de opgegeven hoeken terug:

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

Hier is het resultatenoverzicht.

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

Zie ook

Wiskundige functies (Transact-SQL)