C# Math Asin() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Math

Definition

In C#, Math.Asin(d) is the inverse of sine (arcsine). You give it a number between -1 and 1, and it returns the angle in radians whose sine is that number. Math.Asin(1) is Math.PI / 2, a quarter turn.

If Sin() answers "how high is the clock hand at this angle?", Asin answers "which angle gives this height?". The answer is always between -Math.PI / 2 and Math.PI / 2 (-90 to 90 degrees), so it cannot tell apart two angles with the same sine, such as 30 and 150 degrees. The input must be between -1 and 1, because a sine can never be outside that range.

This is a static member of the static class System.Math. You call it with the class name, such as Math.Asin(...). There is no Math object to create. All the work is done by the method you call, and it never changes your variables. Asin is in every .NET version. It takes a double and returns the angle in radians.

Syntax

Pass a number from -1 to 1. The answer is an angle in radians.

C#
double a = Math.Asin(0);        // 0
double b = Math.Asin(1);        // 1.5707963267948966 (pi / 2)
double c = Math.Asin(0.5);      // 0.5235987755982989 (pi / 6)
double degrees = c * 180 / Math.PI;   // about 30
CallWhat it does
Math.Asin(0)Returns 0.
Math.Asin(1)Returns about 1.5708 (pi / 2, or 90 degrees).
Math.Asin(0.5)Returns about 0.5236 (pi / 6, or 30 degrees).
Math.Asin(1.5)Returns NaN. No angle has a sine of 1.5.

The answer is in radians. To get degrees, multiply by 180 / Math.PI. A tiny error in your input (such as 1.0000000000000002 from earlier calculations) can push it out of range, so clamp it with Math.Clamp(value, -1, 1) when it comes from other maths. The method never throws.

Library declarations
C#
public static double Asin(double d);

Parameters

ParameterDescription
dRequired. A number from -1 to 1 (the sine value).

Return Value

Return ValueDescription
doubleThe angle in radians, from -Math.PI / 2 to Math.PI / 2. NaN if d is below -1, above 1, or NaN.

C# Examples

Example 1 — Asin of Key Values

Print the angle in radians for a few sine values, rounded to 4 decimals.

C#
using System;
using System.Globalization;

class Program {
    static string R(double value) {
        return Math.Round(value, 4).ToString(CultureInfo.InvariantCulture);
    }

    static void Main() {
        Console.WriteLine(R(Math.Asin(0)));
        Console.WriteLine(R(Math.Asin(1)));
        Console.WriteLine(R(Math.Asin(-1)));
        Console.WriteLine(R(Math.Asin(0.5)));
    }
}

How It Works

  1. Sine 0. The angle with a sine of 0 is 0.
  2. Sine 1. The sine reaches 1 at a quarter turn, pi / 2, which is about 1.5708.
  3. Sine -1. The sine is -1 at minus a quarter turn, so the answer is -1.5708. This is the bottom edge of the answer range.
  4. Sine 0.5. The angle is one sixth of a half turn, pi / 6, about 0.5236 radians.

Example 2 — Convert the Answer to Degrees

Multiply the radians by 180 / Math.PI to get degrees, rounded to 2 decimals.

C#
using System;
using System.Globalization;

class Program {
    static string Deg(double radians) {
        return Math.Round(radians * 180 / Math.PI, 2).ToString(CultureInfo.InvariantCulture);
    }

    static void Main() {
        Console.WriteLine(Deg(Math.Asin(0.5)));
        Console.WriteLine(Deg(Math.Asin(1)));
        Console.WriteLine(Deg(Math.Asin(-0.5)));
        Console.WriteLine(Deg(Math.Asin(0.7071067811865476)));
    }
}

How It Works

  1. The helper. Deg turns radians into degrees by multiplying by 180 / Math.PI, then rounds to 2 places.
  2. Sine 0.5 is 30 degrees. The raw value is 30.000000000000004, which rounds cleanly to 30.
  3. Sine 1 and -0.5. A sine of 1 means 90 degrees. A sine of -0.5 means -30 degrees, below the starting line.
  4. About 0.7071. That number is the square root of 2 divided by 2, the sine of 45 degrees, so the answer is 45.

Example 3 — Values Outside -1 to 1

See that values outside the range give NaN, how Clamp protects you, and that Sin undoes Asin.

C#
using System;
using System.Globalization;

class Program {
    static string R(double value) {
        return Math.Round(value, 4).ToString(CultureInfo.InvariantCulture);
    }

    static void Main() {
        Console.WriteLine(Math.Asin(1.5));
        Console.WriteLine(Math.Asin(-2));

        double slightlyOver = 1.0000001;
        Console.WriteLine(R(Math.Asin(Math.Clamp(slightlyOver, -1, 1))));

        Console.WriteLine(R(Math.Sin(Math.Asin(0.3))));
    }
}

How It Works

  1. Too big or too small. A sine can never be 1.5 or -2, so there is no angle to return. Math.Asin gives NaN and does not throw.
  2. A value just over 1. Rounding in earlier maths can produce 1.0000001 instead of 1. Passing that straight to Asin would give NaN.
  3. Clamp first. Math.Clamp(slightlyOver, -1, 1) pulls it back to 1, and Asin then returns 1.5708.
  4. Undoing it. Sin of the angle from Asin(0.3) brings back 0.3. The two methods are inverses.

Frequently Asked Questions

It returns the angle in radians whose sine is the given number. Math.Asin(1) is about 1.5708 (pi / 2). The input must be from -1 to 1.
The input is outside -1 to 1, or it is NaN. A sine can never be outside that range, so no angle exists. Clamp the input first if rounding may push it slightly out of range.
Multiply the answer by 180 / Math.PI. For example Math.Asin(0.5) * 180 / Math.PI is about 30.
From -Math.PI / 2 to Math.PI / 2 radians (-90 to 90 degrees). It cannot return angles beyond that, even if your real angle is larger.
No. Math is a static class, so you call Math.Asin(...) straight on the class name. You cannot write new Math(), and there is no variable to keep.

Next: Asinh()

Return the inverse hyperbolic sine: the number whose Sinh is the input.

Asinh() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful