Thursday, November 20, 2025
HomeLanguagesJavascriptJavaScript Math acos() Method

JavaScript Math acos() Method

The Javascript Math.acos( ) method is used to return the arccosine of a number in radians. The Math.acos() method returns a numeric value between 0 and pi radians. The Math acos() is a static method of Math, therefore, it is always used as Math.acos(), rather than as a method of a Math object created.

Math.acos(x)=arccos(x)=unique y, where y belongs to [0;pi] such that cos(y)=x

Syntax:

Math.acos(value)

Parameters: This function accepts a single parameter as mentioned above and described below:

  • Value: It is a number in radians whose arccosine you want to find.

Return value: The Math.acos() function returns the arccosine of the given number in radians. 

The below examples illustrate the Math acos( ) method in JavaScript:

Example 1: When 1 is passed as a parameter.

javascript




console.log("When 1 is passed as a parameter: "
    + Math.acos(1));


Output:

When 1 is  passed as a parameter: 0

Example 2: When -1 is passed as a parameter.

javascript




console.log("When -1 is passed as a parameter: "
    + Math.acos(-1));


Output:

When 1 is  passed as a parameter: 3.141592653589793

Example 3: When 0 is passed as a parameter.

javascript




console.log("When 0 is passed as a parameter: "
    + Math.acos(0));


Output:

When 0 is  passed as a parameter: 1.5707963267948966

Example 4: When 0.5 is passed as a parameter.

javascript




console.log("When 0.5 is  passed as a parameter: "
    + Math.acos(0.5));


Output:

When 0.5 is  passed as a parameter: 1.0471975511965979

Example 5: When 2 is passed as a parameter.

javascript




console.log("When 2 is  passed as a parameter: "
    + Math.acos(2));


Output:

When 2 is  passed as a parameter: NaN

We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article.

Supported Browsers:

  • Google Chrome 1 and above
  • Internet Explorer 3 and above
  • Firefox 1 and above
  • Opera 3 and above
  • Safari 1 and above
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32404 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6775 POSTS0 COMMENTS
Nicole Veronica
11924 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11994 POSTS0 COMMENTS
Shaida Kate Naidoo
6903 POSTS0 COMMENTS
Ted Musemwa
7159 POSTS0 COMMENTS
Thapelo Manthata
6859 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS