Exemplo n.º 1
0
        //
        // Do these segments overlay this angle?
        //
        public bool IsIncludedAngle(Segment seg1, Segment seg2)
        {
            // Do not allow the same segment.
            if (seg1.StructurallyEquals(seg2))
            {
                return(false);
            }

            // Check direct inclusion
            if (seg1.Equals(ray1) && seg2.Equals(ray2) || seg1.Equals(ray2) && seg2.Equals(ray1))
            {
                return(true);
            }

            // Check overlaying angle
            Point shared = seg1.SharedVertex(seg2);

            if (shared == null)
            {
                return(false);
            }

            Angle thatAngle = new Angle(seg1.OtherPoint(shared), shared, seg2.OtherPoint(shared));

            return(this.Equates(thatAngle));
        }
Exemplo n.º 2
0
 // Given one of the segments in the pair, return the other
 public Segment OtherSegment(Segment cs)
 {
     if (cs.Equals(cs1))
     {
         return(cs2);
     }
     if (cs.Equals(cs2))
     {
         return(cs1);
     }
     return(null);
 }
Exemplo n.º 3
0
 // Given one of the segments in the pair, return the other
 public Segment OtherSegment(Segment cs)
 {
     if (cs.Equals(cs1)) return cs2;
     if (cs.Equals(cs2)) return cs1;
     return null;
 }
Exemplo n.º 4
0
        //
        // Do these segments overlay this angle?
        //
        public bool IsIncludedAngle(Segment seg1, Segment seg2)
        {
            // Do not allow the same segment.
            if (seg1.StructurallyEquals(seg2)) return false;

            // Check direct inclusion
            if (seg1.Equals(ray1) && seg2.Equals(ray2) || seg1.Equals(ray2) && seg2.Equals(ray1)) return true;

            // Check overlaying angle
            Point shared = seg1.SharedVertex(seg2);

            if (shared == null) return false;

            Angle thatAngle = new Angle(seg1.OtherPoint(shared), shared, seg2.OtherPoint(shared));

            return this.Equates(thatAngle);
        }