using System;

namespace YourBeatingHeart.Main.Helper
{
    public class MathHelper
    {
        public const float FULL_ANGLE_RAD = (float)(Math.PI * 2);
        public const float HALF_ANGLE_RAD = FULL_ANGLE_RAD / 2;
        public const float QUARTER_ANGLE_RAD = FULL_ANGLE_RAD / 4;

        public static int Clamp(int value, int min, int max)
        {
            return Math.Max(min, Math.Min(max, value));
        }

        public static float Clamp(float value, float min, float max)
        {
            return Math.Max(min, Math.Min(max, value));
        }

        public static float GetCircleArea(float radius)
        {
            return (float) Math.PI * radius * radius;
        }

        public static float GetCircleRadius(float area)
        {
            return (float) Math.Sqrt(area / Math.PI);
        }

        public static float GetCircleRadiusAfterAddingArea(float radius, float addArea)
        {
            return GetCircleRadius(GetCircleArea(radius) + addArea);
        }
    }
}
