How to use atan in JavaScript
In this article, I will explain use of atan() method in JavaScript.
JavaScript atan() Method
Syntax
Example
In the following example show to atan() method returns the arctangent of numbers.
<!DOCTYPE html>
<html>
<body>
<h3 style="background-color:Silver">atan() Method Example</h3>
<p id="demo">Click the button to display the arctangent of the number 1</p>
<button onclick="myFunction()">Click</button>
<script type="text/javascript">
function myFunction() {
document.getElementById("demo").innerHTML = Math.atan(1);
}
</script>
</body>
</html>
|
Output1
Output2
You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here