public static Azimuth NewFromDoubleAsDegrees(Double az) { Azimuth returnAz = new Azimuth(); returnAz.setFromDegreesDouble(az); return(returnAz); }
public static Azimuth ctorAzimuthFromAngle(Angle angle) { Azimuth retAz = new Azimuth(); retAz.setFromDegreesDouble(angle.getAsDegreesDouble()); return(retAz); }
//to do: //setAsAzimuth //getAsDegreeMinuteSecond //setAsDegree //setAsDegreeMinuteSecond //yada public static Azimuth ctorAzimuthFromDegree(Double deg) { Azimuth retAz = new Azimuth(); retAz.setFromDegreesDouble(deg); return(retAz); }
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); }
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); } }
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); }
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; }
public static Azimuth NewFromDoubleAsDegrees(Double az) { Azimuth returnAz = new Azimuth(); returnAz.setFromDegreesDouble(az); return returnAz; }
//to do: //setAsAzimuth //getAsDegreeMinuteSecond //setAsDegree //setAsDegreeMinuteSecond //yada public static Azimuth ctorAzimuthFromDegree(Double deg) { Azimuth retAz = new Azimuth(); retAz.setFromDegreesDouble(deg); return retAz; }
public static Azimuth ctorAzimuthFromAngle(Angle angle) { Azimuth retAz = new Azimuth(); retAz.setFromDegreesDouble(angle.getAsDegreesDouble()); return retAz; }