Ejemplo n.º 1
0
        //
        // Orthogonal Circles intersect at 90^0: radii connecting to intersection point are perpendicular
        //
        public bool AreOrthognal(Circle thatCircle)
        {
            // Find the intersection points
            Point inter1;
            Point inter2;
            FindIntersection(thatCircle, out inter1, out inter2);

            // If the circles intersect at 0 points.
            if (inter1 == null) return false;

            // If the circles intersect at 1 point they are tangent
            if (inter2 == null) return false;

            // Create two radii, one for each circle; arbitrarily choose the first point (both work)
            Segment radiusThis = new Segment(this.center, inter1);
            Segment radiusThat = new Segment(this.center, inter1);

            return radiusThis.IsPerpendicularTo(radiusThat);
        }