| title | RADIANS (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/13/2017 | ||
| ms.prod | sql-non-specified | ||
| ms.reviewer | |||
| ms.suite | |||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | e9f69951-ecda-45d9-8909-dcb716b1b1c0 | ||
| caps.latest.revision | 23 | ||
| author | BYHAM | ||
| ms.author | rickbyh | ||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-all_md]
Returns radians when a numeric expression, in degrees, is entered.
Transact-SQL Syntax Conventions
-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse
RADIANS ( numeric_expression )
numeric_expression
Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.
Returns the same type as numeric_expression.
The following example returns a result of 0.0 because the numeric expression to convert to radians is too small for the RADIANS function.
SELECT RADIANS(1e-307)
GO
[!INCLUDEssResult]
-------------------
0.0
(1 row(s) affected)
The following example takes a float expression and returns the RADIANS of the specified angle.
-- First value is -45.01.
DECLARE @angle float
SET @angle = -45.01
SELECT 'The RADIANS of the angle is: ' +
CONVERT(varchar, RADIANS(@angle))
GO
-- Next value is -181.01.
DECLARE @angle float
SET @angle = -181.01
SELECT 'The RADIANS of the angle is: ' +
CONVERT(varchar, RADIANS(@angle))
GO
-- Next value is 0.00.
DECLARE @angle float
SET @angle = 0.00
SELECT 'The RADIANS of the angle is: ' +
CONVERT(varchar, RADIANS(@angle))
GO
-- Next value is 0.1472738.
DECLARE @angle float
SET @angle = 0.1472738
SELECT 'The RADIANS of the angle is: ' +
CONVERT(varchar, RADIANS(@angle))
GO
-- Last value is 197.1099392.
DECLARE @angle float
SET @angle = 197.1099392
SELECT 'The RADIANS of the angle is: ' +
CONVERT(varchar, RADIANS(@angle))
GO
[!INCLUDEssResult]
---------------------------------------
The RADIANS of the angle is: -0.785573
(1 row(s) affected)
---------------------------------------
The RADIANS of the angle is: -3.15922
(1 row(s) affected)
---------------------------------------
The RADIANS of the angle is: 0
(1 row(s) affected)
---------------------------------------
The RADIANS of the angle is: 0.00257041
(1 row(s) affected)
---------------------------------------
The RADIANS of the angle is: 3.44022
(1 row(s) affected)
The following example returns a result of 0.0 because the numeric expression to convert to radians is too small for the RADIANS function.
SELECT RADIANS(1e-307)
GO
[!INCLUDEssResult]
-------------------
0.0
(1 row(s) affected)
CAST and CONVERT (Transact-SQL)
decimal and numeric (Transact-SQL)
float and real (Transact-SQL)
int, bigint, smallint, and tinyint (Transact-SQL)
Mathematical Functions (Transact-SQL)
money and smallmoney (Transact-SQL)