Esempio n. 1
0
        public void ProduceLagrange_Test()
        {
            var plotter = new Plotter();

            DataPoint[] dataPoints = new DataPoint[3];
            dataPoints[0] = new DataPoint(0, 15);
            dataPoints[1] = new DataPoint(10, 3);
            dataPoints[2] = new DataPoint(20, 30);

            var function = plotter.CreatePolynomialThroughPoints(dataPoints);

            Assert.AreEqual(15d, function.Calculate(0), 0);
        }