Dynamic_Games.NonCoopForm.DrawGraph C# (CSharp) Method

DrawGraph() private method

private DrawGraph ( ) : void
return void
        private void DrawGraph()
        {
            Graphics graphics = graphBox.CreateGraphics();
            //graphics.DrawEllipse(Pens.Black, 75, 0, 350, 350);

            float r = 175, alpha = 360 / N;
            double x, y;
            Point[] coords = new Point[N];

            for (int i = 0; i < N; i++)
            {
                x = r * Math.Cos(i * alpha * Math.PI / 180);
                y = r * Math.Sin(i * alpha * Math.PI / 180);
                x += r * 2 - 110;
                y += r + 10;
                coords[i] = new Point((int)x + 10, (int)y + 10);
                if (colors[i] == 1)
                {
                    graphics.FillEllipse(Brushes.Red, (int)x, (int)y, 20, 20);
                }
                else if (colors[i] == 2)
                {
                    graphics.FillEllipse(Brushes.Green, (int)x, (int)y, 20, 20);
                }
                else if (colors[i] == 3)
                {
                    graphics.FillEllipse(Brushes.Yellow, (int)x, (int)y, 20, 20);
                }
                else
                {
                    graphics.FillEllipse(Brushes.Blue, (int)x, (int)y, 20, 20);
                }
            }

            if (true)
            {
                for (int i = 0; i < edgeNr; i++)
                {
                    if (graph[i, 0] != graph[i, 1])
                    {
                        graphics.DrawLine(Pens.Black, coords[graph[i, 0]], coords[graph[i, 1]]);
                    }
                }
            }

            turn++;

        }