Example #1
0
        public static Azimuth NewFromDoubleAsDegrees(Double az)
        {
            Azimuth returnAz = new Azimuth();

            returnAz.setFromDegreesDouble(az);
            return(returnAz);
        }
Example #2
0
        public static Azimuth ctorAzimuthFromAngle(Angle angle)
        {
            Azimuth retAz = new Azimuth();

            retAz.setFromDegreesDouble(angle.getAsDegreesDouble());
            return(retAz);
        }
Example #3
0
        //to do:
        //setAsAzimuth
        //getAsDegreeMinuteSecond
        //setAsDegree
        //setAsDegreeMinuteSecond
        //yada

        public static Azimuth ctorAzimuthFromDegree(Double deg)
        {
            Azimuth retAz = new Azimuth();

            retAz.setFromDegreesDouble(deg);
            return(retAz);
        }
Example #4
0
        public static Azimuth operator -(Azimuth Az1, Deflection defl)
        {
            var     newAzDeg = Az1.getAsDegreesDouble() - defl.getAsDegreesDouble();
            Double  retDbl   = Angle.normalizeToPlusOrMinus360Static(newAzDeg);
            Azimuth retAz    = new Azimuth();

            retAz.setFromDegreesDouble(retDbl);
            return(retAz);
        }
Example #5
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);
             }
        }
Example #6
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);
 }
Example #7
0
 public static Azimuth operator -(Azimuth Az1, Deflection defl)
 {
     var newAzDeg = Az1.getAsDegreesDouble() - defl.getAsDegreesDouble();
      Double retDbl = Angle.normalizeToPlusOrMinus360Static(newAzDeg);
      Azimuth retAz = new Azimuth();
      retAz.setFromDegreesDouble(retDbl);
      return retAz;
 }
Example #8
0
 public static Azimuth NewFromDoubleAsDegrees(Double az)
 {
     Azimuth returnAz = new Azimuth();
      returnAz.setFromDegreesDouble(az);
      return returnAz;
 }
Example #9
0
 //to do:
 //setAsAzimuth
 //getAsDegreeMinuteSecond
 //setAsDegree
 //setAsDegreeMinuteSecond
 //yada
 public static Azimuth ctorAzimuthFromDegree(Double deg)
 {
     Azimuth retAz = new Azimuth();
      retAz.setFromDegreesDouble(deg);
      return retAz;
 }
Example #10
0
 public static Azimuth ctorAzimuthFromAngle(Angle angle)
 {
     Azimuth retAz = new Azimuth();
      retAz.setFromDegreesDouble(angle.getAsDegreesDouble());
      return retAz;
 }