• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >C#教程 > 讲解.NET环境下绘制模糊数学中隶属函数分布图第1/5页

讲解.NET环境下绘制模糊数学中隶属函数分布图第1/5页

作者: 字体:[增加 减小] 来源:互联网 时间:2017-05-28

通过本文主要向大家介绍了.net模糊查询,vb.net 模糊查询,.net模糊查找,.net环境,net环境是什么等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
 绘制模糊数学中隶属函数分布图
  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; 
  } 
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 讲解.NET环境下绘制模糊数学中隶属函数分布图第1/5页

相关文章

  • 2017-05-28mvc C# JavaScript LigerUI oracle实现用户的注册、登陆验证、登陆
  • 2017-05-28C#实现实体类与字符串互相转换的方法
  • 2017-05-28C#精确计算年龄的方法分析
  • 2017-05-28Winform中进行MD5加密的实例
  • 2017-05-28C#控制台程序输出等腰三角形并居中显示实例
  • 2017-05-28C#接口interface用法实例
  • 2017-05-28C#中的DateTime是值类型还是引用类型
  • 2017-05-28c#中Empty()和DefalutIfEmpty()用法分析
  • 2017-05-28C#字符串的截取函数用法总结
  • 2017-05-28c#打印预览控件中实现用鼠标移动页面功能代码分享

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • asp.net获取系统当前时间的方法详解
    • C#实现随机数产生类实例
    • c#连接excel示例分享
    • c# 实现窗体拖到屏幕边缘自动隐藏
    • C#生成饼形图及添加文字说明实例代码
    • C#中时间的几种格式转换方法
    • C#中ListView控件实现窗体代码
    • C#生成条形码图片的简单方法
    • c#利用webmail邮件系统发送邮件示例分享
    • C# WinForm导出Excel方法介绍

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有