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
radians | → | sine_output |
---|---|---|
1.5707963267948966 | 1.0 | |
0.0 | 0.0 | |
NaN | NaN | |
Infinity | NaN | |
-Infinity | NaN | |
null | null |
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
radians | → | cosine_output |
---|---|---|
3.141592653589793 | -1.0 | |
0.0 | 1.0 | |
NaN | NaN | |
Infinity | NaN | |
-Infinity | NaN | |
null | null |
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
input | → | tan_output |
---|---|---|
0.0 | 0.0 | |
Infinity | NaN | |
-Infinity | NaN | |
NaN | NaN | |
null | null |
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
input | → | arcsine_output |
---|---|---|
1.0 | 1.5707963267948966 | |
20.0 | NaN | |
0.0 | 0.0 | |
Infinity | NaN | |
-Infinity | NaN | |
null | null |
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
input | → | arccosine_output |
---|---|---|
1.0 | 0.0 | |
0.0 | 1.5707963267948966 | |
Infinity | NaN | |
-Infinity | NaN | |
null | null |
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
input | → | arctan_output |
---|---|---|
0.0 | 0.0 | |
1.0 | 0.7853981633974483 | |
NaN | NaN | |
null | null |
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
y | x | → | arctan2_output |
---|---|---|---|
0.0 | 0.0 | 0.0 | |
0.0 | Infinity | 0.0 | |
0.0 | -Infinity | 3.141592653589793 | |
NaN | 0.0 | NaN | |
null | 0.0 | null |
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
radians | → | degrees |
---|---|---|
0.0 | 0.0 | |
3.141592653589793 | 180.0 | |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
null | null |
MATH.RADIANS
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
degrees | → | radians |
---|---|---|
0.0 | 0.0 | |
180.0 | 3.141592653589793 | |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
null | null |
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
input | → | naturalLog |
---|---|---|
0.0 | -Infinity | |
1.0 | 0 | |
2.718281828459045 | 1 | |
Infinity | Infinity | |
-Infinity | NaN | |
-1.0 | NaN | |
NaN | NaN | |
null | null |
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
input | → | log |
---|---|---|
0.0 | -Infinity | |
1.0 | 0 | |
10 | 1 | |
1000 | 3 | |
Infinity | Infinity | |
-Infinity | NaN | |
-1.0 | NaN | |
NaN | NaN | |
null | null |
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
input | base | → | log |
---|---|---|---|
0.0 | 0 | NaN | |
1.0 | 1 | NaN | |
10 | 10 | 1 | |
10000 | 100 | 2 | |
Infinity | 2 | Infinity | |
-Infinity | 4 | NaN | |
-1.0 | 10 | NaN | |
NaN | NaN | NaN | |
null | 10 | null | |
10 | null | null | |
null | null | null |
Updated about 3 years ago