Abacus.DoublePrecision.Vector2Tests.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)
            {
                Vector2 a = GetNextRandomVector2();
                Double l = a.Length();
                Vector2 expected = a;

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

                Vector2 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.
                Vector2.Normalise(ref c, out c);
                Vector2 result2 = c * l;
                AssertEqualWithinReason(result2, expected);
            }
        }
Vector2Tests