/// <summary>Intepreting real values of func as X, imaginary as Y we iterate on range [from; to]</summary> public void PlotIterativeComplex(FastExpression func, Entity.Number.Complex from, Entity.Number.Complex to) { double X(int it) => func.Call(((from + to) / (pointCount - 1) * it).ToNumerics()).Real; double Y(int it) => func.Call(((from + to) / (pointCount - 1) * it).ToNumerics()).Imaginary; BuildData(X, Y); destination.plt.PlotScatter(dataX, dataY); }
/// <summary>Plots from an expression over variable x</summary> /// <param name="expr">Expression to build</param> /// <param name="from">Low bound</param> /// <param name="to">High bound</param> public void PlotScatter(FastExpression func, Entity.Number.Complex from, Entity.Number.Complex to) { double inner(int it) => ((to - from) / (pointCount - 1) * it).RealPart.EDecimal.ToDouble(); Clear(); BuildData(inner, it => func.Call(new Complex((double)inner(it), 0)).Real); destination.plt.PlotScatter(dataX, dataY); destination.Render(); }
/// <summary>Plots from an expression over variable x. /// It's better to run this function of already compiled function</summary> /// <param name="expr">Expression to build</param> /// <param name="from">Low bound</param> /// <param name="to">High bound</param> public void PlotScatter(Entity expr, Entity.Variable x, Entity.Number.Complex from, Entity.Number.Complex to) => PlotScatter(expr.Compile(x), from, to);