Esempio n. 1
0
        public void DistanceCalc2()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (39.960418,-90.039589,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40.039585,-89.960423,3395);

            double distance = utility.Distance (coordinate1, coordinate2);
            Console.WriteLine (distance);
            Assert.That (Math.Abs(5.99 - distance) <= .01);
        }
Esempio n. 2
0
        public void DistanceCalc1()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (39.960210,-90.039798,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40.039793,-89.960214,3397);

            double distance = utility.Distance (coordinate1, coordinate2); //7km
            Console.WriteLine (distance);
            Assert.That (Math.Abs(6.02 - distance) <= .01);
        }
Esempio n. 3
0
        public void DistanceCalc4()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (39.960627,-90.039381,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40.039168,-89.960840,3391);

            double distance = utility.Distance (coordinate1, coordinate2);
            Console.WriteLine (distance);
            Assert.That (Math.Abs(5.94 - distance) <= .01);
        }
Esempio n. 4
0
        public void DistancePersonalAlt()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40,-89,10000);

            double distance = utility.Distance (coordinate1, coordinate2); //
            Console.WriteLine("distance personalAlt: " + distance);
            Assert.That (1.15, Is.LessThan(distance));
            Assert.That (1.16, Is.GreaterThan (distance));
        }
Esempio n. 5
0
        public void DistancePersonalAlt()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40,-89,10000);

            double distance = utility.Distance (coordinate1, coordinate2); //7km
            distance *= 0.539956804;
            Assert.AreEqual (3.779697628, distance);

            //	Assert.AreEqual (true, rh.AircraftDidEnterRadarRangeEvent (them));
        }
Esempio n. 6
0
        public void line52_53()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (39.960627,-90.039381,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40.039168,-89.960840,3391);

            double distance = utility.Distance (coordinate1, coordinate2); //7km
            distance *= 0.539956804;
            Console.WriteLine (distance);
            Assert.That (5.47, Is.LessThanOrEqualTo(distance));
            //distance is greater than 59.9 nm

            //	Assert.AreEqual (true, rh.AircraftDidEnterRadarRangeEvent (them));
        }
        public void DistanceTest()
        {
            //Test 1
            MathCalcUtility utility = new MathCalcUtility ();
            Vector<double> coordinate1 = utility.CalculateCoordinate (0, 1, 5000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (0, 0, 5000);

            double distance = utility.Distance (coordinate1, coordinate2);

            Assert.That (60.1, Is.LessThan (distance));
            //Assert.AreEqual (111.405, distance);
            Assert.That (60.2, Is.GreaterThan(distance));
            //Test 2
            coordinate1 = utility.CalculateCoordinate (10, 1, 5000);
            coordinate2 = utility.CalculateCoordinate (10, 0, 5000);

            distance = utility.Distance (coordinate1, coordinate2);

            //Assert.AreEqual (109.724, distance);
            Assert.That (59.2, Is.LessThan (distance));
            Assert.That (59.3, Is.GreaterThan (distance));
            //Test 3
            coordinate1 = utility.CalculateCoordinate (70, 1, 5000);
            coordinate2 = utility.CalculateCoordinate (70, 0, 5000);

            distance = utility.Distance (coordinate1, coordinate2);

            //Assert.AreEqual (38.215, distance); //works
            Assert.That (20.6, Is.LessThan (distance));
            Assert.That (20.7, Is.GreaterThan (distance));
        }
        public void DistanceTest()
        {
            //Test 1
            MathCalcUtility utility = new MathCalcUtility ();
            Vector<double> coordinate1 = utility.CalculateCoordinate (0, 1, 5000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (0, 0, 5000);

            double distance = utility.Distance (coordinate1, coordinate2);

            Assert.AreEqual (111.405, distance);

            //Test 2
            coordinate1 = utility.CalculateCoordinate (10, 1, 5000);
            coordinate2 = utility.CalculateCoordinate (10, 0, 5000);

            distance = utility.Distance (coordinate1, coordinate2);

            Assert.AreEqual (109.724, distance); //109.274 was the test before that was failing, is this correct?

            //Test 3
            coordinate1 = utility.CalculateCoordinate (70, 1, 5000);
            coordinate2 = utility.CalculateCoordinate (70, 0, 5000);

            distance = utility.Distance (coordinate1, coordinate2);

            Assert.AreEqual (38.215, distance); //works
        }
        public void LLAtoECEFtest()
        {
            MathCalcUtility utility = new MathCalcUtility ();
            Vector<double> result = utility.CalculateCoordinate (34.0522, -118.40806, 0);

            Assert.AreEqual (-1358.9179, result[0]);
            Assert.AreEqual (-2512.4215, result[1]);
            Assert.AreEqual (1917.5196, result[2]);

            Vector<double> result2 = utility.CalculateCoordinate (100, 100, 100);

            Assert.AreEqual (104.1863, result2 [0]);
            Assert.AreEqual (-590.8690, result2 [1]);
            Assert.That (3379.9002, Is.LessThan (result2 [2]));
            Assert.That (3379.91, Is.GreaterThan (result2 [2]));
        }
        public void LLAtoECEFtest()
        {
            MathCalcUtility utility = new MathCalcUtility ();
            Vector<double> result = utility.CalculateCoordinate (34.0522, -118.40806, 0);

            Assert.AreEqual (-2516.715, result[0]);
            Assert.AreEqual (-4653.003, result[1]);
            Assert.AreEqual (3551.245, result[2]);

            Vector<double> result2 = utility.CalculateCoordinate (100, 100, 100);

            Assert.AreEqual (192.955, result2 [0]);
            Assert.AreEqual (-1094.301, result2 [1]);
            Assert.AreEqual (6259.641, result2 [2]);
        }
Esempio n. 11
0
        public void DistancePersonalLong()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40,-89.09053,3000);

            double distance = utility.Distance (coordinate1, coordinate2);
            Console.WriteLine("distance personalLong: " + distance);
            Assert.That (4.174, Is.LessThan(distance));
            Assert.That (4.176, Is.GreaterThan(distance));
        }
