예제 #1
0
        public bool Equals(BoundingPolygon other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (Vertices == null || other.Vertices == null || Vertices.Length != other.Vertices.Length)
            {
                return(false);
            }

            for (var index = 0; index < Vertices.Length; index++)
            {
                var vertex1 = Vertices[index];
                var vertex2 = other.Vertices[index];
                if (!Vectors2.Equals(ref vertex1, ref vertex2))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
 public static bool Equals(ref Line line1, ref Line line2)
 {
     return(Vectors2.Equals(ref line1.Normal, ref line2.Normal) && line1.D.NearlyEquals(line2.D));
 }
예제 #3
0
 public static bool Equals(ref BoundingCircle circle1, ref BoundingCircle circle2)
 {
     return(Vectors2.Equals(ref circle1.Center, ref circle2.Center) &&
            circle1.Radius.NearlyEquals(circle2.Radius));
 }
예제 #4
0
 public static bool Equals(ref BoundingRectangle rect1, ref BoundingRectangle rect2)
 {
     return(Vectors2.Equals(ref rect1.Min, ref rect2.Min) && Vectors2.Equals(ref rect1.Max, ref rect2.Max));
 }
예제 #5
0
 public static bool Equals(ref LineSegment line1, ref LineSegment line2)
 {
     return(Vectors2.Equals(ref line1.Start, ref line2.Start) &&
            Vectors2.Equals(ref line1.End, ref line2.End));
 }
예제 #6
0
 public static bool Equals(ref Ray2D ray1, ref Ray2D ray2)
 {
     return(Vectors2.Equals(ref ray1.Origin, ref ray2.Origin) &&
            Vectors2.Equals(ref ray1.Direction, ref ray2.Direction));
 }