Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.