Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-03 |
|
|
PDF · Mobi · ePub |
The COS function calculates the cosine of an angle expression. The result returned by COS is a decimal value with the same dimensions as the specified expression.
DECIMAL
COS(angle-expression)
A numeric expression that contains an angle value, which is specified in radians.
Example 11-27 Calculating the Cosine of an Angle in Radians
This example calculates the cosine of an angle of 1
radian. The statements
DECIMALS = 5 SHOW COS(1)
produce the following result.
0.54030
Example 11-28 Calculating the Cosine of an Angle in Degrees
This example calculates the cosine of an angle of 60 degrees. Since 1 degree = 2 * (pi) / 360
radians, 60 degrees is about 60 * 2 * 3.14159 / 360
radians. The statement
SHOW COS(60 * 2 * 3.14159 / 360)
produces the following result.
0.50000