/// <summary> /// adds graph of parametrically defined 2D function /// </summary> /// <param name="f">Real function of DoubleFunction</param> /// <param name="drawMode">Whether to join nodes with lines</param> /// <returns>Zero-based index (ID) of newly added graphic</returns> public int AddGraphic(DoubleFunction fx, DoubleFunction fy, float t1, float t2, DrawModes drawMode, Color penColor) { if (grs == null) { grs = new List <MathGraphic>(100); } MathGraphic newGraphic = new MathGraphic(penColor, drawMode, fx, fy, t1, t2, 0.01f); grs.Add(newGraphic); return(grs.Count - 1); }
/// <summary> /// </summary> /// <param name="penWidth">Is zooming with graphics of not zero :(</param> public int AddPolygon(Color penColor, float penWidth, DrawModes drawMode, params PointF[] pts) { if (grs == null) { grs = new List <MathGraphic>(100); } MathGraphic newGraphic = new MathGraphic(pts); newGraphic.DrawingMode = drawMode; newGraphic.PenColor = penColor; newGraphic.PenWidth = penWidth; grs.Add(newGraphic); return(grs.Count - 1); }
/// <summary> /// Returns ID of added grapgic /// </summary> /// <param name="f">Real function of DoubleFunction</param> /// <param name="x1">Left tabulation bound</param> /// <param name="x2">Right tabulation bound</param> /// <param name="drawMode">Weather to join nodes with lines</param> /// <returns></returns> public int AddGraphic(DoubleFunction f, float x1, float x2, DrawModes drawMode, Color penColor) { if (grs == null) { grs = new List <MathGraphic>(100); } MathGraphic newGraphic = new MathGraphic(f); newGraphic.LeftBound = x1; newGraphic.RightBound = x2; newGraphic.Step = 0.01f; newGraphic.DrawMode = drawMode; newGraphic.PenColor = penColor; newGraphic.Tabulate(); grs.Add(newGraphic); return(grs.IndexOf(newGraphic)); }
private bool ReturnTrue(MathGraphic mg) { return(true); }