Accord.Tests.Statistics.SinLinkFunctionTest.SinLinkFunctionConstructorTest C# (CSharp) Method

SinLinkFunctionConstructorTest() private method

private SinLinkFunctionConstructorTest ( ) : void
return void
        public void SinLinkFunctionConstructorTest()
        {
            SinLinkFunction target = new SinLinkFunction();
            Assert.AreEqual(-1, target.A);
            Assert.AreEqual(2, target.B);

            for (int i = 0; i < 11; i++)
            {
                double x = i / 10.0;
                double y = (Math.Sin(x) + 1) / 2.0;

                Assert.AreEqual(y, target.Function(x), 1e-10);
                Assert.AreEqual(x, target.Inverse(y), 1e-10);
            }
        }