Double - Atan
Returns the angle whose tangent is the specified number.
public static void Main() { double angle; double radians; double result; // Calculate the tangent of 30 degrees. angle = 30; radians = angle * (Math.PI / 180); // C# Extension Method: Double - Tan result = radians.Tan(); Console.WriteLine("The tangent of 30 degrees is {0}.", result); // Calculate the arctangent of the previous tangent. // C# Extension Method: Double - Atan radians = result.Atan(); angle = radians * (180 / Math.PI); Console.WriteLine("The previous tangent is equivalent to {0} degrees.", angle); }
View Source
using System; public static partial class Extensions { /// <summary> /// Returns the angle whose tangent is the specified number. /// </summary> /// <param name="d">A number representing a tangent.</param> /// <returns> /// An angle, ?, measured in radians, such that -?/2 ????/2.-or- if equals , -?/2 rounded to double precision (- /// 1.5707963267949) if equals , or ?/2 rounded to double precision (1.5707963267949) if equals . /// </returns> public static Double Atan(this Double d) { return Math.Atan(d); } }