private void PlotConstantFunction(IChartAdapter2D adapter, Explicit2DParameters explicitParameters) { ConstantFunctionPlotter plotter = new ConstantFunctionPlotter((Constant)explicitParameters.Function); double[] result = null; switch (explicitParameters.PlotMode) { case PlotMode.ByNumPoints: result = plotter.Plot(explicitParameters.Min, explicitParameters.Max, explicitParameters.NumPoints); break; //case PlotMode.ByClientArea: // throw new NotSupportedException("This type of PlotMode not supported"); case PlotMode.ByStep: result = plotter.Plot(explicitParameters.Min, explicitParameters.Max, explicitParameters.Step); break; } if (!_automaticMode) { double[] tempArray = (double[])result.Clone(); Array.Sort(tempArray); double min = tempArray[0]; Array.Reverse(tempArray); double max = tempArray[0]; adapter.SetAxes(explicitParameters.Min, explicitParameters.Max, min, max); } adapter.Plot(result, _series); }
/// <summary>Initializes a new instance of the NugenCCalcComponent2D class</summary> public NugenCCalc2D() { /// /// Required for Windows.Forms Class Composition Designer support /// _functionParameters = new Explicit2DParameters(); InitializeComponent(); InitComponent(); }