Trigonometric functions
This page describes the available functions to assist with performing trigonometric calculations.
Positive and negative infinity values are expressed as 'Infinity'
or
'-Infinity'
in QuestDB.
sin
sin(angleRadians)
returns the trigonometric sine of an angle.
Arguments
angleRadians
is a numeric value indicating the angle in radians.
Return value
Return value type is double
.
Description
Special case: if the argument is NaN
or an infinity, then the result is
Null
.
Examples
SELECT pi()/2 angle, sin(pi()/2) sin;
angle | sin |
---|---|
1.570796326794 | 1 |
cos
cos(angleRadians)
returns the trigonometric cosine of an angle.
Arguments
angleRadians
numeric value for the angle, in radians.
Return value
Return value type is double
.
Description
Special case: if the argument is NaN
or an infinity, then the result is
Null
.
Examples
SELECT pi()/2 angle, cos(pi()/2) cos;
angle | cos |
---|---|
1.570796326794 | 6.123233995736766e-17 |
tan
tan(angleRadians)
returns the trigonometric tangent of an angle.
Arguments
angleRadians
numeric value for the angle, in radians.
Return value
Return value type is double
.
Description
Special case: if the argument is NaN
or an infinity, then the result is
Null
.
Examples
SELECT pi()/2 angle, tan(pi()/2) tan;
angle | tan |
---|---|
1.570796326794 | 16331239353195370 |
cot
cot(angleRadians)
returns the trigonometric cotangent of an angle.
Arguments
angleRadians
numeric value for the angle, in radians.
Return value
Return value type is double
.