C# Program to Demonstrate Trigonometry Angles in Degrees

This is a C# Program to illustrate trigonometry angles in degrees.

Problem Description

This C# Program Illustrates Trigonometry Angles in Degrees.

Problem Solution

Here the trigonometric values are calculated in terms of radians and are displayed.

Program/Source Code

Here is source code of the C# Program to Illustrate Trignometry Angles in Degrees. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.

/*
 * C# Program to Illustrate Trignometry Angles in Degrees
 */
using System;
namespace trig
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Trignometric values in Degree");
            Console.WriteLine("sin (60)     = {0}", Math.Sin(60 * Math.PI / 180));
            Console.WriteLine("cos (60)     = {0}", Math.Cos(60 * Math.PI / 180));
            Console.WriteLine("tan (60)     = {0}", Math.Tan(60 * Math.PI / 180));
            Console.WriteLine("arcsin (1/2) = {0}", Math.Asin(0.5) * 180 / Math.PI);
            Console.WriteLine("arccos (1/2) = {0}", Math.Acos(0.5) * 180 / Math.PI);
            Console.WriteLine("arctan (1/2) = {0}", Math.Atan(0.5) * 180 / Math.PI);
            Console.Read();
        }
    }
}
Program Explanation

This C# program is used to illustrate trigonometry angles in degrees. Here the trigonometric values are calculated in terms of radians using Sin(), Cos(), Tan(), Asin(), Acos(), Atan() functions and print the values.

advertisement
advertisement
Runtime Test Cases
 
Trignometric Values in Radians : 
sin (pi/3)   = 0.866025403784439
cos (pi/3)   = 0.5
tan (pi/3)   = 1.73205080756888
arcsin (1/2) = 30
arccos (1/2) = 60
arctan (1/2) = 26.565051177078

Sanfoundry Global Education & Learning Series – 1000 C# Programs.

If you wish to look at all C# Programming examples, go to 1000 C# Programs.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.