MainWindow.xaml.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace WpfApp1
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для MainWindow.xaml
  19. /// </summary>
  20. public partial class MainWindow : Window
  21. {
  22. public MainWindow()
  23. {
  24. InitializeComponent();
  25. }
  26. private void Button_Click(object sender, RoutedEventArgs e)
  27. {
  28. double x12 = 0;
  29. double xn2= 20;
  30. double deltaX2 = 2;
  31. double a = 3.9;
  32. result2_txt.Text = string.Format("{0,-10}{1}\n", "x", "y");
  33. for (double x2 = x12; x2 <= xn2; x2 += deltaX2)
  34. {
  35. double y2 = Math.Sin(x2) * 1 / Math.Sqrt(a * Math.Pow(x2, 2)) + Math.Exp(x2);
  36. result2_txt.Text += string.Format("{0,-10:F2}{1:F6}\n", x2, y2);
  37. }
  38. }
  39. private void Button_Click_1(object sender, RoutedEventArgs e)
  40. {
  41. double x1 = 0;
  42. double xn = 20;
  43. double deltaX = 2;
  44. double a = 3.9;
  45. double x = x1;
  46. result_txt.Text = string.Format("{0,-10}{1}\n", "x", "y");
  47. while (x <= xn)
  48. {
  49. double y = Math.Sin(x) * 1 / Math.Sqrt(a * Math.Pow(x, 2)) + Math.Exp(x);
  50. result_txt.Text += string.Format("{0,-10:F2}{1:F6}\n", x, y);
  51. x += deltaX;
  52. }
  53. }
  54. private void Button_Click_2(object sender, RoutedEventArgs e)
  55. {
  56. Discript a = new Discript();
  57. this.Hide();
  58. a.ShowDialog();
  59. }
  60. private void Button_Click_3(object sender, RoutedEventArgs e)
  61. {
  62. System.Diagnostics.Process.Start(@"M:\Функция\WpfApp1\Folder\Справка.pdf");
  63. }
  64. }
  65. }