Beispiel #1
0
        private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            double shiftvalue = SliderX.Value;

            if (rectangle != null)
            {
                shiftvalue -= rectangle.Left;
                rectangle.shiftX(shiftvalue);
                MainCanvas.Children.Clear();
                drawRectangle(rectangle);
                showRectangleInfo(rectangle);
            }

            if (triangle != null)
            {
                shiftvalue -= triangle.Left;
                triangle.shiftX(shiftvalue);
                MainCanvas.Children.Clear();
                drawTriangle(triangle);
                showTriangleInfo(triangle);
            }

            if (point != null)
            {
                shiftvalue -= point.getTrueX();
                point.shiftX(shiftvalue);
                MainCanvas.Children.Clear();
                drawPoint(point);
                pointX.Text = "X: " + point.getX().ToString("0.00");
            }
        }
Beispiel #2
0
        public double getDistance(Point2D OtherPoint)
        {
            double distance = Sqrt(Pow((x - OtherPoint.getTrueX()), 2) + Pow((y - OtherPoint.getTrueY()), 2));

            return(distance);
        }