What is Math.Asin() in C#?
C# has a built-in Math class that provides useful mathematical functions and operations. The Math class has the Asin() function, which is used to compute the angle whose sine comes out to be a specified number.
This is also known as the inverse sine of a specified number.
Syntax
public static double Asin (double value);
Parameters
-
value:valueis of theDoubletype and represents the input value, which is determined by findingAsin(). Its range must be:- -1 <= value <= 1
Return value
-
Double:Asin()returns an angle Θ measured in radians, and of typeDouble, whose sine isvalue.- -π/2 <= Θ <= π/2 (radians)
It is true only for a valid range of
value. -
NaN:Asin()returnsNaNtype for an invalid range ofvalue.
Radians can be converted into degrees by multiplying radians by 180/Math.PI.
Example
using System;class Educative{static void Main(){Double result = Math.Asin(0);System.Console.WriteLine("Asin(0) = "+ result + " radians");Double result1 = Math.Asin(1);System.Console.WriteLine("Asin(1) = "+ result1 + " radians");Double result2 = Math.Asin(-1);System.Console.WriteLine("Asin(-1) = "+ result2 + " radians");Double result3 = Math.Asin(2);System.Console.WriteLine("Asin(2) = "+ result3);}}