Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,945 questions

51,886 answers

573 users

How to use the Math.atan2() function to get the arctangent of the quotient of its arguments in JavaScript

1 Answer

0 votes
document.write("Math.atan2(1, 1) = " + Math.atan2(1, 1) + "<br />");
document.write("Math.atan2(1, -1) = " + Math.atan2(1, -1) + "<br />");
document.write("Math.atan2(-1, 1) = " + Math.atan2(-1, 1) + "<br />");
document.write("Math.atan2(-1, -1) = " + Math.atan2(-1, -1) + "<br />");
document.write("Math.atan2(90, 15) = " + Math.atan2(90, 15) + "<br />");
document.write("Math.atan2(15, 90) = " + Math.atan2(15, 90) + "<br />");
document.write("Math.atan2(0, -0) = " + Math.atan2(0, -0) + "<br />");
document.write("Math.atan2(0, 0) = " + Math.atan2(0, 0) + "<br />");
document.write("Math.atan2(Infinity, -Infinity) = " + Math.atan2(Infinity, -Infinity) + "<br />");

 
/*
run

Math.atan2(1, 1) = 0.7853981633974483
Math.atan2(1, -1) = 2.356194490192345
Math.atan2(-1, 1) = -0.7853981633974483
Math.atan2(-1, -1) = -2.356194490192345
Math.atan2(90, 15) = 1.4056476493802698
Math.atan2(15, 90) = 0.16514867741462683
Math.atan2(0, -0) = 3.141592653589793
Math.atan2(0, 0) = 0
Math.atan2(Infinity, -Infinity) = 2.356194490192345
 
*/

 



answered Aug 1, 2016 by avibootz
...