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 WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- double A, B, h, x = 0, y = 0, t = 0;
- A = Convert.ToDouble(textBox1.Text);
- B = Convert.ToDouble(textBox2.Text);
- h = Convert.ToDouble(textBox3.Text);
- String str = comboBox1.SelectedItem.ToString();
- MessageBox.Show(str);
- if (str == "Коло")
- {
- for(t = A; t <= B + 0.1 * h; t += h)
- {
- x = Math.Sin(t);
- y = Math.Cos(t);
- chart1.Series[0].Points.AddXY(x, y);
- x = Math.Round(x, 2); y = Math.Round(y, 2);
- listBox1.Items.Add((x + "\t\t " + y));
- }
- }
- if (str == "Спіраль")
- {
- for (t = A; t <= B + 0.1 * h; t += h)
- {
- x = Math.Sin(t)*t;
- y = Math.Cos(t)*t;
- chart1.Series[0].Points.AddXY(x, y);
- x = Math.Round(x, 5); y = Math.Round(y, 5);
- listBox1.Items.Add((x + "\t\t " + y));
- }
- }
- if (str == "Дельтоїда")
- {
- for (t = A; t <= B + 0.1 * h; t += h)
- {
- x = Math.Cos(t)*2 + Math.Cos(t + t);
- y = Math.Sin(t)*2 - Math.Sin(t + t);
- chart1.Series[0].Points.AddXY(x, y);
- x = Math.Round(x, 2); y = Math.Round(y, 2);
- listBox1.Items.Add((x + "\t\t " + y));
- }
- }
- if (str == "Астроїда")
- {
- for (t = A; t <= B + 0.1 * h; t += h)
- {
- x = (Math.Sin(t) * Math.Sin(t) * Math.Sin(t))*2;
- y = (Math.Cos(t) * Math.Cos(t) * Math.Cos(t))*2;
- chart1.Series[0].Points.AddXY(x, y);
- x = Math.Round(x, 2); y = Math.Round(y, 2);
- listBox1.Items.Add((x + "\t\t " + y));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement