Esempio n. 1
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public TestAxes3D()
			: base()
		{

			// make the array data set
			arrayData = new ArrayDataSet(1024, 4);
			Random rand = new Random();
			for (int r = 0; r < arrayData.NumRows; r++)
			{
				arrayData[r, 0] = rand.NextDouble() * 2 * Math.PI;
				arrayData[r, 1] = rand.NextDouble() * Math.PI;
				arrayData[r, 2] = Math.Sin(arrayData[r, 0]) * Math.Cos(arrayData[r, 1]);
				arrayData[r, 3] = arrayData[r, 0] + arrayData[r, 1];
			}
			arrayData[512, 2] = Double.NaN; // just to test out the handling of NaN
			arrayData.SetColumnName(0, "x");
			arrayData.SetColumnName(1, "y");
			arrayData.SetColumnName(2, "sin(x)*cos(y)");
			arrayData.SetColumnName(3, "x + y");
						

			// add an axes box and plot
			pointPlot = new PointPlot(this);
			pointPlot.DataSet = arrayData;
			pointPlot.Shape = PlotShape.Square;
		}
Esempio n. 2
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public TestAxes2D()
			: base()
		{

			// make the array data set
			arrayData = new ArrayDataSet(1024*1, 4);
			double dt = 0.02; // time step
			for (int r = 0; r < arrayData.NumRows; r++)
			{
				double t = r * dt;
				arrayData[r, 0] = t;
				arrayData[r, 1] = Math.Sin(t) * 10;
				arrayData[r, 2] = Math.Cos(t*2) * t;
				arrayData[r, 3] = 0;
			}
			arrayData.SetColumnName(0, "time");
			arrayData.SetColumnName(1, "10*sin(t)");
			arrayData.SetColumnName(2, "cos(2t)*t");
			arrayData.SetColumnName(3, "zero");
						

			// add a plot
			pointPlot1 = new PointPlot(this);
			pointPlot1.DataSet = arrayData;
			pointPlot1.Columns[2] = 1;
			pointPlot1.Shape = PlotShape.Square;
			pointPlot1.LineVisible = true;
			
			// add a plot
			pointPlot2 = new PointPlot(this);
			pointPlot2.DataSet = arrayData;
			pointPlot2.Shape = PlotShape.Circle;
			pointPlot2.Color = new Color(0, 1f, 0);
			pointPlot2.LineVisible = true;
			pointPlot2.LineWidth = 1;
		}