/// <summary> /// Constructor for a move with multi-dimensional array /// </summary> /// <param name="move">move</param> public MovingVector(MovingCoordinates move) { if (move.Steps.Dimension > 1) { this.dim = Convert.ToUInt32(move.Steps.Dimension); this.values = new List <double>(); double start = move.Vector.From.Value; double end = move.Vector.To.Value; double step = move.Steps.Value; for (double v = start; v < end; v += step) { this.values.Add(v); } MovingCoordinates nextMove = new MovingCoordinates(move.Vector.Euclidian, move.Steps.Euclidian); this.position = new MovingVector(nextMove); } else { this.dim = 1; this.values = new List <double>(); double start = move.Vector.From.Value; double end = move.Vector.To.Value; double step = move.Steps.Value; for (double v = start; v < end; v += step) { this.values.Add(v); } this.position = null; } }
/// <summary> /// Constructor as a coordinate system /// </summary> public DataTracer2D() : base(typeof(CoordinateSystem)) { this.drawer = new DrawingVisual(); this.from = new Coordinates(-10.0d, -10.0d); this.to = new Coordinates(10.0d, 10.0d); this.intervals = new Coordinates[2]; this.intervals[0] = new Coordinates(1.0d, 1.0d); this.intervals[1] = new Coordinates(0.1d, 0.1d); Vector v = new Vector(this.from, this.to); MovingCoordinates mc = new MovingCoordinates(v, this.intervals[0]); this.sys = new CoordinateSystem(mc); this.function = new Sum(new Multiplication(new NumericValue(2.0d), new UnknownTerm("x")), new NumericValue(2.0d)); for (double d = this.from.Value; d <= this.to.Value; d += this.intervals[0].Value) { try { this.sys.Add(this.function, new string[] { "x", "y" }, new double[] { d }); } catch (IndexOutOfRangeException) { } } }
/// <summary> /// Default Constructor /// </summary> /// <param name="mc">Moving Coordinates</param> /// <param name="column">column size</param> /// <param name="row">row size</param> /// <param name="depth">depth</param> /// <param name="p">pixels size</param> public DistributedTracer2D(MovingCoordinates mc, uint column, uint row, uint depth, Size p) { this.bounds = mc; this.boundsChanged = true; this.columnSize = column; this.rowSize = row; this.maxDepth = depth; this.pixels = p; this.visualLocation = new Point(0.0d, 0.0d); this.visualSize = new Size(200.0d, 200.0d); this.areas = this.ComputeCuttedAreas(); this.imageSize = new Size(this.areas[0, 0].Width * this.columnSize, this.areas[0, 0].Height * this.rowSize); ra = new Random(); }
/// <summary> /// Dessine la graduation /// </summary> protected void DrawGrad() { Vector v = new Vector(this.from, this.to); MovingCoordinates mc = new MovingCoordinates(v, this.intervals[0]); CoordinateSystem[] axes = new CoordinateSystem[3]; axes[0] = new CoordinateSystem(mc); mc = new MovingCoordinates(v, this.intervals[1]); axes[1] = new CoordinateSystem(mc); DrawingContext dc = this.drawer.RenderOpen(); Brush b1 = new SolidColorBrush(Colors.BurlyWood); Pen p1 = new Pen(b1, 0.1d); this.DrawLines(this.from, this.to, this.intervals[0], dc, p1); Pen p2 = new Pen(b1, 0.01d); this.DrawLines(this.from.Euclidian, this.to.Euclidian, this.intervals[0].Euclidian, dc, p2); }
/// <summary> /// Coordinate system with a limit and a step /// </summary> /// <param name="m">move</param> public CoordinateSystem(MovingCoordinates m) { this.move = m; this.dim = this.move.Steps.Dimension; this.coords = new List <Coordinates>(); }