MathF.Asin() Method in C# with Examples


The MathF.Asin() method in C# is used to return the angle whose sine is a float value argument.

Syntax

Following is the syntax −

public static float Asin (float val);

Above, Val is the float value.

Example

Let us now see an example to implement the MathF.Asin() method −

using System;
public class Demo {
   public static void Main(){
      float val1 = 0.1f;
      float val2 = 8.9f;
      Console.WriteLine("Angle (val1) = "+(MathF.Asin(val1)));
      Console.WriteLine("Angle (val2) = "+(MathF.Asin(val2)));
   }
}

Output

This will produce the following output −

Angle (val1) = 0.1001674
Angle (val2) = NaN

Example

Let us now see another example to implement the MathF.Asin() method −

using System;
public class Demo {
   public static void Main(){
      float val1 = 1.2f;
      float val2 = 45.5f;
      Console.WriteLine("Angle (val1) = "+(MathF.Asin(val1)));
      Console.WriteLine("Angle (val2) = "+(MathF.Asin(val2)));
   }
}

Output

This will produce the following output −

Angle (val1) = NaN
Angle (val2) = NaN

Updated on: 13-Nov-2019

38 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements