Пример #1
0
        protected Point GetXY(int radius, int deg)
        {
            double a = MathUtils.ToRadians(deg);

            return(new Point
            {
                X = (int)(m_center.X + Math.Sin(a) * radius),
                Y = (int)(m_center.Y - Math.Cos(a) * radius)
            });
        }
Пример #2
0
        private void MouseHit(Point point)
        {
            int x = point.X - m_center.X;
            int y = point.Y - m_center.Y;

            if (x == 0 && y == 0)
            {
                return;
            }
            var alpha   = Math.Atan2(x, -y);
            var degrees = MathUtils.ToDegreesInt(alpha);

            MouseHit(point, degrees);
        }