Exemplo n.º 1
0
        public void Acos()
        {
            // arrange
            var targetData = new double[3];
            var srcData    = new double[] { -1.0, 0, 1.0 };

            var target = new DataAndLayout <double>(targetData, new FastAccess(new Layout(new int[] { 3 }, 0, new int[] { 1 })));
            var src    = new DataAndLayout <double>(srcData, new FastAccess(new Layout(new int[] { 3 }, 0, new int[] { 1 })));

            // action
            ScalarOps.Acos(target, src);

            // assert
            const double Epsilon = 1e-8;

            Assert.IsTrue(Math.Abs(targetData[0] - Math.PI) < Epsilon);
            Assert.IsTrue(Math.Abs(targetData[1] - (Math.PI / 2.0)) < Epsilon);
            Assert.IsTrue(Math.Abs(targetData[2] - 0.0) < Epsilon);
        }