Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- namespace WindowsFormsApplication2
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- double x = Convert.ToDouble(textBox1.Text),
- y = Convert.ToDouble(textBox2.Text),
- r = Convert.ToDouble(textBox3.Text),
- a = Convert.ToDouble(textBox5.Text),
- b = Convert.ToDouble(textBox6.Text);
- if (((x >= -r) && (x <= 0) && (y <= 0) && (y >= -b) && (Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2)) <= r)) | ((x <= a) && (x >= r) && (y >= 0) && (y <= -b) && (Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2)) <= r)))
- {
- textBox4.Text = "Точка (" + x.ToString() + ", " + y.ToString() + ") входит в область";
- } else {
- textBox4.Text = "Точка (" + x.ToString() + ", " + y.ToString() + ") не входит в область";
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- textBox1.Text = "";
- textBox2.Text = "";
- textBox3.Text = "";
- textBox4.Text = "";
- }
- private void button3_Click(object sender, EventArgs e)
- {
- Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement