


Detailed explanation of the use of acos() method in JavaScript_Basic knowledge
May 16, 2016 pm 03:55 PM This method returns the arc cosine of radians. The ACOS method returns the value of 0 and PI for radians between x-1 and 1. If the number value is outside this range, NaN is returned.
Grammar
Math.acos( x ) ;
Here are the details of the parameters:
- x : a number
Return value:
- Returns the arc cosine of some number of radians.
Example:
<html> <head> <title>JavaScript Math acos() Method</title> </head> <body> <script type="text/javascript"> var value = Math.acos(-1); document.write("First Test Value : " + value ); var value = Math.acos(null); document.write("<br />Second Test Value : " + value ); var value = Math.acos(30); document.write("<br />Third Test Value : " + value ); var value = Math.acos("string"); document.write("<br />Fourth Test Value : " + value ); </script> </body> </html>
This will produce the following results:
First Test Value : 3.141592653589793 Second Test Value : 1.5707963267948965 Third Test Value : NaN Fourth Test Value : NaN

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

How to implement an online reservation system using WebSocket and JavaScript

How to use JavaScript and WebSocket to implement a real-time online ordering system

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

Simple JavaScript Tutorial: How to Get HTTP Status Code

How to get HTTP status code in JavaScript the easy way

How to use insertBefore in javascript
