ARCed.Core.ColorWheel.CalcDegrees C# (CSharp) Method

CalcDegrees() private static method

private static CalcDegrees ( Point pt ) : int
pt Point
return int
        private static int CalcDegrees(Point pt)
        {
            int degrees;
            if (pt.X == 0)
            {
                degrees = pt.Y > 0 ? 270 : 90;
            }
            else
            {
                degrees = (int)(-Math.Atan((double)pt.Y / pt.X) * DEGREES_PER_RADIAN);
                if (pt.X < 0)
                {
                    degrees += 180;
                }
                degrees = (degrees + 360) % 360;
            }
            return degrees;
        }