SQLite SIN() Function
The SQLite SIN() function returns trigonometric sine of an angle (angle should be in radians).
Syntax
SIN(x)
Parameters
x |
Required. Specify the angle in radian. |
Return Value
Returns the trigonometric sine of an angle.
Example 1:
The example below shows the usage of SIN() function.
SELECT SIN(0); Result: 0.0 SELECT SIN(1); Result: 0.841470984807897 SELECT SIN(-1); Result: -0.841470984807897 SELECT SIN(2); Result: 0.909297426825682 SELECT SIN(-2); Result: -0.909297426825682 SELECT SIN(PI()); Result: 1.22464679914735e-16
Example 2:
Consider a database table called Sample with the following records:
Data | x |
---|---|
Data 1 | -10 |
Data 2 | -5 |
Data 3 | 0 |
Data 4 | 5 |
Data 5 | 10 |
The statement given below can be used to calculate the trigonometric sine value of column x.
SELECT *, SIN(x) AS SIN_Value FROM Sample;
This will produce the result as shown below:
Data | x | SIN_Value |
---|---|---|
Data 1 | -10 | 0.54402111088937 |
Data 2 | -5 | 0.958924274663138 |
Data 3 | 0 | 0.0 |
Data 4 | 5 | -0.958924274663138 |
Data 5 | 10 | -0.54402111088937 |
❮ SQLite Functions