8.2.9 RADIANS
Returns the result of converting the specified angle from degrees to radians.
- Organization of this subsection
(1) Specification format
scalar-function-RADIANS ::= RADIANS(angle) angle ::= value-expression
(2) Explanation of specification format
- angle:
-
Specifies the angle in degrees.
The following rules apply:
-
Specify the angle in the form of a value expression. For details about value expressions, see 7.20 Value expression.
-
Specify numeric data for the angle. For details about numeric data, see (1) Numeric data in 6.2.1 List of data types.
-
You cannot specify a dynamic parameter by itself for the angle.
-
(3) Rules
-
The data type of the execution result is the DOUBLE PRECISION type.
-
The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).
-
If the angle has a null value, the execution result will be a null value.
(4) Examples
- Example 1:
-
Convert the values (angles) in columns C1 through C3 from table T1 to radians.
SELECT RADIANS("C1"),RADIANS("C2"),RADIANS("C3") FROM "T1"
- Example 2:
-
Determine the cosine of the value (angle) in column C1 from table T1.
Because the value in C1 is in degrees, the scalar function RADIANS is used to convert the angle from degrees to radians, and then the scalar function COS is used to determine the cosine.
SELECT COS(RADIANS("C1")) FROM "T1"
In this example, the calculation is COS(60), but the target data specified in the scalar function COS must be specified in radians.