Пример #1
0
        public static void touches_mbr()
        {
            var a = new Mbr(1, 2, 3, 4);
            var b = new Mbr(2, 3, 4, 4);
            var c = new Mbr(3, 4, 5, 6);
            var d = new Mbr(3, 0, 5, 6);
            var e = new Mbr(0, 4, 4, 6);

            Assert.False(a.Touches(a));
            Assert.False(a.Touches(b));
            Assert.True(a.Touches(c));
            Assert.True(a.Touches(d));
            Assert.True(a.Touches(e));
        }
Пример #2
0
        public static void touches_point()
        {
            var a = new Mbr(1, 2, 3, 4);

            Assert.False(a.Touches(new Point2(2, 3)));
            Assert.False(a.Touches(Point2.Zero));
            Assert.False(a.Touches(Point2.Invalid));
            Assert.True(a.Touches(new Point2(1, 2)));
            Assert.True(a.Touches(new Point2(3, 4)));
            Assert.True(a.Touches(new Point2(1, 4)));
            Assert.True(a.Touches(new Point2(3, 2)));
            Assert.True(a.Touches(new Point2(2, 4)));
            Assert.True(a.Touches(new Point2(3, 3)));
        }
Пример #3
0
        public static void touches_point() {
            var a = new Mbr(1, 2, 3, 4);

            Assert.False(a.Touches(new Point2(2, 3)));
            Assert.False(a.Touches(Point2.Zero));
            Assert.False(a.Touches(Point2.Invalid));
            Assert.True(a.Touches(new Point2(1, 2)));
            Assert.True(a.Touches(new Point2(3, 4)));
            Assert.True(a.Touches(new Point2(1, 4)));
            Assert.True(a.Touches(new Point2(3, 2)));
            Assert.True(a.Touches(new Point2(2, 4)));
            Assert.True(a.Touches(new Point2(3, 3)));
        }
Пример #4
0
        public static void touches_mbr() {
            var a = new Mbr(1, 2, 3, 4);
            var b = new Mbr(2, 3, 4, 4);
            var c = new Mbr(3, 4, 5, 6);
            var d = new Mbr(3, 0, 5, 6);
            var e = new Mbr(0, 4, 4, 6);

            Assert.False(a.Touches(a));
            Assert.False(a.Touches(b));
            Assert.True(a.Touches(c));
            Assert.True(a.Touches(d));
            Assert.True(a.Touches(e));
        }