public void TestRayStartingBehind()
 {
     Assert.IsFalse(
         Ray2Disc2Collider.FindContacts(
             Vector2.UnitX * 3.0f, Vector2.UnitX, 2.0f
             ).HasContact
         );
 }
        public void TestRayStartingBehindWithAbsoluteDiscPosition()
        {
            Vector2 unitDiagonal = Vector2.Normalize(Vector2.One);

            Assert.IsFalse(
                Ray2Disc2Collider.FindContacts(
                    unitDiagonal * 6.0f, unitDiagonal, unitDiagonal * 3.0f, 2.0f
                    ).HasContact
                );
        }
        public void TestRayStartingInside()
        {
            LineContacts contacts = Ray2Disc2Collider.FindContacts(
                new Vector2(0.0f, 0.0f), Vector2.UnitX, 2.0f
                );

            Assert.That(
                contacts.EntryTime,
                Is.EqualTo(0.0f).Within(Specifications.MaximumDeviation).Ulps
                );
            Assert.That(
                contacts.ExitTime,
                Is.EqualTo(2.0f).Within(Specifications.MaximumDeviation).Ulps
                );
        }
        public void TestRayStartingInsideWithAbsoluteDiscPosition()
        {
            Vector2      unitDiagonal = Vector2.Normalize(Vector2.One);
            LineContacts contacts     = Ray2Disc2Collider.FindContacts(
                unitDiagonal * 4.0f, unitDiagonal, unitDiagonal * 5.0f, 2.0f
                );

            Assert.That(
                contacts.EntryTime,
                Is.EqualTo(0.0f).Within(Specifications.MaximumDeviation).Ulps
                );
            Assert.That(
                contacts.ExitTime,
                Is.EqualTo(3.0f).Within(Specifications.MaximumDeviation).Ulps
                );
        }