Mega Code Archive

 
Categories / C# / Development Class
 

Double extension method for RadianDegree conversion

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Turbulence.Common.Extensions {     public static class MathExt     {         public static double Squared(this double x)         {             return x * x;         }         public static double ToRadians(this double degrees)         {             return degrees / (180D / Math.PI);         }         public static double ToDegrees(this double radians)         {             return radians * (180D / Math.PI);         }     } }