C# Program to Demonstrate the Use of Atan2() Method of Math Class

You are currently viewing C# Program to Demonstrate the Use of Atan2() Method of Math Class

C# program to demonstrate the use of Atan2() method of Math class

using System;

class Sample
{
    //Entry point of Program
    static public void Main()
    {
        double X    = 0.5;
        double Y    = 0.6;
        double Tan  = 0.0;

        Tan = Math.Atan2(Y,X);
        
        System.Console.WriteLine("Result is: "+Tan);
    }
}
Result is: 0.876058050598193
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply