int i=0,y=0,y_v=0,lat,factor_s; double x,rad; System.Drawing.Graphics Desen; Desen = this.CreateGraphics(); System.Drawing.Pen Creion_r; Creion_r=new System.Drawing.Pen(System.Drawing.Color.Red); System.Drawing.Pen Creion_g; Creion_g=new System.Drawing.Pen(System.Drawing.Color.Yellow); System.Drawing.Pen Creion_a; Creion_a=new System.Drawing.Pen(System.Drawing.Color.Blue); Desen.Clear(this.BackColor); factor_s=this.Height/2-37; rad=System.Convert.ToDouble(this.numericUpDown1.Value); lat=this.Width; i=0; do { x=i*rad*System.Math.PI/(lat-10); y=System.Convert.ToInt16(35+factor_s*(1-System.Math.Sin(x))); Desen.DrawLine(Creion_r, i-1,y_v, i, y); y_v=y; i+=1; } while (i<=lat); i=0; do { x=(i+2*lat/rad/3)*rad*System.Math.PI/(lat-10); y=System.Convert.ToInt16(35+factor_s*(1-System.Math.Sin(x))); Desen.DrawLine(Creion_g, i-1,y_v, i, y); y_v=y; i+=1; } while (i<=lat); i=0; do { x=(i+4*lat/rad/3)*rad*System.Math.PI/(lat-10); y=System.Convert.ToInt16(35+factor_s*(1-System.Math.Sin(x))); Desen.DrawLine(Creion_a, i-1,y_v, i, y); y_v=y; i+=1; } while (i<=lat); |