Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- namespace Laba3
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- double Vvod(TextBox t)
- {
- return Convert.ToDouble(t.Text);
- }
- void Vivod(TextBox t, double z)
- {
- t.Text = z.ToString("F5");
- }
- double Duga1(double r1, double a)
- {
- double str = 2 * Math.PI * r1 * (a / 360);
- return str;
- }
- void Dlina(double r1, double a, double r2, double b, double r3, double c, ref double l1, ref double l2, ref double l3)
- {
- l1 = Duga1(r1, a);
- l2 = Duga1(r2, b);
- l3 = Duga1(r3, c);
- }
- private void Button1_Click(object sender, EventArgs e)
- {
- double r1, r2, r3, a, b, c;
- double l1 = 0;
- double l2 = 0;
- double l3 = 0;
- r1 = Vvod(textBox1);
- r2 = Vvod(textBox3);
- r3 = Vvod(textBox5);
- a = Vvod(textBox2);
- b = Vvod(textBox4);
- c = Vvod(textBox6);
- Dlina(r1, a, r2, b, r3, c, ref l1, ref l2, ref l3);
- Vivod(textBox7, l1);
- Vivod(textBox8, l2);
- Vivod(textBox9, l3);
- }
- private void Button2_Click(object sender, EventArgs e)
- {
- Form1 f1 = new Form1();
- this.Hide();
- f1.Show();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement