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)
- {
- richTextBox1.Clear();
- chart1.Series[0].Points.Clear();
- chart1.Series[1].Points.Clear();
- double a, b, h, x, y, z;
- a = Convert.ToDouble(textBox1.Text);
- b = Convert.ToDouble(textBox2.Text);
- h = Convert.ToDouble(textBox3.Text);
- for (x=a; x<=b+0.1*h; x += h)
- {
- y = Math.Pow(Math.Sin(x),2)*Math.Cos(x-3.14);
- z = Math.Sin(x)/Math.Pow(x,2);
- chart1.Series[0].Points.AddXY(x, y);
- chart1.Series[1].Points.AddXY(x, z);
- richTextBox1.Text += "x= " + x.ToString("0.00") + "\ty= " + y.ToString("0.00") + "\tz= " + z.ToString("0.00") + Environment.NewLine;
- }
- }
- private void chart1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement