public MathPoint[] Get_movable_coordinates() { MathPoint[] points = new MathPoint[] { new MathPoint(0,1) }; return points; }
public MathPoint[] Get_oil_slick_coordinates() { MathPoint[] points = new MathPoint[] { new MathPoint(-1,-1), new MathPoint(-1.25,-1), new MathPoint(-1, -0.75) }; return points; }
public DataModel(IMathematicalModel _model) { model = _model; int number = 400; grid = new MathPoint[(int)(Math.Sqrt(number)), (int)(Math.Sqrt(number))]; double h = 4 / Math.Sqrt(number); for (int i = 0; i < Math.Sqrt(number); ++i) for (int j = 0; j < Math.Sqrt(number); ++j) grid[i,j] = new MathPoint(-2 + i * h, -2 + j * h); }
public static void CalculateCoefficients(MathPoint p0, MathPoint p1, MathPoint p2, MathPoint p3) { X[3] = ((-1) * p0.X + 3 * (p1.X - p2.X) + p3.X) / 6.0; X[2] = (p0.X - 2 * p1.X + p2.X) / 2.0; X[1] = (p2.X - p0.X) / 2.0; X[0] = (p0.X + 4 * p1.X + p2.X) / 6.0; Y[3] = ((-1) * p0.Y + 3 * (p1.Y - p2.Y) + p3.Y) / 6.0; Y[2] = (p0.Y - 2 * p1.Y + p2.Y) / 2.0; Y[1] = (p2.Y - p0.Y) / 2.0; Y[0] = (p0.Y + 4 * p1.Y + p2.Y) / 6.0; }
private void Draw_points_on_canvas(MathPoint[] points, System.Windows.Media.Brush brush, double width, double height) { for (int i = 0; i < points.Length; ++i) { Ellipse ellipse = new Ellipse() { Height = width, Width = height, Stroke = brush, StrokeThickness = 5 }; canvas.Children.Add(ellipse); Canvas.SetLeft(ellipse, Transfer_for_x_coordinate(points[i].X)); Canvas.SetTop(ellipse, Transfer_for_y_coordinate(points[i].Y)); } }
public MathPoint[] Get_coordinates_of_points_of_collocation() { var points = new MathPoint[NumberOfDiscreteFeatures - 1]; if (NumberOfDiscreteFeatures == 3) { points[0] = new MathPoint(0, 0); points[1] = new MathPoint(0.25, 0.5); } else { var discreteFeatures = Get_coordinates_of_discrete_features(); for (int i = 0; i < discreteFeatures.Length - 1; ++i) points[i] = new MathPoint(discreteFeatures[i + 1].X == discreteFeatures[i].X ? discreteFeatures[i].X : (discreteFeatures[i + 1].X + discreteFeatures[i].X) / 2.0, discreteFeatures[i + 1].Y == discreteFeatures[i].Y ? discreteFeatures[i].Y : (discreteFeatures[i + 1].Y + discreteFeatures[i].Y) / 2.0); } return points; }
public MathPoint[] Get_barrier_coordinates() { MathPoint[] points = new MathPoint[] { new MathPoint(0,-1), new MathPoint(0,-0.75), new MathPoint(0,-0.5), new MathPoint(0,-0.25), new MathPoint (0,0), new MathPoint (0,0.25), new MathPoint(0,0.5), new MathPoint(0,0.75), new MathPoint(0,1), new MathPoint(0.25,1), new MathPoint(0.5, 1), new MathPoint(1,1) }; return points; }
public MathPoint[] Get_coordinates_of_discrete_features() { var points = new MathPoint[NumberOfDiscreteFeatures]; if (NumberOfDiscreteFeatures == 3) { points[0] = new MathPoint(0, -0.5); points[1] = new MathPoint(0, 0.5); points[2] = new MathPoint(0.5, 0.5); } else { int numberTop = (int)(NumberOfDiscreteFeatures * 2) / 3; double hTop = 1.0 / (double)(numberTop); int numberLeft = NumberOfDiscreteFeatures - numberTop; double hLeft = 0.5 / (double)(numberLeft); for (int i = 0; i < numberTop; ++i) points[i] = new MathPoint(0, -0.5 + i * hTop); for (int i = 0; i < numberLeft; ++i) points[i + numberTop] = new MathPoint(0.0 + i * hLeft, 0.5); } return points; }
public MathVector(MathPoint _Beginning, MathPoint _End) { Beginning = _Beginning.Clone() as MathPoint; End = _End.Clone() as MathPoint; }
public MathVector() { Beginning = new MathPoint(); End = new MathPoint(); }