Ejemplo n.º 1
0
 private void showTriangleInfo(Triangle triangle)
 {
     triangleArea.Text      = "Площадь: " + triangle.getArea().ToString("0.00");
     trianglePerimeter.Text = "Периметр: " + triangle.getPerimeter().ToString("0.00");
     triangleCoords.Text    = "(" + triangle.point1.getX().ToString("0") + ";" + triangle.point1.getY().ToString("0") + "),"
                              + "(" + triangle.point2.getX().ToString("0") + ";" + triangle.point2.getY().ToString("0") + "),"
                              + "(" + triangle.point3.getX().ToString("0") + ";" + triangle.point3.getY().ToString("0") + ")";
 }
Ejemplo n.º 2
0
        private void TriangleBt_Click(object sender, RoutedEventArgs e)
        {
            pointInfo.Visibility        = Visibility.Hidden;
            rectangleInfo.Visibility    = Visibility.Hidden;
            rectangleOptions.Visibility = Visibility.Hidden;
            triangleInfo.Visibility     = Visibility.Visible;

            MainCanvas.Children.Clear();
            this.triangle  = Generate.initTriangle();
            this.point     = null;
            this.rectangle = null;

            drawTriangle(this.triangle);

            triangleArea.Text      = "Площадь " + triangle.getArea().ToString("#.##");
            trianglePerimeter.Text = "Периметр " + triangle.getPerimeter().ToString("#.##");
        }