This repository has been archived by the owner on Nov 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
98 lines (90 loc) · 3.25 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SNAE
{
public partial class MainWindow : Window
{
public MainWindow() => InitializeComponent();
private void Window_MouseLeftButtonDown(object sender, RoutedEventArgs e) => this.DragMove();
private void BClose_Click(object sender, RoutedEventArgs e) => this.Close();
private void BMinimize_Click(object sender, RoutedEventArgs e) => this.WindowState = WindowState.Minimized;
double f(double x)
{
return (x*x) - Math.Cos(x);
//return 2 * Math.Log10(x) - x / 2 + 1;
}
double n1(double x, double y)
{
return Math.Sin(y) + 2 * x - 2;
}
double n2(double x, double y)
{
return Math.Cos(x - 1) + y - 0.7;
}
private void BStart_Click(object sender, RoutedEventArgs e)
{
double left = Convert.ToDouble(TBLeft.Text);
double right = Convert.ToDouble(TBRight.Text);
double x_prev = Convert.ToDouble(TBxa.Text);
double x_curr = Convert.ToDouble(TBxb.Text);
double left_expression = f(left);
double eps = Convert.ToDouble(TBEps.Text);
double eps2 = Convert.ToDouble(TBEps_seidel.Text);
double eps3 = Convert.ToDouble(TBEps_newton.Text);
double h;
int iter = 0;
}
private void CBBisection_Checked(object sender, RoutedEventArgs e)
{
CBSecant.IsEnabled = false;
CBNewton.IsEnabled = false;
Diapazon.Visibility = Visibility;
}
private void CBBisection_Unchecked(object sender, RoutedEventArgs e)
{
CBSecant.IsEnabled = true;
CBNewton.IsEnabled = true;
Diapazon.Visibility = Visibility.Hidden;
}
private void CBSecant_Checked(object sender, RoutedEventArgs e)
{
CBBisection.IsEnabled = false;
CBNewton.IsEnabled = false;
Diapazon2.Visibility = Visibility;
}
private void CBSecant_Unchecked(object sender, RoutedEventArgs e)
{
CBBisection.IsEnabled = true;
CBNewton.IsEnabled = true;
Diapazon2.Visibility = Visibility.Hidden;
}
private void CBNewton_Checked(object sender, RoutedEventArgs e)
{
CBBisection.IsEnabled = false;
CBSecant.IsEnabled = false;
Diapazon3.Visibility = Visibility;
GRID1.Visibility = Visibility.Hidden;
GRID1_Copy.Visibility = Visibility;
}
private void CBNewton_Unchecked(object sender, RoutedEventArgs e)
{
CBBisection.IsEnabled = true;
CBSecant.IsEnabled = true;
Diapazon3.Visibility = Visibility.Hidden;
GRID1_Copy.Visibility = Visibility.Hidden;
GRID1.Visibility = Visibility;
}
}
}