Пример #1
0
        public void Azimuth_Arithmatic_addition()
        {
            Tuple <Double, Double, Double>[] testCases =
            {
                new Tuple <Double, Double, Double>(20.0,         10.0,    -10.0),
                new Tuple <Double, Double, Double>(340.0,       350.0,     10.0),
                new Tuple <Double, Double, Double>(20.0,        340.0,    -40.0),
                new Tuple <Double, Double, Double>(340.0,        20.0,     40.0),
                new Tuple <Double, Double, Double>(189.4326, 173.8145, -15.6181),
            };

            foreach (var testCase in testCases)
            {
                Double     Az1Dbl         = testCase.Item1;
                Double     ExpectedAz2Dbl = testCase.Item2;
                Double     DeflectionDbl  = testCase.Item3;
                Azimuth    Az1            = new Azimuth(); Az1.setFromDegreesDouble(Az1Dbl);
                Deflection defl           = DeflectionDbl.AsPtsDegree();
                Azimuth    Az2            = Az1 + defl;

                Double actualAzimuth = Az2.getAsDegreesDouble();

                Assert.AreEqual(expected: ExpectedAz2Dbl, actual: actualAzimuth, delta: 0.00000001);
            }
        }
Пример #2
0
        public void Azimuth_Addition_Az189PlusDeflNeg15_shouldEqual174()
        {
            Double     expectedDbl = 174.0;
            Azimuth    az          = new Azimuth(); az.setFromDegreesDouble(189.0);
            Deflection defl        = new Deflection(); defl.setFromDegreesDouble(-15.0);
            Azimuth    newAz       = az + defl;
            Double     actualDbl   = newAz.getAsDegreesDouble();

            Assert.AreEqual(expected: expectedDbl, actual: actualDbl, delta: delta);
        }