C# Finding the Sine of an Angle

You can use the Sin() function of the Math class to find the sine value in C#.

This function takes radians as a parameter and returns you the sine value..

If you have an angle, you should convert it to radians like this...

radian = angle * (pi number /180);

An example of how the function is used is given below.

namespace ConsoleApplicationTest
{
    class Program {

        static void Main(string[] args) {

            double a = 30;
            double radian = a * (Math.PI / 180);
            double sin = Math.Sin(radian);
                       
            Console.WriteLine(sin);
            
            Console.ReadLine();
        }
    }
}

To find the sine of angle 30, we first converted it to radians. Then we send it to the function as a parameter. The result returns us as "0.5".



You May Interest

How to Find the Name of the Operating System in C# ?

C# How To Find The Average Of 10 Numbers Using A While Loop

C# Getting Today's Date

Finding the Index Order of a Character in a String in C#

Splitting a String By Desired Character in C#