Example #1
0
        [TestCase(11, 6, 7, 6.899515)] // Intersection
        public static void RadicalLineLength_Static_Returns_Length_of_Radical_Line_Formed_By_Circular_Intersection(
            double separation, double radius1, double radius2,
            double expected)
        {
            double result = IntersectionCircularCircular.RadicalLineLength(separation, radius1, radius2, Tolerance);

            Assert.AreEqual(expected, result, Tolerance);
        }
Example #2
0
        [TestCase(0, 0, 6, 0, 0, 6)]  // Circles overlap, same sizes
        public static void RadicalLineLength_Throws_OverlappingCurvesException_when_No_Separation(
            double x1, double y1, double r1,
            double x2, double y2, double r2)
        {
            CircularCurve curve1 = new CircularCurve(r1, new CartesianCoordinate(x1, y1));

            curve1.Tolerance = Tolerance;
            CircularCurve curve2 = new CircularCurve(r2, new CartesianCoordinate(x2, y2));

            curve2.Tolerance = Tolerance;

            IntersectionCircularCircular intersections = new IntersectionCircularCircular(curve1, curve2);

            Assert.Throws <OverlappingCurvesException>(() => intersections.RadicalLineLength());
        }
Example #3
0
        [TestCase(4, -5, 6, 13.5262794416288, -10.5, 7, 6.899515)] // Intersection, Translated and Rotated to quadrant 4
        public static void RadicalLineLength_Returns_Length_of_Radical_Line_Formed_By_Circular_Intersection(
            double x1, double y1, double r1,
            double x2, double y2, double r2,
            double expected)
        {
            CircularCurve curve1 = new CircularCurve(r1, new CartesianCoordinate(x1, y1));

            curve1.Tolerance = Tolerance;
            CircularCurve curve2 = new CircularCurve(r2, new CartesianCoordinate(x2, y2));

            curve2.Tolerance = Tolerance;

            IntersectionCircularCircular intersections = new IntersectionCircularCircular(curve1, curve2);
            double result = intersections.RadicalLineLength();

            Assert.AreEqual(expected, result, Tolerance);
        }
Example #4
0
 [TestCase(0, 6, 6)]  // Circles overlap, same sizes
 public static void RadicalLineLength_Static_Throws_OverlappingCurvesException_when_No_Separation(double separation, double radius1, double radius2)
 {
     Assert.Throws <OverlappingCurvesException>(() => IntersectionCircularCircular.RadicalLineLength(separation, radius1, radius2));
 }