Abacus.DoublePrecision.Vector3Tests.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)
            {
                Vector3 a = GetNextRandomVector3();
                Double l = a.Length();
                Vector3 expected = a;

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

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