EveryFileExplorer/LibEveryFileExplorer/Math/MathUtil.cs
2014-11-04 18:44:52 +01:00

28 lines
522 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LibEveryFileExplorer.Math
{
public class MathUtil
{
public static int Clamp(int value, int min, int max)
{
if (value < min) value = min;
if (value > max) value = max;
return (short)value;
}
public static float RadToDeg(float Radians)
{
return Radians * (180f / (float)System.Math.PI);
}
public static double RadToDeg(double Radians)
{
return Radians * (180.0 / System.Math.PI);
}
}
}