User GuidesAPI ReferenceRelease NotesEnrichment APIs

Mathematical Functions

Mathematical trigonometric functions calculate the sine, cosine, and tangent of angles in radians.

MATH.SIN

Returns the Sine of the input in radians.

SYNTAX

`math.sin(input)`

• `input`
• Type: double
• Description: The attribute to return the sine of

OUTPUT

`double`

EXAMPLE

``````SELECT math.sin(radians) as sine_output
``````
1.57079632679489661.0
0.00.0
NaNNaN
InfinityNaN
-InfinityNaN
nullnull

MATH.COS

Returns the Cosine of the input in radians.

SYNTAX

`math.cos(input)`

• `input`
• Type: double
• Description: The attribute to return the cosine of

OUTPUT

`double`

EXAMPLE

``````SELECT math.cos(radians) as cosine_output
``````
3.141592653589793-1.0
0.01.0
NaNNaN
InfinityNaN
-InfinityNaN
nullnull

MATH.TAN

Returns the trigonometric Tangent of an angle.

SYNTAX

`math.tan(input)`

• `input`
• Type: double
• Description: An angle, in radians

OUTPUT

`double`

EXAMPLE

``````SELECT math.tan(input) as tan_output
``````
inputtan_output
0.00.0
InfinityNaN
-InfinityNaN
NaNNaN
nullnull

MATH.ASIN

Computes the Inverse Sine of the input in radians.

SYNTAX

`math.asin(input)`

• `input`
• Type: double
• Description: The attribute to return the arcsine of

OUTPUT

`double`

EXAMPLE

``````SELECT math.asin(input) as arcsine_output
``````
inputarcsine_output
1.01.5707963267948966
20.0NaN
0.00.0
InfinityNaN
-InfinityNaN
nullnull

MATH.ACOS

Computes the Inverse Cosine of the input in radians.

SYNTAX

`math.acos(input)`

• `input`
• Type: double
• Description: The attribute to return the arccosine of

OUTPUT

`double`

EXAMPLE

``````SELECT math.acos(input) as arccosine_output
``````
inputarccosine_output
1.00.0
0.01.5707963267948966
InfinityNaN
-InfinityNaN
nullnull

MATH.ATAN

Computes the Inverse Tangent of the input in radians.

SYNTAX

`math.atan(input)`

• `input`
• Type: double
• Description: The attribute to return the arctangent of

OUTPUT

`double`

EXAMPLE

``````SELECT math.atan(input) as arctan_output
``````
inputarctan_output
0.00.0
1.00.7853981633974483
NaNNaN
nullnull

MATH.ATAN2

Returns the angle from the conversion of rectangular coordinates to polar coordinates using the Two Argument Arctangent.

SYNTAX

`math.atan2(y, x)`

• `y`
• Type: double
• Description: The y coordinate in the cartesian plane
• `x`
• Type: double
• Description: The x coordinate in the cartesian plane

OUTPUT

`double`

EXAMPLE

``````SELECT math.atan2(y, x) as arctan2_output
``````
yxarctan2_output
0.00.00.0
0.0Infinity0.0
0.0-Infinity3.141592653589793
NaN0.0NaN
null0.0null

MATH.DEGREES

Converts the radian input to degrees.

SYNTAX

`math.degrees(input)`

• `input`
• Type: double
• Description: An angle, in radians

OUTPUT

`double`

EXAMPLE

``````SELECT math.degrees(radians) as degrees
``````
0.00.0
3.141592653589793180.0
InfinityInfinity
-Infinity-Infinity
NaNNaN
nullnull

Converts the degree input to radians.

SYNTAX

`math.radians(input)`

• `input`
• Type: double
• Description: An angle, in degrees

OUTPUT

`double`

EXAMPLE

``````SELECT math.radians(degrees) as radians
``````
0.00.0
180.03.141592653589793
InfinityInfinity
-Infinity-Infinity
NaNNaN
nullnull

MATH.LN

Computes the natural logarithm.

SYNTAX

`math.ln(input)`

• `input`
• Type: double
• Description: The input value

OUTPUT

`double`

EXAMPLE

``````SELECT math.ln(input) as naturalLog
``````
inputnaturalLog
0.0-Infinity
1.00
2.7182818284590451
InfinityInfinity
-InfinityNaN
-1.0NaN
NaNNaN
nullnull

MATH.LOG10

Computes the logarithm with base 10.

SYNTAX

`math.log10(input)`

• `input`
• Type: double
• Description: The input value

OUTPUT

`double`

EXAMPLE

``````SELECT math.log10(input) as log
``````
inputlog
0.0-Infinity
1.00
101
10003
InfinityInfinity
-InfinityNaN
-1.0NaN
NaNNaN
nullnull

MATH.LOG

Computes the logarithm of a value for a specific base.

SYNTAX

`math.log(input, base)`

• `input`
• Type: double
• Description: The input value
• `base`
• Type: double
• Description: The base value

OUTPUT

`double`

EXAMPLE

``````SELECT math.log(input, base) as log
``````
inputbaselog
0.00NaN
1.01NaN
10101
100001002
Infinity2Infinity
-Infinity4NaN
-1.010NaN
NaNNaNNaN
null10null
10nullnull
nullnullnull