Calculate the arccosine value using the javascriptacos Method

Source: Internet
Author: User
Tags acos
In javascript, The acos method is used to calculate the arccosine of a value. This function needs to input a value between-1.0 and 1.0. If the input parameter is not in this range, NaN, this article describes how to use the acos function through examples. For more information about the coders, see. The arccosine of the number returned by the acos method.

Basic syntax

Math.acos(number)

Parameter Introduction

The required number parameter is a numeric expression for calculating the arccosine value. It must be the number from-1.0 to 1.0. If the number Parameter exceeds this range, NaN is returned.

Return Value

The return value is the inverse cosine of the number parameter.

Note the following two points:

  1. If the number Parameter exceeds the range from-1.0 to 1.0, NaN is returned.
  2. If the value of the parameter number is-1, the PI is returned.
  3. If the parameter is not a value, NAN is returned.

Instance:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.