Skip to content

Instantly share code, notes, and snippets.

Created September 21, 2017 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5b18aefaaa28c148e02a12178360cc9b to your computer and use it in GitHub Desktop.
Save anonymous/5b18aefaaa28c148e02a12178360cc9b to your computer and use it in GitHub Desktop.
ccc
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 WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double a3, b3, c3;
// a = b = c1 = 0;
a3 = Convert.ToDouble(textBox1.Text);
b3 = Convert.ToDouble(textBox2.Text);
c3 = Convert.ToDouble(textBox3.Text);
chart1.Series[0].Points.Clear(); // 清除原始 Diagram before 進入 Loop
for (double z2 = -10; z2 <= 10; z2 = z2 + 0.1) //修改變數名稱
{
double Ans;
a3 = b3 = c3 = 0;
Ans = 1 / (1 + Math.Pow((Math.Abs((z2 - c3) / a3)), 2 * b3));
chart1.Series[0].Points.AddXY(z2, Ans);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment