Esempio n. 1
0
        public void DerivativeInPointTestV3(string p1, string p2, int No, double result)
        {
            var derivatve = new Derivative("f(x1, x2) = x1*x2 + x2*x2");

            var point = new Point($"{p1},{p2}");

            var der = derivatve.FirstDerivativeInPoint(point, No);

            if (Math.Abs(der - result) < 0.0001)
            {
                Assert.Pass();
            }
            else
            {
                Assert.AreEqual(result, der);
            }
        }
Esempio n. 2
0
        public void DerivativeInPointTestV2()
        {
            var derivatve = new Derivative("f(x1, x2) = x1*x1 + x2*x2");

            var point = new Point("2,3");

            var der = derivatve.FirstDerivativeInPoint(point, 0);

            if (Math.Abs(der - 4) < 0.0001)
            {
                Assert.Pass();
            }
            else
            {
                Assert.AreEqual(4, der);
            }
        }