示例#1
0
 /// <summary>
 /// Checks whether the point has changes relative to the specified other point.
 /// </summary>
 /// <param name="other">The point to compare against.</param>
 /// <returns>True if the point has changes, false otherwise.</returns>
 internal bool IsChanged(TPoint other)
 {
     return(this.X != other.X || this.Y != other.Y);
 }
示例#2
0
 /// <summary>
 /// Converts the parameters for a circle to a rectangle containing the circle.
 /// </summary>
 /// <param name="center">The center of the circle.</param>
 /// <param name="radius">The radius of the circle.</param>
 /// <returns>The containing rectangle.</returns>
 public static Rectangle CircleToRectangle(TPoint center, int radius)
 {
     return(new Rectangle(center.X - radius, center.Y - radius, radius * 2, radius * 2));
 }
示例#3
0
 /// <summary>
 /// Translates a point according the circular definition of a distance.
 /// </summary>
 /// <param name="start">The point to translate.</param>
 /// <param name="distance">The distance to translate the point.</param>
 /// <param name="angle">The angle to translate the point at.</param>
 /// <returns>The translated point.</returns>
 public static TPoint CircularTranslate(this TPoint start, int distance, float angle)
 {
     return(new TPoint(start.X + distance * Cos(angle), start.Y + distance * Sin(angle)));
 }
示例#4
0
文件: Geom.cs 项目: ThoNohT/NohBoard
 /// <summary>
 /// Converts the parameters for a circle to a rectangle containing the circle.
 /// </summary>
 /// <param name="center">The center of the circle.</param>
 /// <param name="radius">The radius of the circle.</param>
 /// <returns>The containing rectangle.</returns>
 public static Rectangle CircleToRectangle(TPoint center, int radius)
 {
     return new Rectangle(center.X - radius, center.Y - radius, radius * 2, radius * 2);
 }