githubEdit

Trigonometric Functions

Pinot provides standard trigonometric functions that operate on double values. Angles are expressed in radians unless otherwise noted. Use the radians() function to convert degrees to radians before passing values to trigonometric functions.

sin

sin(col)

Returns the sine of the given angle (in radians).

SELECT sin(radians(30))
FROM myTable
-- Returns 0.49999999999999994

cos

cos(col)

Returns the cosine of the given angle (in radians).

SELECT cos(radians(60))
FROM myTable
-- Returns 0.5000000000000001

tan

tan(col)

Returns the tangent of the given angle (in radians).

cot

Returns the cotangent of the given angle (in radians), computed as 1 / tan(col).

asin

Returns the arc sine of a value, in radians. The input must be between -1 and 1.

acos

Returns the arc cosine of a value, in radians. The input must be between -1 and 1.

atan

Returns the arc tangent of a value, in radians.

atan2

Returns the angle in radians between the positive x-axis and the point (x, y), using the signs of both arguments to determine the quadrant.

sinh

Returns the hyperbolic sine of the given value.

cosh

Returns the hyperbolic cosine of the given value.

tanh

Returns the hyperbolic tangent of the given value.

degrees

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

radians

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Last updated

Was this helpful?