C# .Asin()

Anonymous contributor's avatar
Anonymous contributor
Published Mar 15, 2023Updated Nov 7, 2024
Contribute to Docs

The Math.Asin() method computes an angle in radians whose sine is a specified number. In Math, this is known as the inverse sine function.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn Microsoft's popular C# programming language, used to make websites, mobile apps, video games, VR, and more.
    • Beginner Friendly.
      15 hours

Syntax

Math.Asin(value);

value is the input value of type double, which must be in the range -1 <= value <= 1.

Returns an angle measured in radians, of type double, whose sine is value. If an invalid value is passed to the function, or no value is passed at all, NaN is returned.

Example

The following example prints the results of the Math.Asin() method for three different values:

using System;
public class Example
{
static void Main()
{
double a = Math.Asin(0.5);
double b = Math.Asin(1);
double c = Math.Asin(-2);
Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine(c);
}
}

This results in the following output:

0.523598775598299
1.5707963267949
NaN

Codebyte Example

Code
Output
Loading...

All contributors

Contribute to Docs

Learn C# on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn Microsoft's popular C# programming language, used to make websites, mobile apps, video games, VR, and more.
    • Beginner Friendly.
      15 hours