public static FuncUniformDataSource3D<Vector3D> CreateTangentPotentialField(PotentialField3D potentialField, int width = 100, int height = 100, int depth = 100) { FuncUniformDataSource3D<Vector3D> dataSource = new FuncUniformDataSource3D<Vector3D>( (i, j, k) => potentialField.GetTangentVector(new Point3D(i / (double)width, j / (double)height, k / (double)depth)), width: width, height: height, depth: depth); return dataSource; }
public static FuncUniformDataSource3D <Vector3D> CreateTangentPotentialField(PotentialField3D potentialField, int width = 100, int height = 100, int depth = 100) { FuncUniformDataSource3D <Vector3D> dataSource = new FuncUniformDataSource3D <Vector3D>( (i, j, k) => potentialField.GetTangentVector(new Point3D(i / (double)width, j / (double)height, k / (double)depth)), width: width, height: height, depth: depth); return(dataSource); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { PotentialField3D field = new PotentialField3D(); field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2); field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3); field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10); field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5); dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200); DataContext = dataSource3D; sectionChartX.ThirdCoordinate = 0.0001; sectionChartY.ThirdCoordinate = 0.0001; sectionChartZ.ThirdCoordinate = 0.0001; UpdateSelectedTab(); PotentialFieldChart3D fieldChart = new PotentialFieldChart3D { Field = field }; viewport.Children.Insert(0, fieldChart); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { PotentialField3D field = new PotentialField3D(); field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2); field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3); field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10); field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5); dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200); DataContext = dataSource3D; sectionChartX.ThirdCoordinate = 0.0001; sectionChartY.ThirdCoordinate = 0.0001; sectionChartZ.ThirdCoordinate = 0.0001; UpdateSelectedTab(); PotentialFieldChart3D fieldChart = new PotentialFieldChart3D { Field = field }; viewport.Children.Insert(0, fieldChart); }