Returns true if the shortest line between 2 points would wrap-around on the y-axis. - CSharp System

CSharp examples for System:Math Geometry

Description

Returns true if the shortest line between 2 points would wrap-around on the y-axis.

Demo Code


using System.Drawing;
using System;//from   w  w w  .  j av  a2 s  .  c  om

public class Main{
        /// <summary>
        /// Returns true if the shortest line between 2 points would wrap-around on the y-axis.
        /// </summary>
        public static bool WrapY(Point a, Point b, int size)
        {
            if ((int)Math.Abs(a.Y - b.Y) > (size / 2))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
}

Related Tutorials