Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

COS

COS

Returns the cosine of a numeric value (expressed in radians).

Syntax

COS(
numeric_value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. Numeric data expressed in radians (degrees multiplied by pi divided by 180). Passes the values for which you want to calculate a cosine. You can enter any valid transformation expression.

Return Value

Double value.
NULL if a value passed to the function is NULL.

Example

The following expression returns the cosine for all values in the Degrees port:
COS( DEGREES * 3.14159265359 / 180 )
DEGREES   
RETURN VALUE
0
1.0
90
0.0
70
0.342020143325593
30
0.866025403784421
5
0.996194698091745
18
0.951056516295147
89
0.0174524064371813
NULL
NULL
You can perform arithmetic on the values passed to COS before the function calculates the cosine. For example, you can convert the values in the port to radians before calculating the cosine, as follows:
COS( ARCS * 3.14159265359 / 180 )