Exemplo n.º 1
0
        public void TestCosecant()
        {
            Entity func    = "csc(2x)";
            var    derived = func.Differentiate("x");

            Assert.Equal(-2 * MathS.Cosec("2x") * MathS.Cotan("2x"), derived.Simplify());
        }
Exemplo n.º 2
0
        public CompiledFuncTest()
        {
            multiFuncNotCompiled = (MathS.Log(3, x) + MathS.Sqr(x)) * MathS.Sin(x + MathS.Cosec(x));
            multiFunc            = multiFuncNotCompiled.Compile(x);
            Expression <Func <Complex, Complex> > expr = x => (Complex.Log(x, 3) + Complex.Pow(x, 2)) * Complex.Sin(x + 1 / Complex.Sin(x));

            linqFunc = expr.Compile();
        }
        public void TestComplex()
        {
            var expr     = MathS.FromString("ln(x) + sqrt(x) + tan(x) + sec(x) + cosec(x) + cotan(x)");
            var expected = MathS.Ln(x) + MathS.Sqrt(x) +
                           MathS.Tan(x) + MathS.Sec(x) + MathS.Cosec(x) +
                           MathS.Cotan(x);

            Assert.IsTrue(expr == expected);
        }
Exemplo n.º 4
0
 [Fact] public void TestCosec() => Assert.Equal(MathS.Cosec("x"), FromString("csc(x)"));
Exemplo n.º 5
0
 [TestMethod] public void SecCosec() =>
 TestSimplify(@"\frac{1}{\cos\left(\frac{1}{\sin\left(x\right)}\right)}", MathS.Sec(MathS.Cosec(x)));
Exemplo n.º 6
0
 [Fact] public void SecCosec() =>
 TestSimplify(@"\sec\left(\csc\left(x\right)\right)", MathS.Sec(MathS.Cosec(x)));