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

TestStaticFn_Normalise_iii() private method

private TestStaticFn_Normalise_iii ( ) : void
return void
        public void TestStaticFn_Normalise_iii ()
        {
            Double epsilon; Maths.Epsilon(out epsilon);

            for( Int32 i = 0; i < 100; ++ i)
            {
                Vector4 a = GetNextRandomVector4();
                Double l = a.Length();
                Vector4 expected = a;

                Vector4 b; Vector4.Normalise(ref a, out b);
                Vector4 result1 = b * l;
                AssertEqualWithinReason(result1, expected);

                Vector4 c = a;

                // The normalise function takes both a ref and out parameter,
                // need to check that if we pass in the same value as both
                // parameters we get the same results.
                Vector4.Normalise(ref c, out c);
                Vector4 result2 = c * l;
                AssertEqualWithinReason(result2, expected);
            }
        }
Vector4Tests