예제 #1
0
        public void CheckForCircleEventTest_PointsAReCircle_REturnsTrueFlagCircleDeets()
        {
            var sut         = new SweepTable();
            var circlecheck = sut.CalculateCircleEventCheck(new SiteEvent(new VoronoiPoint(1, 1)), new SiteEvent(new VoronoiPoint(1, 2)), new SiteEvent(new VoronoiPoint(2, 2)));

            Assert.IsTrue(circlecheck.isCircle);
        }
예제 #2
0
        public void CheckForCircleEventTest_PointsRightTurnCircle_REturnsFalseFlag()
        {
            var sut         = new SweepTable();
            var circlecheck = sut.CalculateCircleEventCheck(new SiteEvent(new VoronoiPoint(3, 2)), new SiteEvent(new VoronoiPoint(2, 2)), new SiteEvent(new VoronoiPoint(2, 1)));

            Assert.IsFalse(circlecheck.isCircle);
        }
예제 #3
0
        public void CheckForCircleEventTest_pointsAreLinear_ReturnsFalseCheckFlag()
        {
            var sut         = new SweepTable();
            var circlecheck = sut.CalculateCircleEventCheck(new SiteEvent(new VoronoiPoint(1, 1)), new SiteEvent(new VoronoiPoint(1, 2)), new SiteEvent(new VoronoiPoint(1, .5)));

            Assert.IsFalse(circlecheck.isCircle);
        }
예제 #4
0
        public void CheckCircleEventCheck_righthandcircle_returnsblankevent()
        {
            var pointa = new SiteEvent(new VoronoiPoint(10, 10));
            var pointb = new SiteEvent(new VoronoiPoint(20, 15));
            var pointc = new SiteEvent(new VoronoiPoint(15, 20));

            var sut         = new SweepTable();
            var circlecheck = sut.CalculateCircleEventCheck(pointa, pointb, pointc);

            Assert.IsFalse(circlecheck.isCircle);
        }
예제 #5
0
        public void CheckCircleEventCheck_sitesdifferent_returnscircleincenter()
        {
            var pointa = new SiteEvent(new VoronoiPoint(10, 10));
            var pointb = new SiteEvent(new VoronoiPoint(20, 15));
            var pointc = new SiteEvent(new VoronoiPoint(15, 20));

            var sut         = new SweepTable();
            var circlecheck = sut.CalculateCircleEventCheck(pointc, pointb, pointa);

            Assert.AreEqual(14.1666, circlecheck.o.X, 0.0001);
            Assert.AreEqual(14.1666, circlecheck.o.Y, 0.0001);
            Assert.AreEqual(20.05922, circlecheck.x, 0.0001);
        }