예제 #1
0
        public void LinearInterpolation_NoCalibration()
        {
            LinearInterpolation target = new LinearInterpolation();

            Assert.AreEqual(0, target.GetAdjustedValue(0));
            Assert.AreEqual(1, target.GetAdjustedValue(1));
        }
예제 #2
0
        public void NoCalibration()
        {
            var target = new LinearInterpolation();

            Assert.Equal(0, target.GetAdjustedValue(0));
            Assert.Equal(1, target.GetAdjustedValue(1));
        }
예제 #3
0
        public void Below_1()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(1, 0);
            Assert.Equal(1, target.GetAdjustedValue(0));
            Assert.Equal(2, target.GetAdjustedValue(1));
        }
예제 #4
0
        public void LinearInterpolation_Above_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(11, 10);
            Assert.AreEqual(11, target.GetAdjustedValue(10));
            Assert.AreEqual(10, target.GetAdjustedValue(9));
        }
예제 #5
0
        public void LinearInterpolation_Below_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(1, 0);
            Assert.AreEqual(1, target.GetAdjustedValue(0));
            Assert.AreEqual(2, target.GetAdjustedValue(1));
        }
예제 #6
0
        public void Above_1()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(11, 10);
            Assert.Equal(11, target.GetAdjustedValue(10));
            Assert.Equal(10, target.GetAdjustedValue(9));
        }
예제 #7
0
        public void LinearInterpolation_Middle_2()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(-1, -10);
            target.Add(1, 10);
            Assert.AreEqual(0, target.GetAdjustedValue(0));
            Assert.AreEqual(0.5, target.GetAdjustedValue(5));
        }
예제 #8
0
        public void Middle_2()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(-1, -10);
            target.AddReferencePoint(1, 10);
            Assert.Equal(0, target.GetAdjustedValue(0));
            Assert.Equal(0.5, target.GetAdjustedValue(5));
        }
예제 #9
0
        public void LinearInterpolation_Below_2()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(2, 1);
            target.Add(4, 2);
            target.Add(6, 3);
            Assert.AreEqual(8, target.GetAdjustedValue(4));
            Assert.AreEqual(10, target.GetAdjustedValue(5));
        }
예제 #10
0
        public void LinearInterpolation_Middle_1()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(2, 1);
            target.Add(6, 3);
            Assert.AreEqual(2, target.GetAdjustedValue(1));
            Assert.AreEqual(4, target.GetAdjustedValue(2));
            Assert.AreEqual(6, target.GetAdjustedValue(3));
        }
예제 #11
0
        public void LinearInterpolation_Above_2()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(6, 3);
            target.Add(8, 4);
            target.Add(10, 5);
            Assert.AreEqual(2, target.GetAdjustedValue(1));
            Assert.AreEqual(4, target.GetAdjustedValue(2));
        }
예제 #12
0
        public void Above_2()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(6, 3);
            target.AddReferencePoint(8, 4);
            target.AddReferencePoint(10, 5);
            Assert.Equal(2, target.GetAdjustedValue(1));
            Assert.Equal(4, target.GetAdjustedValue(2));
        }
예제 #13
0
        public void Middle_1()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(2, 1);
            target.AddReferencePoint(6, 3);
            Assert.Equal(2, target.GetAdjustedValue(1));
            Assert.Equal(4, target.GetAdjustedValue(2));
            Assert.Equal(6, target.GetAdjustedValue(3));
        }
예제 #14
0
        public void Below_2()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(2, 1);
            target.AddReferencePoint(4, 2);
            target.AddReferencePoint(6, 3);
            Assert.Equal(8, target.GetAdjustedValue(4));
            Assert.Equal(10, target.GetAdjustedValue(5));
        }
예제 #15
0
        public void LinearInterpolation_OnePoint()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(0, 1);
            Assert.AreEqual(0, target.GetAdjustedValue(1));
        }
예제 #16
0
        public void OnePoint()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(0, 1);
            Assert.Equal(0, target.GetAdjustedValue(1));
        }
예제 #17
0
        public void CalibratedValueHit()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(1, 0);
            target.AddReferencePoint(2, 1);
            target.AddReferencePoint(3, 2);
            Assert.Equal(3, target.GetAdjustedValue(2));
        }
예제 #18
0
        public void CalibratedThreePoints()
        {
            var target = new LinearInterpolation();

            target.AddReferencePoint(1, 1.1);
            target.AddReferencePoint(2, 1.2);
            target.AddReferencePoint(3, 1.3);
            Assert.Equal(2.5, target.GetAdjustedValue(1.25));
        }
예제 #19
0
        public void LinearInterpolation_CalibratedThreePoints()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(1, 1.1);
            target.Add(2, 1.2);
            target.Add(3, 1.3);
            Assert.AreEqual(2.5, target.GetAdjustedValue(1.25));
        }
예제 #20
0
        public void LinearInterpolation_CalibratedValueHit()
        {
            LinearInterpolation target = new LinearInterpolation();

            target.Add(1, 0);
            target.Add(2, 1);
            target.Add(3, 2);
            Assert.AreEqual(3, target.GetAdjustedValue(2));
        }