Esempio n. 1
0
        /// <summary>
        /// Checks if point lies inside the rectangle
        /// </summary>
        /// <param name="point">Point to check</param>
        /// <exception cref="ArgumentException">Thrown when a 3D point is supplied</exception>
        /// <returns>True if point lies inside</returns>
        public bool IsPointInside(Coords point)
        {
            point.CheckSpace(Coords.SpaceType.TwoDim, "The point supplied must be a 2D point", "point");
            Debug.Write(string.Format("    Checking if {0} is in rectangle {1}...", point, this));
            bool ret = ((TopLeft.X < point.X && point.X < BottomRight.X) && (TopLeft.Y < point.Y && point.Y < BottomRight.Y));

            Debug.WriteLine((ret) ? "It is." : "It isn't.");
            return(ret);
        }
Esempio n. 2
0
 public static Angle Atan2(Coords coords)
 {
     coords.CheckSpace(Coords.SpaceType.TwoDim, "Vector can be created only from 2D coords", "coords");
     return(Atan2(coords.X, coords.Y));
 }