vertices = new VertexPositionColor[100]; for (int i = 0; i < 99; i++) { float angle = (float)(i / 100.0 * Math.PI * 2); vertices.Position = new Vector3(200 + (float)Math.Cos(angle) * 100, 200 + (float)Math.Sin(angle) * 100, 0); vertices.Color = Color.Black; } vertices[99] = vertices[0];
Can someone explain this code? I understand what it's doing as far as the for loop, but I'm trying to learn trig. Can someone explain it step by step? The output of this is a 2d circle. ;o