- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
atan2() function in PHP
The atan2() function returns the arc tangent of two variables.
Syntax
atan2(val1, val2)
Parameters
val1 − The dividend
val2 − The divisor
Return
The atan2() function returns the arc tangent of val2/ val1 in radians. The returned value is between -Pi and Pi.
Example
<?php echo(atan2(30,30) . "<br>"); echo(atan2(2,2) . "<br>"); ?>
Output
0.78539816339745<br>0.78539816339745<br>
Example
Let us see another example −
<?php echo(atan2(-15,-15) . "<br>"); echo(atan2(-0.90,-0.70) . "<br>"); ?>
Output
-2.3561944901923<br>-2.2318394956456<br>
Advertisements
To Continue Learning Please Login
Login with Google