Double - Sin
Returns the sine 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 - Sin Console.WriteLine("Sin({0}) = {1}", value, radians.Sin()); } }
View Source
using System; public static partial class Extensions { /// <summary> /// Returns the sine of the specified angle. /// </summary> /// <param name="a">An angle, measured in radians.</param> /// <returns>The sine of . If is equal to , , or , this method returns .</returns> public static Double Sin(this Double a) { return Math.Sin(a); } }