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,948 questions

51,890 answers

573 users

How to use the Math.atan() function to get the arctangent (in radians) of a number in JavaScript

1 Answer

0 votes
document.write("Math.atan(-1) = " + Math.atan(-1) + "<br />");
document.write("Math.atan(-2) = " + Math.atan(-2) + "<br />");
document.write("Math.atan(1) = " + Math.atan(1) + "<br />");
document.write("Math.atan(2) = " + Math.atan(2) + "<br />");
document.write("Math.atan(0) = " + Math.atan(0) + "<br />");
document.write("Math.atan(0.5) = " + Math.atan(0.5) + "<br />");
document.write("Math.atan(10) = " + Math.atan(10) + "<br />");
document.write("Math.atan(Infinity) = " + Math.atan(Infinity) + "<br />");
document.write("Math.atan(-Infinity) = " + Math.atan(-Infinity) + "<br />");

 
/*
run

Math.atan(-1) = -0.7853981633974483
Math.atan(-2) = -1.1071487177940904
Math.atan(1) = 0.7853981633974483
Math.atan(2) = 1.1071487177940904
Math.atan(0) = 0
Math.atan(0.5) = 0.4636476090008061
Math.atan(10) = 1.4711276743037347
Math.atan(Infinity) = 1.5707963267948965
Math.atan(-Infinity) = -1.5707963267948965
 
*/

 



answered Aug 1, 2016 by avibootz
...