JavaScript Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Java-Script Tutorial
Introduction Introduction
Variables Variables
Operators Operators
Statements Statements
Loops Loops
Functions Functions
Objects Objects
Arrays Arrays
Cookies JS Cookies
Browser Objects Browser Objects
Form DOM Form DOM
Style Objects DOM Style Objects
Forums Ask Your Doubts
Scraps More about Javascript
Feedback Feedback
 

Math.asin() Method - Math Functions


Tutorials Javascript

Topic

Math.asin() method of Math Functions in javascript.
How to get the arcsine value of a number in javascript?



Explanation

Object: Math

Method: Math.asin()

Description: To get the arc sine value for a number, we use this function. The function returns a value between -PI/2 till PI/2 radians. The parameter for asin() function should be between -1 and 1, if it exceeds the limit it returns "NaN". The below example will get arcsine values for numbers 4, 0, 1 using Math Functions.

Example:
<script type="text/javascript">
document.write('Arcsine of 4 is::'+Math.asin(4));
document.write('
');
document.write('Arcsine of 0 is::'+Math.asin(0));
document.write('
');
document.write('Arcsine of 1 is::'+Math.asin(1));
</script>

Result:


In the above example,
  • Math.asin() method returns "NaN" for the number 4 as it exceeds the limit.
  • But for "0" the value returned is "0".
  • The arc sine value for 1 returned by Math.asin() method "1.57079".






  • A Note
    Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

    Other Links

    web hosting