|
在.NET环境下绘制模糊数学中隶属函数分布图(3) ...{ x1 = o.X + d * unit; x2 = o.X + (d + interval) * unit; y1 = o.Y - (float)(unit * System.Math.Sin(d)); y2 = o.Y - (float)(unit * System.Math.Sin(d + interval)); p1 = new PointF(x1, y1); p2 = new PointF(x2, y2); e.Graphics.DrawLine(Pens.Black, p1, p2); } } else if (type1 == 1) ...{ //set1(); PointF o1 = new PointF(this.pictureBox1.Width/2, this.pictureBox1.Height / 4); e.Graphics.DrawString("1", font, brush, o1);
if (type2 == 1) ...{ for (d = 0; d < a; d += interval) ...{ x1 = o.X + d * unit; x2 = o.X + (d + interval) * unit; y1 = o.Y - (float)(this.pictureBox1.Height / 4); y2 = o.Y - (float)(this.pictureBox1.Height / 4); p1 = new PointF(x1, y1); p2 = new PointF(x2, y2); e.Graphics.DrawLine(Pens.Black, p1, p2); tempx = x2; tempy = this.pictureBox1.Height/2; } PointF o2 = new PointF(tempx, tempy); e.Graphics.DrawString(a.ToString(), font, brush, o2); } else if (type2 == 2) ...{ for (d = a; d < 2*a; d += interval) ...{ x1 = o.X + d * unit; x2 = o.X + (d + interval) * unit; y1 = o.Y - (float)(this.pictureBox1.Height / 4); y2 = o.Y - (float)(this.pictureBox1.Height / 4); p1 = new PointF(x1, y1); p2 = new PointF(x2, y2); e.Graphics.DrawLine(Pens.Blue, p1, p2); } PointF o2 = new PointF(tempx, tempy); e.Graphics.DrawString(a.ToString(), font, brush, o2); } else if (type2 == 3) ...{ for (d = a; d ...{ x1 = o.X + d * unit; x2 = o.X + (d + interval) * unit; y1 = o.Y - (float)(this.pictureBox1.Height / 4); y2 = o.Y - (float)(this.pictureBox1.Height / 4); p1 = new PointF(x1, y1); p2 = new PointF(x2, y2); e.Graphics.DrawLine(Pens.Blue, p1, p2); } PointF o2 = new PointF(tempx, tempy); e.Graphics.DrawString(a.ToString(), font, brush, o2);
|