Double - Tanh
Returns the hyperbolic tangent of the specified angle.
public static void Main() { double[] doubles = { 0, 45, 90, 180 }; foreach (double value in doubles) { double radians = (value * (Math.PI)) / 180; // C# Extension Method: Double - Tanh Console.WriteLine("Tanh({0}) = {1}", value, radians.Tanh()); } }
View Source
using System; public static partial class Extensions { /// <summary> /// Returns the hyperbolic tangent of the specified angle. /// </summary> /// <param name="value">An angle, measured in radians.</param> /// <returns> /// The hyperbolic tangent of . If is equal to , this method returns -1. If value is equal to , this method /// returns 1. If is equal to , this method returns . /// </returns> public static Double Tanh(this Double value) { return Math.Tanh(value); } }