The source code to demonstrate the trigonometry angles in radians is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
//C# program to demonstrate the trigonometry Angles
//in radians using Math class
using System;
class Demo
{
static void Main(string[] args)
{
double sinPi3;
double cosPi3;
double tanPi3;
sinPi3 = Math.Sin(Math.PI / 3);
cosPi3 = Math.Cos(Math.PI / 3);
tanPi3 = Math.Tan(Math.PI / 3);
Console.WriteLine("sin (pi/3) = "+ sinPi3);
Console.WriteLine("cos (pi/3) = "+ cosPi3);
Console.WriteLine("tan (pi/3) = "+ tanPi3);
}
}
Output:
sin (pi/3) = 0.866025403784439
cos (pi/3) = 0.5
tan (pi/3) = 1.73205080756888
Press any key to continue . . .
Explanation:
Here, we created a Demo class that contains the Main() method. In the Main() method, we created three variables of double type.
In the above code we calculated the trigonometry angles based radians using predefined method of Math class, and then print the result on the console screen.
Program:
The source code to demonstrate the trigonometry angles in radians is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
Here, we created a Demo class that contains the Main() method. In the Main() method, we created three variables of double type.
In the above code we calculated the trigonometry angles based radians using predefined method of Math class, and then print the result on the console screen.