7 public const float E = (float)
Math.
E;
9 public const float Log2E = 1.442695f;
11 public const float Log10E = 0.4342945f;
23 return degrees * ((float)
Math.
PI / 180f);
28 return radians * (180f / (float)
Math.
PI);
31 public static float Distance(
float value1,
float value2)
33 return Math.
Abs(value1 - value2);
36 public static float Min(
float value1,
float value2)
38 return Math.
Min(value1, value2);
41 public static float Max(
float value1,
float value2)
43 return Math.
Max(value1, value2);
46 public static float Clamp(
float value,
float min,
float max)
53 public static float Lerp(
float value1,
float value2,
float amount)
55 return value1 + (value2 - value1) * amount;
58 public static float Barycentric(
float value1,
float value2,
float value3,
float amount1,
float amount2)
60 return value1 + amount1 * (value2 - value1) + amount2 * (value3 - value1);
63 public static float SmoothStep(
float value1,
float value2,
float amount)
65 float num =
Clamp(amount, 0f, 1f);
66 return Lerp(value1, value2, num * num * (3f - 2f * num));
69 public static float CatmullRom(
float value1,
float value2,
float value3,
float value4,
float amount)
71 float num = amount * amount;
72 float num2 = amount * num;
73 return 0.5f * (2f * value2 + (0f - value1 + value3) * amount + (2f * value1 - 5f * value2 + 4f * value3 - value4) * num + (0f - value1 + 3f * value2 - 3f * value3 + value4) * num2);
76 public static float Hermite(
float value1,
float tangent1,
float value2,
float tangent2,
float amount)
78 float num = amount * amount;
79 float num2 = amount * num;
80 float num3 = 2f * num2 - 3f * num + 1f;
81 float num4 = -2f * num2 + 3f * num;
82 float num5 = num2 - 2f * num + amount;
83 float num6 = num2 - num;
84 return value1 * num3 + value2 * num4 + tangent1 * num5 + tangent2 * num6;
90 if (angle <= -(
float)
Math.
PI)
92 angle += (float)
Math.
PI * 2f;
94 else if (angle > (
float)
Math.
PI)
96 angle -= (float)
Math.
PI * 2f;
static float Lerp(float value1, float value2, float amount)
static float ToDegrees(float radians)
static float WrapAngle(float angle)
static float CatmullRom(float value1, float value2, float value3, float value4, float amount)
static float Distance(float value1, float value2)
static float Max(float value1, float value2)
static float Barycentric(float value1, float value2, float value3, float amount1, float amount2)
static float ToRadians(float degrees)
static float SmoothStep(float value1, float value2, float amount)
static float Clamp(float value, float min, float max)
static float Min(float value1, float value2)
static float Hermite(float value1, float tangent1, float value2, float tangent2, float amount)
static byte Min(byte val1, byte val2)
static double IEEERemainder(double x, double y)
static double Abs(double value)
static byte Max(byte val1, byte val2)