Oracle PL/SQL ATAN and ATAN2 function example

摘要: This article show you how to use ATAN() and ATAN2() function in Oracle PL/SQL.

This article show you how to use ATAN() and ATAN2() function in Oracle PL/SQL.

1. ATAN function examples

The ATAN function returns the arc tangent of n, the n can be in an unbounded range. The function will returns a value in the range of -pi/2 to pi/2, expressed in radians.

SELECT ATAN(1.5) FROM DUAL;
-- output
0.9827937232473290679857106110146660144997
SELECT ATAN(50) FROM DUAL;
-- output
1.55079899282174608617056849473815495415
SELECT ATAN(-5) FROM DUAL;
-- output
-1.37340076694501586086127192644496114865
SELECT ATAN(0) FROM DUAL;
-- output

2. ATAN2 function examples

The ATAN2 function returns the arc tangent of n1 and n2, both n1 and n2 can be in an unbounded range. The function will returns a value in the range of -pi to pi, depending on the signs of n1 and n2, expressed in radians.

SELECT ATAN2(-1,1) FROM DUAL;
-- output
-0.7853981633974483096156608458198757210546
SELECT ATAN2(50,100) FROM DUAL;
-- output
0.4636476090008061162142562314612144020295
SELECT ATAN2(0,0.5) FROM DUAL;
-- output

References

  1. ATAN Function :- Oracle official docs
  2. ATAN2 Function :- Oracle official docs

上一篇: Oracle PL/SQL ALTER function example
下一篇: Oracle PL/SQL CEIL function example
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号