Home / InterSystems SQL Reference / SQL Functions / RADIANS

InterSystems SQL Reference
Previous section           Next section
InterSystems: The power behind what matters   

A numeric function that converts degrees to radians.

{fn RADIANS(numeric-expression)}
numeric-expression The measure of an angle in degrees. An expression that resolves to a numeric value.
RADIANS returns either the NUMERIC or DOUBLE data type. If numeric-expression is data type DOUBLE, RADIANS returns DOUBLE; otherwise, it returns NUMERIC.
RADIANS can be specified as either a standard scalar function or an ODBC scalar function with curly brace syntax.
RADIANS takes an angle measurement in degrees and returns the corresponding angle measurement in radians. RADIANS returns NULL if passed a NULL value.
The returned value has a default precision of 36 and a default scale of 18.
You can use the DEGREES function to convert radians to degrees.
The following Embedded SQL example returns the radians equivalents corresponding to the degree values from 0 through 365 in 30-degree increments:
   SET a=0
   WHILE a<366 {
   &sql(SELECT RADIANS(:a) INTO :b)
   IF SQLCODE'=0 {
     WRITE !,"Error code ",SQLCODE
     QUIT }
   ELSE {
     WRITE !,"degrees ",a," = radians ",b
     SET a=a+30 }
See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-07-19 06:48:23