SQLite ATAN() Function
The SQLite ATAN() function returns arc tangent of a number x.
Syntax
ATAN(x)
Parameters
x |
Required. Specify the number used to calculate the arc tangent. |
Return Value
Returns the arc tangent of a number.
Example 1:
The example below shows the usage of ATAN() function.
SELECT ATAN(3); Result: 1.24904577239825 SELECT ATAN(0.5); Result: 0.463647609000806 SELECT ATAN(0); Result: 0.0 SELECT ATAN(-0.5); Result: -0.463647609000806 SELECT ATAN(-3); Result: -1.24904577239825
Example 2:
Consider a database table called Sample with the following records:
Data | x |
---|---|
Data 1 | -1 |
Data 2 | -0.5 |
Data 3 | 0 |
Data 4 | 0.5 |
Data 5 | 1 |
The statement given below can be used to calculate the arc tangent of records of column x.
SELECT *, ATAN(x) AS ATAN_Value FROM Sample;
This will produce the result as shown below:
Data | x | ATAN_Value |
---|---|---|
Data 1 | -1 | -0.785398163397448 |
Data 2 | -0.5 | -0.463647609000806 |
Data 3 | 0 | 0.0 |
Data 4 | 0.5 | 0.463647609000806 |
Data 5 | 1 | 0.785398163397448 |
❮ SQLite Functions