Exemplo n.º 1
0
 /// <summary>
 /// Compare two triangles and return true if equal
 /// </summary>
 /// <param name="tri">the other triangles to compare with</param>
 /// <returns>true if the two triangles equals, false otherwise</returns>
 public bool Equals(Triangle2DF tri)
 {
     return
         ((V0.Equals(tri.V0) || V0.Equals(tri.V1) || V0.Equals(tri.V2)) &&
          (V1.Equals(tri.V0) || V1.Equals(tri.V1) || V1.Equals(tri.V2)) &&
          (V2.Equals(tri.V0) || V2.Equals(tri.V1) || V2.Equals(tri.V2)));
 }
Exemplo n.º 2
0
        public List <Vector2> CommonEdge(Triangle other)
        {
            List <Vector2> commonPoints = new List <Vector2>();

            if (V0.Equals(other.V0) || V0.Equals(other.V1) || V0.Equals(other.V2))
            {
                commonPoints.Add(V0);
            }

            if (V1.Equals(other.V0) || V1.Equals(other.V1) || V1.Equals(other.V2))
            {
                commonPoints.Add(V1);
            }

            if (V2.Equals(other.V0) || V2.Equals(other.V1) || V2.Equals(other.V2))
            {
                commonPoints.Add(V2);
            }

            return(commonPoints);
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            var other = (Triangle)obj;

            return(V0.Equals(other.V0) && V1.Equals(other.V1) && V2.Equals(other.V2));
        }