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

            Assert.Equal(-180, op.Fix(180));
            Assert.Equal(180, op.FixExcludingEnd(180));
            Assert.Equal(-180, op.Fix(-540));
            Assert.Equal(-180, op.Fix(540));
            Assert.Equal(-180, op.Fix(-900));
            Assert.Equal(-100, op.Fix(-100));
            Assert.Equal(-80, op.Fix(280));
            Assert.Equal(80, op.Fix(-280));
            Assert.Equal(80, op.Fix(-640));
        }
Esempio n. 2
0
        public static void zero_based_value_fix()
        {
            var op = new PeriodicOperations(0, 3);

            Assert.Equal(0, op.Fix(0));
            Assert.Equal(0, op.Fix(3));
            Assert.Equal(3, op.FixExcludingEnd(3));
            Assert.Equal(0, op.Fix(-3));
            Assert.Equal(0, op.Fix(6));
            Assert.Equal(0, op.Fix(-6));
            Assert.Equal(1, op.Fix(1));
            Assert.Equal(1, op.Fix(4));
            Assert.Equal(2, op.Fix(-1));
            Assert.Equal(2, op.Fix(-4));
        }