Facebook Page Twitter Page LinkedIn Page
× C# Tutorial C# Advanced C# Resources


The C# Math Sin() method returns trigonometric sine of an angle (angle should be in radians). In special cases it returns the following:

  • If the argument is NaN, NegativeInfinity or PositiveInfinity, the method returns NaN.

Syntax

public static double Sin (double arg);

Parameters

arg Specify the angle in radian.

Return Value

Returns the trigonometric sine of an angle.

Example:

In the below example, Sin() method is used to find out the trigonometric sine of an angle.

using System;

class MyProgram {
  static void Main(string[] args) {
   double pi = Math.PI;
   Console.WriteLine(Math.Sin(pi/6));
   Console.WriteLine(Math.Sin(pi/4));
   Console.WriteLine(Math.Sin(pi/3));
  }
}

The output of the above code will be:

0.5
0.707106781186547
0.866025403784439

❮ C# Math Methods