Example #1
0
        public void PlotLinear(int x, float amplitude, int k, int i, EllipseGeometry firstEllipseGeometry, int c)
        {
            // The point (0,0) for the amplitude y and the pixelrow x is the bottom left corner.
            // The point (0,0) for the C# methods is the top left corner.
            double y;

            // stetige plots
            //y = (double)((amplitude - this.offset + 0.00001) * this.scale);
            y = (double)((amplitude - this.offset) * this.scale);

            EllipseGeometry secondEllipseGeometry = firstEllipseGeometry.Clone();
            LineGeometry    myLineGeometry        = new LineGeometry();
            GeometryGroup   gg = new GeometryGroup();

            myLineGeometry.StartPoint    = new Point(this.xTemp, this.ImageWidth - this.yTemp[c]);
            myLineGeometry.EndPoint      = new Point(x, this.ImageWidth - y);
            secondEllipseGeometry.Center = myLineGeometry.EndPoint;
            gg.Children.Add(secondEllipseGeometry);
            if (k > 0)
            {
                gg.Children.Add(myLineGeometry);
            }
            this.geometrygroup.Children.Add(gg);
            this.xTemp    = x;
            this.yTemp[c] = y;
        }