C# | Math.Atan() Method Last Updated : 31 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Math.Atan() is an inbuilt Math class method which returns the angle whose tangent is given as a double value argument. If the argument is NaN, then the result will be NaN. Syntax: public static double Atan(double num) Parameter: num: It is the number that represents a tangent and type of this parameter is System.Double. Return Type: Returns an angle Θ, measured in radians and its type is System.Double. Here the angle is always measured in radians, such that -π/2 ≤ Θ ≤ π/2. Examples: Input : Math.Atan(1) Output : 0.785398163397448 Input : Math.Atan(0.0) Output : 0 Input : Math.Atan(-0.0) Output : 0 Input : Math.Atan(Double.PositiveInfinity) Output : 1.5707963267949 Input : Math.Atan(Double.NegativeInfinity) Output : -1.5707963267949 Program: To illustrate the Math.Atan() method Csharp // C# program to demonstrate working // of Math.Atan() method using System; class Geeks { // Main Method public static void Main(String []args) { double a = Math.PI; // using Math.Atan() method Console.WriteLine(Math.Atan(a)); double d = 0.0; double e = -0.0; double posi = Double.PositiveInfinity; double nega = Double.NegativeInfinity; double nan = Double.NaN; Console.WriteLine(Math.Atan(1)); // Input positive zero // Output positive zero Console.WriteLine(Math.Atan(d)); // Input negative zero // Output positive zero Console.WriteLine(Math.Atan(e)); // input PositiveInfinity // Output 1.5707963267949 Console.WriteLine(Math.Atan(posi)); // input NegativeInfinity // Output -1.5707963267949 Console.WriteLine(Math.Atan(nega)); // input NaN // Output NaN Console.WriteLine(Math.Atan(nan)); } } Output: 1.26262725567891 0.785398163397448 0 0 1.5707963267949 -1.5707963267949 NaN Reference: https://msdn.microsoft.com/en-us/library/system.math.atan Comment More infoAdvertise with us Next Article C# | Math.Atan() Method M Mithun Kumar Follow Improve Article Tags : Misc C# CSharp-method CSharp-Math Practice Tags : Misc Similar Reads C# | Math.Atan2() Method Math.Atan2() is an inbuilt Math class method which returns the angle whose tangent is the quotient of two specified numbers. Basically, it returns an angle θ (measured in radian) whose value lies between -π and π. This is a counterclockwise angle lies between the positive x-axis, and the 5 min read C# | Math.Asin() Method Math.Asin() is an inbuilt Math class method which returns the angle whose sine value is given as a double value argument. If the argument is NaN, then the result will be NaN. Syntax: public static double Asin(double num) Parameter: num: It is the number that represents a sine and type of this parame 2 min read C# | Math.Acos() Method Math.Acos() is an inbuilt Math class method which returns the angle whose cosine is given as a double value argument. If the argument is NaN, then the result will be NaN. Syntax: public static double Acos(double num) Parameter: num: It is the number that represents cosine and type of this parameter 2 min read JavaScript Math atan() Method Javascript Math.atan( ) method is used to return the arctangent of a number in radians. The Math.atan() method returns a numeric value between -pi/2 and pi/2 radians. The atan() is a static method of Math, therefore, it is always used as Math.atan(), rather than as a method of a Math object created. 3 min read C# | Math.Cos() Method Math.Cos() is an inbuilt Math class method which returns the cosine of a given double value argument(specified angle).Syntax: public static double Cos(double num) Parameter: num: It is the angle(measured in radian) whose cosine is to be returned and the type of this parameter is System.Double. Retur 2 min read Like