Example #1
0
        // Computation helper methods
        public static E replace(E x, E from, E to)
        {
            if (x is null)
            {
                throw new ArgumentNullException(nameof(x));
            }
            if (from.Kind != Expressions.ExpressionKind.Variable)
            {
                throw new ArgumentException("The parameter " + nameof(from) + " expects an expression of kind variable.");
            }
            if (to is null)
            {
                throw new ArgumentNullException(nameof(to));
            }

            return(x.SubstituteVariables(new Dictionary <string, E> {
                { from.GetName(), to }
            }));
        }
Example #2
0
 public static E tan(E x) => M.Tan(x);
Example #3
0
 // Trigonometric functions
 public static E sin(E x) => M.Sin(x);
Example #4
0
 public static E cos(E x) => M.Cos(x);
Example #5
0
 public static E root(E x, E y) => M.Root(x, y);
Example #6
0
 public static E pow(E x, E y) => M.Pow(x, y);
Example #7
0
 public static E ln(E x) => M.Ln(x);
Example #8
0
 public static E sqrt(E x) => M.Sqrt(x);
Example #9
0
 public static E exp(E x) => M.Exp(x);
Example #10
0
 // Mathematic functions
 public static E abs(E x) => M.Abs(x);
Example #11
0
 public static Vector4 vec(E x, E y, E z, E w) => new Vector4(x, y, z, w);
Example #12
0
 public static Vector3 vec(E x, E y, E z) => new Vector3(x, y, z);
Example #13
0
 // Helper methods for constructing vectors
 public static Vector2 vec(E x, E y) => new Vector2(x, y);