SIN

Returns the sine value of a numeric expression

Syntax

SIN( expr )

Arguments

Parameter

Description

expr

Numeric expression representing an angle in radians

Returns

Always returns a floating point result of the sine.

Notes

  • The result is in the range [-1, 1].

  • If the input value is NULL, the result is NULL.

Examples

For these examples, consider the following table and contents:

CREATE TABLE trig(f DOUBLE);

INSERT INTO trig VALUES (0), (PI()/12), (PI()/8), (PI()/6)
   , (PI()/4), (PI()/3), (3*PI()/8), (5*PI()/12), (PI()/2);

Sine of π/2 (= 1)

Tip

Use RADIANS to convert degrees to radians

numbers=> SELECT SIN(PI()/2), SIN(RADIANS(90));
sin | sin0
----+-----
  1 |    1

Computing sine for a column, in radians

numbers=> SELECT f, SIN(f) FROM trig;
f      | sin
-------+-------
     0 |      0
0.2618 | 0.2588
0.3927 | 0.3827
0.5236 |    0.5
0.7854 | 0.7071
1.0472 |  0.866
1.1781 | 0.9239
 1.309 | 0.9659
1.5708 |      1