private void GenerateXYData(NPointSeries series) { series.ClearDataPoints(); for (int i = 0; i < 500; i++) { double u1 = Random.NextDouble(); double u2 = Random.NextDouble(); if (u1 == 0) { u1 += 0.0001; } if (u2 == 0) { u2 += 0.0001; } double z0 = Math.Sqrt(-2 * Math.Log(u1)) * Math.Cos(2 * Math.PI * u2); double z1 = Math.Sqrt(-2 * Math.Log(u1)) * Math.Sin(2 * Math.PI * u2); series.XValues.Add(z0); series.Values.Add(z1); } }
void OnDragPlaneChanged(object sender, EventArgs e) { List <NVector3DD> intersections3D = m_SurfaceSeries.Get3DIntersections(new NPointD(m_DragPlane.PointA.X, m_DragPlane.PointA.Z), new NPointD(m_DragPlane.PointB.X, m_DragPlane.PointB.Z)); List <NVector2DD> intersections2D = m_SurfaceSeries.Get2DIntersections(new NPointD(m_DragPlane.PointA.X, m_DragPlane.PointA.Z), new NPointD(m_DragPlane.PointB.X, m_DragPlane.PointB.Z)); m_CrossSection3DSeries.ClearDataPoints(); for (int i = 0; i < intersections3D.Count; i++) { NVector3DD intersection3D = intersections3D[i]; m_CrossSection3DSeries.Values.Add(intersection3D.Z + 1); m_CrossSection3DSeries.XValues.Add(intersection3D.X); m_CrossSection3DSeries.ZValues.Add(intersection3D.Y); } m_CrossSection2DSeries.ClearDataPoints(); for (int i = 0; i < intersections2D.Count; i++) { NVector2DD intersection2D = intersections2D[i]; m_CrossSection2DSeries.Values.Add(intersection2D.Y); m_CrossSection2DSeries.XValues.Add(intersection2D.X); } nChartControl1.Refresh(); }
private void GenerateXYData(NPointSeries point) { point.ClearDataPoints(); int numberOfGroups = NumberOfPointGroupsDropDownList.SelectedIndex + 1; int numberOfPointsInGroup = (NumberOfPointsInGroupDropDownList.SelectedIndex + 1) * 10000; for (int i = 0; i < numberOfGroups; i++) { AddPointGroup(point, numberOfPointsInGroup); } }