void drawFunc(float r, Graphics grBack, fuzzyFuncs func, int w, int h) { float dist = (float)((w - 20.0f) / model1.outService.dist); //solution List<PointF> ptSolution = func.getValues(r); PointF[] ptsSolution = new PointF[ptSolution.Count]; for (int i = 0; i < ptSolution.Count; i++) { ptsSolution[i] = new PointF((ptSolution[i].X * dist) + 10, (h - 30.0f) - ptSolution[i].Y * (h - 30.0f) + 10.0f); } grBack.FillPolygon(new HatchBrush(HatchStyle.Weave, Color.Black, Color.White), ptsSolution); }
void drawFunc(Graphics grBack, fuzzyFuncs func, int w, int h) { List<PointF> pt = func.getValues(); float dist = (float)((w - 20.0f) / model1.outService.dist); //term PointF[] points = new PointF[pt.Count]; for (int i = 0; i < pt.Count; i++) { points[i] = new PointF((pt[i].X * dist) + 10, (h - 30.0f) - pt[i].Y * (h - 30.0f) + 10.0f); } grBack.DrawLines(new Pen(Color.Green, 2), points); for (int i = 0; i < points.Length; i++) { PointF p = points[i]; grBack.FillEllipse(new SolidBrush(Color.Green), new RectangleF(p.X - 3, p.Y - 3, 6, 6)); } //labels List<PointF> l = func.getValues(1.0f); float x = (l[1].X * dist) + 10; // for (int i = 0; i < l.Count-2; i++) // { // x += (l[i].X * dist) + 10; // } //= (points[0].X+points[points.Length-1].X)/2.0f; //x /= 2; grBack.DrawString(func.fuzzyName, new Font("Arial", 8), new SolidBrush(Color.Red), new PointF(x, -2)); }
void drawFunc(bool key, Graphics grBack, fuzzyFuncs func, int w, int h) { List<PointF> pt = func.getValues(); float dist = (float)((w - 20.0f) / U); PointF[] points = new PointF[pt.Count]; for (int i = 0; i < pt.Count; i++) { points[i] = new PointF((pt[i].X * dist) + 10, (h - 30.0f) - pt[i].Y * (h - 30.0f) + 10.0f); } if (key) { Pen pen = new Pen(Color.Red, 3); pen.DashStyle = DashStyle.Dash; grBack.DrawLines(pen, points); } else { grBack.DrawLines(new Pen(Color.Green, 2), points); } for (int i = 0; i < points.Length; i++) { PointF p = points[i]; grBack.FillEllipse(new SolidBrush(Color.Green), new RectangleF(p.X - 3, p.Y - 3, 6, 6)); } }