How to get the arcsine (in radians) of a number in JavaScript?

JavascriptWeb DevelopmentFront End Technology

To get the arcsine of a number in radians, use the asin() method. This method returns the arcsine in radians of a number. The asin method returns a numeric value between -pi/2 and pi/2 radians for x between -1 and 1. If the value of a number is outside this range, it returns NaN.


You can try to run the following code to get the arcsine of a number −

      <title>JavaScript Math asin() Method</title>


         var value = Math.asin(-1);
         document.write("First Value: " + value );

         value = Math.asin(null);
         document.write("<br />Second Value: " + value );

         value = Math.asin(30);
         document.write("<br />Third Value: " + value );

         value = Math.asin("Demo Text");
         document.write("<br />Fourth Value: " + value );

Updated on 19-Jun-2020 07:25:34