Ejemplo n.º 1
0
        private static void Demo_Interpolation()
        {
            var knownx = new[] {
                1D, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };

            var knowny = new[] {
                0.841470985, 0.909297427, 0.141120008, -0.756802495, -0.958924275,
                -0.279415498, 0.656986599, 0.989358247, 0.412118485, -0.544021111
            };

            var cur1 = new Curve(knownx, knowny);

            //var curLin = cur1.LinearExpand();
            var curCub  = cur1.CubicSplineExpand();
            var curCub2 = cur1.CubicSplineExpand2(EnmBoradType.SecondOrder, new[] { 0D, 0D });
            //var curDim = cur1.LeastSquaresFit(4);



            //var s1 = curLin.ToString("\r\n");
            var s2 = curCub.ToString("\r\n");
            var s4 = curCub2.ToString("\r\n");
            //var s3 = curDim.ToString("\r\n");


            var t = Interpolation.CubicSplineFit(cur1.Points(), 1.36);

            //Console.WriteLine(s1);
            Console.WriteLine();
            //Console.WriteLine(s2);
            //Console.WriteLine();
            Console.WriteLine(s4);
        }