a亚洲精品_精品国产91乱码一区二区三区_亚洲精品在线免费观看视频_欧美日韩亚洲国产综合_久久久久久久久久久成人_在线区

首頁 > 編程 > C# > 正文

講解.NET環境下繪制模糊數學中隸屬函數分布圖第1/5頁

2020-01-24 03:48:12
字體:
來源:轉載
供稿:網友
 繪制模糊數學中隸屬函數分布圖
  using System; 
  using System.Collections.Generic; 
  using System.ComponentModel; 
  using System.Data; 
  using System.Drawing; 
  using System.Text; 
  using System.Collections; 
  using System.Windows.Forms; 
  using System.Drawing.Imaging; 
  using System.Drawing.Drawing2D; 
  namespace ImageFuzzy 
  ...{ 
  public partial class Form1 : Form 
  ...{ 
  private int type1; 
  private int type2; 

  private string item1; 
  private string item2; 
  private float a; 
  private float b; 
  private float c; 
  private float d1; 
  private float k; 
  private float l; 
  private float tempx; 
  private float tempy; 
  public void InitArray() 
  ...{ 
  type1 = 0; 
  type2 = 0; 
  k = 2; 
  item1 = this.comboBox1.Text.ToString(); 
  item2 = this.comboBox2.Text.ToString(); 
  this.groupBox1.Text = item1 + item2 + "圖形"; 
  a = float.Parse(this.tbA.Text.Trim().ToString()); 
  b = float.Parse(this.tbB.Text.Trim().ToString()); 
  c = float.Parse(this.tbC.Text.Trim().ToString()); 
  d1 = float.Parse(this.tbD.Text.Trim().ToString()); 
  k = float.Parse(this.tbK.Text.Trim().ToString()); 
  l = float.Parse(this.tbL.Text.Trim().ToString()); 
  type1 = this.comboBox1.SelectedIndex+1; 
  type2 = this.comboBox2.SelectedIndex+1; 
  } 
  private void delete() 
  ...{ 
  a = 0; 
  b = 0; 
  c = 0; 
  d1 = 0; 
  k = 0; 
  l = 0; 
  } 
  private void set1() 
  ...{ 
  this.tbA.Text = "1"; 
  this.tbB.Text = "2"; 
  this.tbC.Text = "3"; 
  this.tbD.Text = "4"; 
  this.tbK.Text = "1"; 
  this.tbL.Text = "2"; 
  } 
  private void set2() 
  ...{ 
  this.tbA.Text = "1"; 
  this.tbB.Text = "1.5"; 


  this.tbC.Text = "2"; 
  this.tbD.Text = "2.5"; 
  this.tbK.Text = "1"; 
  this.tbL.Text = "2"; 
  } 
  private void set3() 
  ...{ 
  this.tbA.Text = "0.5"; 
  this.tbB.Text = "1.5"; 
  this.tbC.Text = "2"; 
  this.tbD.Text = "3"; 
  this.tbK.Text = "3"; 
  this.tbL.Text = "2"; 
  } 
  private void set4() 
  ...{ 
  this.tbA.Text = "1.5"; 
  this.tbB.Text = "1.5"; 
  this.tbC.Text = "2"; 
  this.tbD.Text = "2.5"; 
  this.tbK.Text = "0.5"; 
  this.tbL.Text = "2"; 
  } 
  private void set5() 
  ...{ 

  this.tbA.Text = "2"; 
  this.tbB.Text = "2.5"; 
  this.tbC.Text = "3"; 
  this.tbD.Text = "3.5"; 
  this.tbK.Text = "4"; 
  this.tbL.Text = "6"; 
  } 
  private void set6() 
  ...{ 
  this.tbA.Text = "0.5"; 
  this.tbB.Text = "1.5"; 
  this.tbC.Text = "2"; 
  this.tbD.Text = "2.5"; 
  this.tbK.Text = "2"; 
  this.tbL.Text = "4"; 
  } 
  public Form1() 
  ...{ 
  InitializeComponent(); 
  } 
  private void Form1_Load(object sender, EventArgs e) 
  ...{ 
  //set1(); 
  } 
  private void Form1_Paint(object sender, PaintEventArgs e) 
  ...{ 
  } 
  private void pictureBox1_Paint(object sender, PaintEventArgs e) 
  ...{ 
  float d; 
  float x1; 
  float x2; 
  float y1; 
  float y2; 
  PointF p1; 
  PointF p2; 
  int unit = 40;//放大倍數 
  Font font = new Font("MS UI Gothic", 12); 
  SolidBrush brush = new SolidBrush(Color.Black); 
  float interval = 0.001F; //步進刻度,值越小越精確(必須大小0),但速度也越慢 
  PointF o = new PointF(this.pictureBox1.Width / 2, this.pictureBox1.Height / 2); 
  e.Graphics.DrawLine(Pens.Red, 0, this.pictureBox1.Height / 2, this.pictureBox1.Width, this.pictureBox1.Height / 2); 
  e.Graphics.DrawLine(Pens.Red, this.pictureBox1.Width / 2, 0, this.pictureBox1.Width / 2, this.pictureBox1.Height); 
  e.Graphics.DrawString("O", font, brush, o); 
  if (type1 == 0) 
  ...{ 
  for (d = -6.28F; d < 6.28F; d += interval) 
  ...{ 
  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); 
  } 
  } 
  else if (type1 == 2) 
  ...{ 
  //set2(); 
  PointF o1 = new PointF(this.pictureBox1.Width/2, this.pictureBox1.Height / 4); 
  e.Graphics.DrawString("1", font, brush, o1);
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 亚洲一区二区三区免费视频 | 亚州综合 | 欧美日韩中文在线观看 | 国产精品精品视频一区二区三区 | 91视频观看 | 黄色三级视频 | 色噜噜视频 | 免费午夜电影 | 国产一区网站 | 亚洲精品一区二区三区蜜桃久 | 在线中文字幕视频 | 国产高清在线精品一区二区三区 | 综合99| 亚洲九九 | 亚洲三级在线播放 | 午夜在线观看视频 | 欧美激情小视频 | 特级淫片裸体免费看 | 日韩一区在线观看视频 | 亚洲三区视频 | 久久国产在线视频 | 欧美日韩久久 | 图片区 国产 欧美 另类 在线 | 日韩视频免费在线 | 欧美三级视频在线观看 | 男女午夜 | 男女做网站 | 夜夜撸av| 亚洲精品在线国产 | 国产一区二区三区精品久久久 | 日韩视频免费在线观看 | 国产日韩欧美激情 | 一本色道精品久久一区二区三区 | 日韩三级电影在线观看 | 久久成人一区 | 久久精品国产亚洲 | 日本久久久久久 | 99国产精品99久久久久久 | 中文字幕国产一区 | 操久久| 日韩特黄一级欧美毛片特黄 |