Advertisement
Guest User

Табулирование 21

a guest
Jan 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 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.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             richTextBox1.Clear();
  23.             chart1.Series[0].Points.Clear();
  24.             chart1.Series[1].Points.Clear();
  25.             double a, b, h, x, y, z;
  26.             a = Convert.ToDouble(textBox1.Text);
  27.             b = Convert.ToDouble(textBox2.Text);
  28.             h = Convert.ToDouble(textBox3.Text);
  29.             for (x=a; x<=b+0.1*h; x += h)
  30.             {
  31.                 y = Math.Pow(Math.Sin(x),2)*Math.Cos(x-3.14);
  32.                 z = Math.Sin(x)/Math.Pow(x,2);
  33.                 chart1.Series[0].Points.AddXY(x, y);
  34.                 chart1.Series[1].Points.AddXY(x, z);
  35.                 richTextBox1.Text += "x= " + x.ToString("0.00") + "\ty= " + y.ToString("0.00") + "\tz= " + z.ToString("0.00") + Environment.NewLine;
  36.             }
  37.         }
  38.  
  39.         private void chart1_Click(object sender, EventArgs e)
  40.         {
  41.  
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement