SQL Tutorial SQL Advanced SQL Database SQL References

Oracle - ATAN() Function



The Oracle (PL/SQL) ATAN() function returns arc tangent of a value. The returned value will be in the range -𝜋/2 through 𝜋/2.

Note: ATAN() is the inverse of TAN().

Syntax

ATAN(x)

Parameters

x Required. Specify the value.

Return Value

Returns the arc tangent of the value.

Example 1:

The example below shows the usage of ATAN() function.

ATAN(3)
Result: 1.24904577239825442582991707728109012307

ATAN(0.5)
Result: .4636476090008061162142562314612144020295

ATAN(0)
Result: 0

ATAN(-0.5)
Result: -.4636476090008061162142562314612144020295

ATAN(-3)
Result: -1.24904577239825442582991707728109012307

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 1-1
Data 2-0.5
Data 30
Data 40.5
Data 51

The statement given below can be used to calculate the arc tangent of records of column x.

SELECT Sample.*, 
ATAN(x) AS ATAN_Value 
FROM Sample;

This will produce the result as shown below:

DataxATAN_Value
Data 1-1-.7853981633974483096156608458198757210456
Data 2-0.5-.4636476090008061162142562314612144020295
Data 300
Data 40.5.4636476090008061162142562314612144020295
Data 51.7853981633974483096156608458198757210456

❮ Oracle Functions