示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            var funkcija = new Funkcija(0, 5, 5);

            funkcija.GetAllPoints(false);
            var splainas = new KubinisSplainas(funkcija, 2.5);

            splainas.SprestiSistema();
            splainas.Get_Coef();
            splainas.Get_Spline_Points();

            chart2.Series.Clear();
            chart2.Series.Add("Points");
            chart2.Series.Add("Function");
            chart2.Series.Add("Spline");
            chart2.Series[0].ChartType = SeriesChartType.Point;
            chart2.Series[1].ChartType = SeriesChartType.Line;
            chart2.Series[2].ChartType = SeriesChartType.Spline;
            chart2.Series[0].Color     = Color.Blue;
            chart2.Series[1].Color     = Color.Red;
            chart2.Series[2].Color     = Color.Orange;

            foreach (var point in funkcija.Points)
            {
                chart2.Series[0].Points.AddXY(point.X, point.Y);
                chart2.Series[1].Points.AddXY(point.X, point.Y);
            }

            foreach (var point in splainas.SplainoReiksmes)
            {
                chart2.Series[2].Points.AddXY(point.X, point.Y);
            }

            label3.Text = "Funkcijos artinio reiksme taske " + splainas.Artinys + " yra " + splainas.CalculateSplineValue(splainas.Artinys);
        }
 public KubinisSplainas(Funkcija funkcija, double artinys)
 {
     Funkcija        = funkcija;
     Artinys         = artinys;
     SplainoReiksmes = new List <Point>();
 }