private void button1_Click(object sender, EventArgs e) { if (NA.Text != "" && NB.Text != "" && NC.Text != "" && ND.Text != "") { double a = double.Parse(NA.Text, CultureInfo.InvariantCulture.NumberFormat); double b = double.Parse(NB.Text, CultureInfo.InvariantCulture.NumberFormat); double c = double.Parse(NC.Text, CultureInfo.InvariantCulture.NumberFormat); double d = double.Parse(ND.Text, CultureInfo.InvariantCulture.NumberFormat); N = new Planeq(a, b, c, d); label1.Text = "Текущая плоскость: " + a + "x+" + b + "y+" + c + "z+" + d + "=0"; } else { Answer.Text = "Ошибка ввода"; } }
private void button2_Click(object sender, EventArgs e) { if (N.och == false) { if (PA.Text != "" && PB.Text != "" && PC.Text != "" && PD.Text != "") { double a = double.Parse(PA.Text, CultureInfo.InvariantCulture.NumberFormat); double b = double.Parse(PB.Text, CultureInfo.InvariantCulture.NumberFormat); double c = double.Parse(PC.Text, CultureInfo.InvariantCulture.NumberFormat); double d = double.Parse(PD.Text, CultureInfo.InvariantCulture.NumberFormat); Planeq P = new Planeq(a, b, c, d); string s = N.ratio_of_planes(P); Answer.Text = s; } else { Answer.Text = "Ошибка ввода"; } } else { Answer.Text = "Не задана текущая плоскость"; } }
public Form1() { InitializeComponent(); N = new Planeq(); }