Hitachi

Hitachi Advanced Database SQL Reference


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:

(3) Rules

  1. The data type of the execution result is the DOUBLE PRECISION type.

  2. The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).

  3. 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"

[Figure]

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"

[Figure]

In this example, the calculation is COS(60[Figure]), but the target data specified in the scalar function COS must be specified in radians.