/// <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))); }
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); }
public override bool Equals(object obj) { var other = (Triangle)obj; return(V0.Equals(other.V0) && V1.Equals(other.V1) && V2.Equals(other.V2)); }