Пример #1
0
 public Double Addition(
     Double angle1Value, GeometricAngle.MeasurementUnit angle1MeasurementUnit,
     Double angle2Value, GeometricAngle.MeasurementUnit angle2MeasurementUnit,
     GeometricAngle.MeasurementUnit outputAngleMeasurementUnit)
 {
     GeometricAngle first = GeometricAngle.FromSpecifiedUnit(angle1Value, angle1MeasurementUnit);
     GeometricAngle second = GeometricAngle.FromSpecifiedUnit(angle2Value, angle2MeasurementUnit);
     GeometricAngle sum = first + second;
     return sum.GetValueInUnitType(outputAngleMeasurementUnit);
 }
Пример #2
0
 public Int32 Comparison(
     Double angle1Value, GeometricAngle.MeasurementUnit angle1MeasurementUnit,
     Double angle2Value, GeometricAngle.MeasurementUnit angle2MeasurementUnit
     )
 {
     GeometricAngle first = GeometricAngle.FromSpecifiedUnit(angle1Value, angle1MeasurementUnit);
     GeometricAngle second = GeometricAngle.FromSpecifiedUnit(angle2Value, angle2MeasurementUnit);
     Int32 firstComparison = first.CompareTo((Object)second);
     Int32 secondComparison = first.CompareTo(second);
     Int32 thirdComparison = GeometricAngle.Compare(first, second);
     Assert.IsTrue(firstComparison == secondComparison && secondComparison == thirdComparison);
     return firstComparison;
 }
Пример #3
0
 public Boolean Equality(
     Double angle1Value, GeometricAngle.MeasurementUnit angle1MeasurementUnit, 
     Double angle2Value, GeometricAngle.MeasurementUnit angle2MeasurementUnit
     )
 {
     GeometricAngle first = GeometricAngle.FromSpecifiedUnit(angle1Value, angle1MeasurementUnit);
     GeometricAngle second = GeometricAngle.FromSpecifiedUnit(angle2Value, angle2MeasurementUnit);
     return GeometricAngle.AreEqual(first, second);
 }
Пример #4
0
 public String ToString(Double angleValue, GeometricAngle.MeasurementUnit angleMeasurementUnit)
 {
     GeometricAngle geometricAngle = GeometricAngle.FromSpecifiedUnit(angleValue, angleMeasurementUnit);
     return geometricAngle.ToString();
 }
Пример #5
0
 public Double Subtraction(
     Double angle1Value, GeometricAngle.MeasurementUnit angle1MeasurementUnit,
     Double angle2Value, GeometricAngle.MeasurementUnit angle2MeasurementUnit,
     GeometricAngle.MeasurementUnit outputAngleMeasurementUnit)
 {
     GeometricAngle minuend = GeometricAngle.FromSpecifiedUnit(angle1Value, angle1MeasurementUnit);
     GeometricAngle subtrahend = GeometricAngle.FromSpecifiedUnit(angle2Value, angle2MeasurementUnit);
     GeometricAngle difference = minuend - subtrahend;
     return difference.GetValueInUnitType(outputAngleMeasurementUnit);
 }
Пример #6
0
 public Boolean EqualityGreaterLesserOperators(
     Double angle1Value, GeometricAngle.MeasurementUnit angle1MeasurementUnit,
     Double angle2Value, GeometricAngle.MeasurementUnit angle2MeasurementUnit,
     Byte operatorType)
 {
     GeometricAngle first = GeometricAngle.FromSpecifiedUnit(angle1Value, angle1MeasurementUnit);
     GeometricAngle second = GeometricAngle.FromSpecifiedUnit(angle2Value, angle2MeasurementUnit);
     switch (operatorType)
     {
         case 1:
             return first == second;
         case 2:
             return first != second;
         case 3:
             return first > second;
         case 4:
             return first < second;
         case 5:
             return first >= second;
         case 6:
             return first <= second;
         default:
             throw new InvalidOperationException();
     }
 }