|
@@ -0,0 +1,53 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.ComponentModel;
|
|
|
+using System.Data;
|
|
|
+using System.Drawing;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Windows.Forms;
|
|
|
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
|
+
|
|
|
+namespace Ul_3
|
|
|
+{
|
|
|
+ public partial class Form1 : Form
|
|
|
+ {
|
|
|
+ public Form1()
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void button1_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ double x = double.Parse(textBox1.Text);
|
|
|
+ double y = double.Parse(textBox2.Text);
|
|
|
+
|
|
|
+ // решаем уравнение
|
|
|
+ double result = SolveEquation(x, y);
|
|
|
+
|
|
|
+ // выводим результат
|
|
|
+ textBox3.Text = result.ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ private double SolveEquation(double x, double y)
|
|
|
+ {
|
|
|
+ double result = 0;
|
|
|
+
|
|
|
+ if (Math.Abs(x - y) < 0.0001)
|
|
|
+ {
|
|
|
+ result = Math.Pow(Math.Sin(x), 2) + Math.Sin(y);
|
|
|
+ }
|
|
|
+ else if (x - y > 0)
|
|
|
+ {
|
|
|
+ result = Math.Cos(x) + Math.Cos(y);
|
|
|
+ }
|
|
|
+ else if (x - y < 0)
|
|
|
+ {
|
|
|
+ result = y - Math.Pow(Math.Tan(x), 2) + Math.Tan(y);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|