SoFunction
Updated on 2025-03-07

Explain the drawing of membership function distribution diagram in fuzzy mathematics in .NET environment, page 1/5

Draw the distribution diagram of membership functions in fuzzy mathematics
using System; 
using ; 
using ; 
using ; 
using ; 
using ; 
using ; 
using ; 
using ; 
using .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.(); 
item2 = this.(); 
this. = item1 + item2 + "Graphics";
a = (().ToString()); 
b = (().ToString()); 
c = (().ToString()); 
d1 = (().ToString()); 
k = (().ToString()); 
l = (().ToString()); 
type1 = this.+1; 
type2 = this.+1; 

private void delete() 
...{ 
a = 0; 
b = 0; 
c = 0; 
d1 = 0; 
k = 0; 
l = 0; 

private void set1() 
...{ 
 = "1"; 
 = "2"; 
 = "3"; 
 = "4"; 
 = "1"; 
 = "2"; 

private void set2() 
...{ 
 = "1"; 
 = "1.5"; 


 = "2"; 
 = "2.5"; 
 = "1"; 
 = "2"; 

private void set3() 
...{ 
 = "0.5"; 
 = "1.5"; 
 = "2"; 
 = "3"; 
 = "3"; 
 = "2"; 

private void set4() 
...{ 
 = "1.5"; 
 = "1.5"; 
 = "2"; 
 = "2.5"; 
 = "0.5"; 
 = "2"; 

private void set5() 
...{ 

 = "2"; 
 = "2.5"; 
 = "3"; 
 = "3.5"; 
 = "4"; 
 = "6"; 

private void set6() 
...{ 
 = "0.5"; 
 = "1.5"; 
 = "2"; 
 = "2.5"; 
 = "2"; 
 = "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;//Magnification
Font font = new Font("MS UI Gothic", 12); 
SolidBrush brush = new SolidBrush(); 
float interval = 0.001F; //Step scale, the smaller the value, the more accurate it is (must be 0), but the slower the speed is.
PointF o = new PointF(this. / 2, this. / 2); 
(, 0, this. / 2, this., this. / 2); 
(, this. / 2, 0, this. / 2, this.); 
("O", font, brush, o); 
if (type1 == 0) 
...{ 
for (d = -6.28F; d < 6.28F; d += interval) 
...{ 
x1 =  + d * unit; 
x2 =  + (d + interval) * unit; 
y1 =  - (float)(unit * (d)); 
y2 =  - (float)(unit * (d + interval)); 
p1 = new PointF(x1, y1); 
p2 = new PointF(x2, y2); 
(, p1, p2); 


else if (type1 == 1) 
...{ 
//set1(); 
PointF o1 = new PointF(this./2, this. / 4); 
("1", font, brush, o1); 


if (type2 == 1) 
...{ 
for (d = 0; d < a; d += interval) 
...{ 
x1 =  + d * unit; 
x2 =  + (d + interval) * unit; 
y1 =  - (float)(this. / 4); 
y2 =  - (float)(this. / 4); 
p1 = new PointF(x1, y1); 
p2 = new PointF(x2, y2); 
(, p1, p2); 
tempx = x2; 
tempy = this./2; 

PointF o2 = new PointF(tempx, tempy); 
((), font, brush, o2); 

else if (type2 == 2) 
...{ 
for (d = a; d < 2*a; d += interval) 


...{ 
x1 =  + d * unit; 
x2 =  + (d + interval) * unit; 
y1 =  - (float)(this. / 4); 
y2 =  - (float)(this. / 4); 
p1 = new PointF(x1, y1); 
p2 = new PointF(x2, y2); 
(, p1, p2); 

PointF o2 = new PointF(tempx, tempy); 
((), font, brush, o2); 

else if (type2 == 3) 
...{ 
for (d = a; d  
...{ 
x1 =  + d * unit; 
x2 =  + (d + interval) * unit; 
y1 =  - (float)(this. / 4); 


y2 =  - (float)(this. / 4); 
p1 = new PointF(x1, y1); 
p2 = new PointF(x2, y2); 
(, p1, p2); 

PointF o2 = new PointF(tempx, tempy); 
((), font, brush, o2); 


else if (type1 == 2) 
...{ 
//set2(); 
PointF o1 = new PointF(this./2, this. / 4); 
("1", font, brush, o1);
12345Next pageRead the full text