Пример #1
0
        public static int CompareLengths_MAX(LineSegment segment0, LineSegment segment1)
        {
            var length0 = Vector2.Distance(segment0.P0, segment0.P1);
            var length1 = Vector2.Distance(segment1.P0, segment1.P1);

            if (length0 < length1)
            {
                return 1;
            }

            if (length0 > length1)
            {
                return -1;
            }

            return 0;
        }
Пример #2
0
 public static int CompareLengths(LineSegment segment0, LineSegment segment1)
 {
     return - CompareLengths_MAX(segment0, segment1);
 }