Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Проект_4_3_Лаб
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. private void button2_Click(object sender, EventArgs e)
  20. {
  21. Close();
  22. }
  23.  
  24. double storona (double a, double b, double c)
  25. {
  26. double p = (a + b + c) / 2d;
  27. return (2 * Math.Atan(Math.Sqrt(((p - a) * (p - b)) / p * (p - c))));
  28.  
  29. }
  30.  
  31. private void button1_Click(object sender, EventArgs e)
  32. {
  33. double a = Convert.ToDouble(textBox1.Text);
  34. double b = Convert.ToDouble(textBox2.Text);
  35. double c = Convert.ToDouble(textBox3.Text);
  36.  
  37. double A = storona (c, b, a);
  38. double B = storona (c, a, b);
  39. double C = storona (a, b, c);
  40.  
  41. textBox4.Text = Convert.ToString(A);
  42. textBox5.Text = Convert.ToString(B);
  43. textBox6.Text = Convert.ToString(C);
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement