Exemplo n.º 1
0
		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);

		}
Exemplo n.º 2
0
		private void PlotConstantFunction(IChartAdapter2D adapter, Implicit2DParameters implicitParameters)
		{
			ConstantFunctionPlotter plotter = 
				new ConstantFunctionPlotter((Constant)implicitParameters.Function);
			double[] result = null;
			//result = plotter.Plot()

			adapter.Plot(result, _series);

		}