コード例 #1
0
ファイル: Azimuth.cs プロジェクト: PaulSchrum/RM21SourceCore
 public static Azimuth operator +(Azimuth Az1, Deflection defl)
 {
     var newAzDeg = Az1.getAsDegreesDouble() + defl.getAsDegreesDouble();
      Double retDbl = ptsAngle.normalizeToPlusOrMinus360Static(newAzDeg);
      Azimuth retAz = new Azimuth();
      retAz.setFromDegreesDouble(retDbl);
      return retAz;
 }
コード例 #2
0
        public void AzimuthArithmatic_subtraction(Double Az1Dbl, Double Az2Dbl, Double expectedDeflection)
        {
            Azimuth Az1 = new Azimuth(); Az1.setFromDegreesDouble(Az1Dbl);
             Azimuth Az2 = new Azimuth(); Az2.setFromDegreesDouble(Az2Dbl);

             Double actualDeflection = Az2.minus(Az1).getAsDegreesDouble();

             Assert.AreEqual(expected: expectedDeflection, actual: actualDeflection, delta: 0.00000001);
        }
コード例 #3
0
 public void AzimuthAddition_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);
 }
コード例 #4
0
        public void AzimuthArithmatic_addition(Double Az1Dbl, Double ExpectedAz2Dbl, Double DeflectionDbl)
        {
            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);
        }
コード例 #5
0
ファイル: Azimuth.cs プロジェクト: PaulSchrum/RM21SourceCore
 //to do:
 //setAsAzimuth
 //getAsDegreeMinuteSecond
 //setAsDegree
 //setAsDegreeMinuteSecond
 //yada
 public static Azimuth newAzimuthFromAngle(ptsAngle angle)
 {
     Azimuth retAz = new Azimuth();
      retAz.setFromDegreesDouble(angle.getAsDegreesDouble());
      return retAz;
 }