Esempio n. 1
0
        public static void small_area_within_full_longitude()
        {
            var op = new PeriodicOperations(-180, 360);

            Assert.True(op.Intersects(9, 23, -180, 180));
            Assert.True(op.Intersects(-180, 180, 9, 23));
        }
Esempio n. 2
0
        public static void intersects_range_with_range()
        {
            var op = new PeriodicOperations(-180, 360);

            Assert.False(op.Intersects(0, 0, 10, 10));
            Assert.True(op.Intersects(0, 0, 0, 0));
            Assert.True(op.Intersects(10, 10, 10, 10));
            Assert.True(op.Intersects(-100, 30, 40, 0));
            Assert.False(op.Intersects(-100, 30, 40, -170));
            Assert.True(op.Intersects(-100, 30, 0, 0));
            Assert.True(op.Intersects(10, 10, -100, 30));
            Assert.False(op.Intersects(10, 10, 40, 0));
        }
Esempio n. 3
0
        public static void intersects_reverse_range_and_single_value()
        {
            var op = new PeriodicOperations(0, 5);

            Assert.True(op.Intersects(2, 0, 0));
            Assert.False(op.Intersects(2, 0, 1));
            Assert.True(op.Intersects(2, 0, 2));
            Assert.True(op.Intersects(2, 0, 5));
            Assert.True(op.Intersects(1, 0, 0));
            Assert.True(op.Intersects(1, 0, 1));
            Assert.True(op.Intersects(1, 0, 2));
            Assert.True(op.Intersects(1, 0, 5));
            Assert.True(op.Intersects(3, 1, 0));
            Assert.False(op.Intersects(3, 1, 2));
            Assert.True(op.Intersects(3, 1, 4));
        }