Ejemplo n.º 1
0
        public NaturalSpline(double[] xs, double[] ys, int resolution = 10) : base(xs, ys, resolution)
        {
            m     = new Matrix(n - 2);
            gauss = new MatrixSolver(n - 2, m);

            a = new double[n];
            b = new double[n];
            c = new double[n];
            d = new double[n];
            h = new double[n - 1];

            CalcParameters();
            Integrate();
            Interpolate();
        }
Ejemplo n.º 2
0
        public EndSlopeSpline(double[] xs, double[] ys,
                              int resolution = 10, double firstSlopeDegrees = 0, double lastSlopeDegrees = 0) :
            base(xs, ys, resolution)
        {
            m     = new Matrix(n);
            gauss = new MatrixSolver(n, m);

            a = new double[n];
            b = new double[n];
            c = new double[n];
            d = new double[n];
            h = new double[n];

            CalcParameters(firstSlopeDegrees, lastSlopeDegrees);
            Integrate();
            Interpolate();
        }