Abacus.DoublePrecision.Vector4Tests.TestStaticFn_CatmullRom_iv C# (CSharp) Method

TestStaticFn_CatmullRom_iv() private method

private TestStaticFn_CatmullRom_iv ( ) : void
return void
        public void TestStaticFn_CatmullRom_iv ()
        {
            var a = new Vector4( -90, -90, -90, -90 );
            var b = new Vector4( -30, -30, -30, -30 );
            var c = new Vector4( +30, +30, +30, +30 );
            var d = new Vector4( +90, +90, +90, +90 );

            Double one = 1;

            Double a0 = 0;
            Double a1 = (one * 1) / 4;
            Double a2 = (one * 2) / 4;
            Double a3 = (one * 3) / 4;
            Double a4 = 1;

            Vector4 r0 = b;
            Vector4 r1 = new Vector4( -15, -15, -15, -15 );
            Vector4 r2 = Vector4.Zero;
            Vector4 r3 = new Vector4(  15,  15,  15,  15 );
            Vector4 r4 = c;

            var knownResults = new List<Tuple<Double, Vector4>>
            {
                new Tuple<Double, Vector4>( a0, r0 ),
                new Tuple<Double, Vector4>( a1, r1 ),
                new Tuple<Double, Vector4>( a2, r2 ),
                new Tuple<Double, Vector4>( a3, r3 ),
                new Tuple<Double, Vector4>( a4, r4 ),
            };

            for (Int32 idx = 0; idx < knownResults.Count; ++idx)
            {
                Vector4 result;
                Double amount = knownResults[idx].Item1;
                Vector4 expected = knownResults[idx].Item2;

                Vector4.CatmullRom (
                    ref a, ref b, ref c, ref d, ref amount, out result);

                AssertEqualWithinReason(result, expected);
            }
        }
Vector4Tests