public void PolynomFunction() { lagrangePolynomial = new Lagrange(nodes.ToArray(), values.ToArray()); string result = MakeNormalForm(lagrangePolynomial.LagrangePolynomial()); label1.Text = "Polynom: " + result; }
private void buttonCheck_Click(object sender, EventArgs e) { try { if (lagrangePolynomial != null) { double checkResult = lagrangePolynomial.LagrangePolynomial().Calculate(double.Parse(textBoxCheck.Text)); labelCheck.Text = "Check result: " + Math.Round(checkResult, 3); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }