public class egg { System.Drawing.Graphics zona_des; int x0, y0, d; public void sterg(Color culoare_stergere, int pozx, int pozy, int diam) { zona_des.FillEllipse(new SolidBrush(culoare_stergere), x0 + 1, y0 + 1, d - 1, d - 1); } public void setc(Color culoare_egg, int np) { double alfa_g, alfa_r; int[,] puncte_c; puncte_c = new int[np + 1, 2]; int x, y, xc, yc, i, j; xc = x0 + d / 2; yc = y0 + d / 2; zona_des.DrawEllipse(new Pen(culoare_egg), x0, y0, d, d); i = 0; for (alfa_g = 0; alfa_g < 360; alfa_g += 360 / np) { alfa_r = 2 * System.Math.PI * alfa_g / 360;// unghiul in radiani x = System.Convert.ToInt16(xc + d / 2 * System.Math.Cos(alfa_r)); y = System.Convert.ToInt16(yc - d / 2 * System.Math.Sin(alfa_r)); puncte_c[i, 0] = x; puncte_c[i, 1] = y; i++; } for (j = 0; j < np; j++) { for (i = 0; i < np; i++) { zona_des.DrawLine(new Pen(culoare_egg), puncte_c[j, 0], puncte_c[j, 1], puncte_c[i, 0], puncte_c[i, 1]); } } } public egg(System.Drawing.Graphics desen, int pozx, int pozy, int diam) { zona_des = desen; x0 = pozx; y0 = pozy; d = diam; } }