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; }
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); }
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); }
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); }
//to do: //setAsAzimuth //getAsDegreeMinuteSecond //setAsDegree //setAsDegreeMinuteSecond //yada public static Azimuth newAzimuthFromAngle(ptsAngle angle) { Azimuth retAz = new Azimuth(); retAz.setFromDegreesDouble(angle.getAsDegreesDouble()); return retAz; }