Beispiel #1
0
        public void TestValueCalculation(float a0, float a1, float a2, float x, float expected)
        {
            QuadraticFunction q = new QuadraticFunction(a0, a1, a2);

            Assert.NotNull(q);
            Assert.True(Near(expected, q.GetValueAt(x)));
            Assert.True(Near(expected, q.GetNthDerivativeAt(x, 0)));
        }
        public void TestValueCalculation(double a0, double a1, double a2, double x, double expected)
        {
            QuadraticFunction q = new QuadraticFunction(a0, a1, a2);

            Assert.NotNull(q);
            Assert.Equal(expected, q.GetValueAt(x), 6);
            Assert.Equal(expected, q.GetNthDerivativeAt(x, 0), 6);
        }
Beispiel #3
0
        public void TestValueNaN(float a0, float a1, float a2, float x)
        {
            QuadraticFunction q = new QuadraticFunction(a0, a1, a2);

            Assert.NotNull(q);
            Assert.True(float.IsNaN(q.GetValueAt(x)));
            Assert.True(float.IsNaN(q.GetNthDerivativeAt(x, 0)));
        }