Пример #1
0
		private void PlotExplicitFunction(IChartAdapter2D adapter, Implicit2DParameters implicitParameters)
		{
			Explicit2DFunctionPlotter plotter = 
				new Explicit2DFunctionPlotter((Explicit2DFunction)implicitParameters.Function);

			double[] result = null;

			plotter.Plot(implicitParameters.PointA, implicitParameters.PointB, implicitParameters.AreaSize);

			adapter.Plot(result, _series);
		}
Пример #2
0
		private void PlotExplicitFunction(IChartAdapter2D adapter, Explicit2DParameters explicitParameters)
		{
			Explicit2DFunctionPlotter plotter = 
				new Explicit2DFunctionPlotter((Explicit2DFunction)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);
			}

			if (explicitParameters.IsPolar)
			{
				adapter.PlotPolar(result, 0);
			}
			else
			{
				adapter.Plot(result, _series);
			}
		}