Esempio n. 12
0
        public void DistancePersonalRandom()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (41,-89,3000);

            double distance = utility.Distance (coordinate1, coordinate2); //7km
            distance *= 0.539956804;
            Console.WriteLine (distance);
            Assert.That (59.9, Is.LessThanOrEqualTo(distance));
            //distance is greater than 59.9 nm

            //	Assert.AreEqual (true, rh.AircraftDidEnterRadarRangeEvent (them));
        }
Esempio n. 13
0
        public void DistancePersonalRandom()
        {
            //distance is around  59.9 nm
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (41,-89,3000);

            double distance = utility.Distance (coordinate1, coordinate2);
            Console.WriteLine (distance);
            Console.WriteLine("distance personalRand: " + distance);
            Assert.That (59.96, Is.LessThanOrEqualTo(distance));
            Assert.That (59.97, Is.GreaterThanOrEqualTo(distance));
        }
Esempio n. 14
0
        public void LLAtoECEFtest()
        {
            MathCalcUtility utility = new MathCalcUtility ();
            Vector<double> result = utility.CalculateCoordinate (34.0522, -118.40806, 0);

            Assert.AreEqual (-1358.9179, result[0]);
            Assert.AreEqual (-2512.4215, result[1]);
            Assert.AreEqual (1917.5196, result[2]);

            Vector<double> result2 = utility.CalculateCoordinate (100, 100, 100);

            Assert.AreEqual (104.1874, result2 [0]);
            Assert.AreEqual (-590.8755, result2 [1]);
            Assert.AreEqual (3379.937, result2 [2]);
        }
Esempio n. 15
0
        public void DistancePersonalLat()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40.037919,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (39.962085,-89,3000);

            double distance = utility.Distance (coordinate1, coordinate2);//8.424km
            distance *= 0.539956804;

            double difference = Math.Abs(distance * .00001);

            // had to do it this way because a straight comparison was not working
            Assert.That(Math.Abs(distance -  4.548596116896),  Is.LessThanOrEqualTo(difference), "greater than");
        }
Esempio n. 16
0
        public void DistancePersonalLat()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40.037919,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (39.962085,-89,3000);

            double distance = utility.Distance (coordinate1, coordinate2);
            Console.WriteLine("distance personalAlt: " + distance);

            Assert.That (4.54, Is.LessThan(distance));
            Assert.That (4.55, Is.GreaterThan (distance));
        }
Esempio n. 17
0
        public void DistancePersonalLong()
        {
            MathCalcUtility utility = new MathCalcUtility ();

            Vector<double> coordinate1 = utility.CalculateCoordinate (40,-89,3000);
            Vector<double> coordinate2 = utility.CalculateCoordinate (40,-89.09053,3000);

            double distance = utility.Distance (coordinate1, coordinate2); //7.735km
            distance *= 0.539956804;
            Assert.AreEqual (4.17656587894, distance);
        }