From 4595d424f01e0862ca67513b014687d9fd7538c6 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 8 Feb 2011 20:10:42 +0000 Subject: [PATCH] Added missing double-precision radian-to-degree conversion routines. --- Source/OpenTK/Math/MathHelper.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Source/OpenTK/Math/MathHelper.cs b/Source/OpenTK/Math/MathHelper.cs index 4b303037..215f540f 100644 --- a/Source/OpenTK/Math/MathHelper.cs +++ b/Source/OpenTK/Math/MathHelper.cs @@ -236,6 +236,28 @@ namespace OpenTK return radians * radToDeg; } + /// + /// Convert degrees to radians + /// + /// An angle in degrees + /// The angle expressed in radians + public static double DegreesToRadians(double degrees) + { + const double degToRad = System.Math.PI / 180.0; + return degrees * degToRad; + } + + /// + /// Convert radians to degrees + /// + /// An angle in radians + /// The angle expressed in degrees + public static double RadiansToDegrees(double radians) + { + const double radToDeg = 180.0 / System.Math.PI; + return radians * radToDeg; + } + #endregion #region Swap