Example #1
0
        public ScalarValue Function(ScalarValue n, ScalarValue m, ScalarValue z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);
            var nm = m.GetIntegerOrThrowException("m", Name);

            return(Zernike(nn, nm, z));
        }
Example #2
0
        public void Function(ScalarValue digits)
        {
            var n = digits.GetIntegerOrThrowException("digits", Name);

            Context.Precision = n;
            Context.RaiseNotification(new NotificationEventArgs(NotificationType.Information, "Output precision changed to " + Context.Precision + " digits."));
        }
Example #3
0
 public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z, ScalarValue n)
 {
     var nn = n.GetIntegerOrThrowException("n", Name);
     var plot = new ContourPlotValue();
     plot.AddPoints(X, Y, Z);
     plot.SetLevels(nn);
     return plot;
 }
        public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z, ScalarValue n)
        {
            var nn   = n.GetIntegerOrThrowException("n", Name);
            var plot = new ContourPlotValue();

            plot.AddPoints(X, Y, Z);
            plot.SetLevels(nn);
            return(plot);
        }
Example #5
0
 public SubPlotValue Function(ScalarValue rows, ScalarValue columns)
 {
     var r = rows.GetIntegerOrThrowException("rows", Name);
     var c = columns.GetIntegerOrThrowException("columns", Name);
     var subplot = new SubPlotValue();
     subplot.Rows = r;
     subplot.Columns = c;
     return subplot;
 }
        public SubPlotValue Function(ScalarValue rows, ScalarValue columns)
        {
            var r       = rows.GetIntegerOrThrowException("rows", Name);
            var c       = columns.GetIntegerOrThrowException("columns", Name);
            var subplot = new SubPlotValue();

            subplot.Rows    = r;
            subplot.Columns = c;
            return(subplot);
        }
Example #7
0
        public ScalarValue Function(ScalarValue n, ScalarValue alpha, ScalarValue z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);

            if (nn < 0)
            {
                throw new Exception("Laguerre polynomial of order n < 0 does not make sense.");
            }

            return(LaguerrePolynomial(nn, alpha, z));
        }
Example #8
0
        public ScalarValue Function(ScalarValue l, ScalarValue m, ScalarValue theta, ScalarValue phi)
        {
            var nn = l.GetIntegerOrThrowException("l", Name);

            if (nn < 0)
            {
                throw new Exception("Spherical harmonics of order l < 0 does not make sense.");
            }

            var nm = m.GetIntegerOrThrowException("m", Name);

            return(Ylm(nn, nm, theta.Re, phi.Re));
        }
Example #9
0
        public ScalarValue Function(ScalarValue n, ScalarValue x)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);

            if (nn < 0)
            {
                throw new Exception("Chebyshev polynomial of order n < 0 does not make sense.");
            }

            var f = GetPolynom(nn);

            return(new ScalarValue(f(x.Re)));
        }
Example #10
0
        public MatrixValue Function(ScalarValue s, MatrixValue Z)
        {
            var n = s.GetIntegerOrThrowException("s", Name);
            var M = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var j = 1; j <= Z.DimensionY; j++)
            {
                for (var i = 1; i <= Z.DimensionX; i++)
                {
                    M[j, i] = GetValue(n, Z[j, i]);
                }
            }

            return(M);
        }
Example #11
0
        public MatrixValue Function(ScalarValue n, ScalarValue alpha, MatrixValue Z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);
            var M = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var i = 1; i <= Z.DimensionX; i++)
            {
                for (var j = 1; j <= Z.DimensionY; j++)
                {
                    M[j, i] = Gegenbauer(nn, alpha.Re, Z[j, i]);
                }
            }

            return M;
        }
Example #12
0
        public MatrixValue Function(ScalarValue n, ScalarValue alpha, MatrixValue Z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);
            var M  = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var i = 1; i <= Z.DimensionX; i++)
            {
                for (var j = 1; j <= Z.DimensionY; j++)
                {
                    M[j, i] = Gegenbauer(nn, alpha.Re, Z[j, i]);
                }
            }

            return(M);
        }
Example #13
0
        public ScalarValue Function(ScalarValue alpha, ScalarValue x)
        {
            var a = alpha.GetIntegerOrThrowException("alpha", Name);

            if (a == 0)
            {
                return(new ScalarValue(StruveL0(x.Re)));
            }
            else if (a == 1)
            {
                return(new ScalarValue(StruveL1(x.Re)));
            }

            throw new YAMPArgumentRangeException("alpha", 0.0, 1.0);
        }
Example #14
0
        public MatrixValue Function(ScalarValue n, ScalarValue m, MatrixValue Z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);
            var nm = m.GetIntegerOrThrowException("m", Name);
            var M = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var i = 1; i <= Z.DimensionX; i++)
            {
                for (var j = 1; j <= Z.DimensionY; j++)
                {
                    M[j, i] = Zernike(nn, nm, Z[j, i]);
                }
            }

            return M;
        }
