DEGREES
RADIANS
Purpose
DEGREES takes a value specified in radians and converts it to degrees.
RADIANS takes a value specified in degrees and converts it to radians.
Syntax
where:
Syntax element … |
Specifies … |
|||
arg
|
a numeric expression. |
|||
|
ANSI Compliance
This is a Teradata extension to the ANSI SQL:2011 standard.
Result Title
The following table lists the default titles for DEGREES(arg) and RADIANS(arg).
Function |
Title |
DEGREES(arg) |
(5.72957795130823E001*arg) |
RADIANS(arg) |
(1.74532925199433E-002*arg) |
Result Type and Format
Here are the result type and format of DEGREES and RADIANS.
Note: The NULL keyword has a data type of INTEGER.
For information on data type formats, see SQL Data Types and Literals.
Argument Types and Rules
If the argument is not numeric, it is converted to a numeric value, based on implicit type conversion rules. If the argument cannot be converted, an error is reported. For more information on implicit type conversion, see “Implicit Type Conversions” on page 583.
If arg is a character string, it is converted to a numeric value of the FLOAT data type.
If arg is a UDT, the following rules apply:
To define an implicit cast for a UDT, use the CREATE CAST statement and specify the AS ASSIGNMENT clause. For more information on CREATE CAST, see SQL Data Definition Language.
Neither DEGREES nor RADIANS can be applied to the following types of arguments:
Usage Notes
DEGREES and RADIANS are useful when working with trigonometric functions such as SIN and COS, which expect arguments to be specified in radians, and inverse trigonometric functions such as ASIN and ACOS, which return values specified in radians.
Examples
Representative DEGREES and RADIANS function expressions and the results are as follows.
Expression |
Result |
SIN(RADIANS(60.0)) |
8.66025403784439E-001 |
DEGREES(1.0) |
5.72957795130823E 001 |