Exemplo n.º 1
0
        public bool Add(double[] c)
        {
            if (c.Length != 2 * n)
            {
                return(false);
            }
            double[] r    = new double[2 * n];
            double   h    = Math.PI / n;
            double   temp = 0;

            for (int i = 0; i < 2 * n; i++)
            {
                r[i]  = this.Value(temp) + c[i];
                temp += h;
            }

            Printer.WriteLine("Inner radial function (r)");
            Printer.Write(r);

            TrigonPolinom newpol = new TrigonPolinom(r, n);

            for (int k = 0; k <= n; k++)
            {
                a_index[k] = newpol.A[k];
            }
            for (int k = 0; k < n - 1; k++)
            {
                b_index[k] = newpol.B[k];
            }
            return(true);
        }
Exemplo n.º 2
0
        public bool Add(ISource <double> tp)
        {
            double[] r    = new double[2 * n];
            double   h    = Math.PI / n;
            double   temp = 0;

            for (int i = 0; i < 2 * n; i++)
            {
                r[i]  = this.Value(temp) + tp.Value(temp);
                temp += h;
            }
            TrigonPolinom newpol = new TrigonPolinom(r, n);

            for (int k = 0; k <= n; k++)
            {
                a_index[k] = newpol.A[k];
            }
            for (int k = 0; k < n - 1; k++)
            {
                b_index[k] = newpol.B[k];
            }
            return(true);
        }