Example #15
0
        public MatrixValue Function(ScalarValue n, ScalarValue m, MatrixValue Z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);
            var nm = m.GetIntegerOrThrowException("m", Name);
            var M  = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var i = 1; i <= Z.DimensionX; i++)
            {
                for (var j = 1; j <= Z.DimensionY; j++)
                {
                    M[j, i] = Zernike(nn, nm, Z[j, i]);
                }
            }

            return(M);
        }
Example #16
0
        public MatrixValue Function(ScalarValue n, ScalarValue alpha, MatrixValue Z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);

            if (nn < 0)
            {
                throw new Exception("Laguerre polynomial of order n < 0 does not make sense.");
            }

            var M = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var i = 1; i <= Z.Length; i++)
            {
                M[i] = LaguerrePolynomial(nn, alpha, Z[i]);
            }

            return(M);
        }
Example #17
0
        public MatrixValue Function(ScalarValue n, MatrixValue X)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);

            if (nn < 0)
            {
                throw new Exception("Chebyshev polynomial of order n < 0 does not make sense.");
            }

            var M = new MatrixValue(X.DimensionY, X.DimensionX);
            var f = GetPolynom(nn);

            for (var i = 1; i <= X.Length; i++)
            {
                M[i] = new ScalarValue(f(X[i].Re));
            }

            return(M);
        }
Example #18
0
        public MatrixValue Function(ScalarValue l, ScalarValue m, MatrixValue theta, MatrixValue phi)
        {
            var nn = l.GetIntegerOrThrowException("l", Name);

            if (nn < 0)
            {
                throw new Exception("Spherical harmonics of order l < 0 does not make sense.");
            }

            var M  = new MatrixValue(theta.Length, phi.Length);
            var nm = m.GetIntegerOrThrowException("m", Name);

            for (var i = 1; i <= phi.Length; i++)
            {
                for (var j = 1; j <= theta.Length; j++)
                {
                    M[j, i] = Ylm(nn, nm, theta[j].Re, phi[i].Re);
                }
            }

            return(M);
        }
Example #19
0
 public void Function(ScalarValue digits)
 {
     var n = digits.GetIntegerOrThrowException("digits", Name);
     Context.Precision = n;
     Context.RaiseNotification(new NotificationEventArgs(NotificationType.Information, "Output precision changed to " + Context.Precision + " digits."));
 }
Example #20
0
        public ScalarValue Function(ScalarValue n, ScalarValue alpha, ScalarValue z)
        {
            var nn = n.GetIntegerOrThrowException("n", Name);

            return(Gegenbauer(nn, alpha.Re, z));
        }
Example #21
0
 public ScalarValue Function(ScalarValue n, ScalarValue alpha, ScalarValue z)
 {
     var nn = n.GetIntegerOrThrowException("n", Name);
     return Gegenbauer(nn, alpha.Re, z);
 }
Example #22
0
        public ScalarValue Function(ScalarValue n, ScalarValue z)
        {
            var m = n.GetIntegerOrThrowException("n", Name);

            return(Psi(m, z));
        }
Example #23
0
        public ScalarValue Function(ScalarValue s, ScalarValue z)
        {
            var n = s.GetIntegerOrThrowException("s", Name);

            return(GetValue(n, z));
        }
Example #24
0
 public ScalarValue Function(ScalarValue n, ScalarValue z)
 {
     var m = n.GetIntegerOrThrowException("n", Name);
     return Psi(m, z);
 }
Example #25
0
        public MatrixValue Function(ScalarValue n, MatrixValue Z)
        {
            var m = n.GetIntegerOrThrowException("n", Name);
            var M = new MatrixValue(Z.DimensionY, Z.DimensionX);

            for (var j = 1; j <= Z.DimensionY; j++)
            {
                for (var i = 1; i <= Z.DimensionX; i++)
                {
                    M[j, i] = Psi(m, Z[j, i]);
                }
            }

            return M;
        }
Example #26
0
 public ScalarValue Function(ScalarValue n, ScalarValue m, ScalarValue z)
 {
     var nn = n.GetIntegerOrThrowException("n", Name);
     var nm = m.GetIntegerOrThrowException("m", Name);
     return Zernike(nn, nm, z);
 }
Example #27
0
        public ScalarValue Function(ScalarValue alpha, ScalarValue x)
        {
            var a = alpha.GetIntegerOrThrowException("alpha", Name);

            if (a == 0)
            {
                return new ScalarValue(StruveL0(x.Re));
            }
            else if (a == 1)
            {
                return new ScalarValue(StruveL1(x.Re));
            }

            throw new YAMPArgumentRangeException("alpha", 0.0, 1.0);
        }