Esempio n. 1
0
        public void TestMethod2()
        {
            double[] a = new double[2] {
                1, 1
            };
            double[] b = new double[2] {
                0, 2
            };
            double[] c = new double[2] {
                3, 0
            };
            double[] f = new double[2] {
                7, 4
            };

            var x = MatrixProvider.ThomasAlgorithm(a, b, c, f);

            Console.WriteLine(x);
        }
Esempio n. 2
0
        private void CalculateInterpolationDeBoore()
        {
            InterpolationPoints = PointsCollection;



            double[][] s = new double[3][];
            for (int i = 0; i < 3; i++)
            {
                s[i] = new double[InterpolationPoints.Count() + 2];
            }
            for (int i = -1; i <= InterpolationPoints.Count(); i++)
            {
                if (InterpolationPoints.Count() <= 0)
                {
                    break;
                }


                s[0][i + 1] = ((InterpolationPoints.ElementAt(Math.Min(Math.Max(i, 0), InterpolationPoints.Count() - 1)))).X;
                s[1][i + 1] = ((InterpolationPoints.ElementAt(Math.Min(Math.Max(i, 0), InterpolationPoints.Count() - 1)))).Y;
                s[2][i + 1] = ((InterpolationPoints.ElementAt(Math.Min(Math.Max(i, 0), InterpolationPoints.Count() - 1)))).Z;
            }



            double[][] nVectors = CalculateSegments2(InterpolationPoints.Count);
            double[][] result   = { MatrixProvider.ThomasAlgorithm(nVectors[1], nVectors[2], nVectors[0], s[0]), MatrixProvider.ThomasAlgorithm(nVectors[1], nVectors[2], nVectors[0], s[1]), MatrixProvider.ThomasAlgorithm(nVectors[1], nVectors[2], nVectors[0], s[2]) };
            _pointsCollectionInterpolation.Clear();


            for (int i = 0; i < InterpolationPoints.Count() + 2; i++)
            {
                _pointsCollectionInterpolation.Add(new Point(result[0][i], result[1][i], result[2][i]));
            }
        }