/// <summary> /// Rotates the rectangle by a specific angle along a specified axis point (default (null) value is midpoint of the specified rectangle) /// </summary> /// <param name="angle">Angle of rotation</param> /// <param name="axis">Axis of rotation</param> /// <returns>Rectangle</returns> public Rectangle2D Rotate(Angle angle, Point2D axis = null) => Rotate(this, angle, axis ?? Midpoint);
/// <summary> /// Moves the current rectangle by a specified distance along a specified angle /// </summary> /// <param name="distance">distance to be moved</param> /// <param name="angle">angle to be moved</param> /// <returns>Rectangle</returns> public Rectangle2D Move(double distance, Angle angle = null) => Move(this, distance, angle ?? Angle.A0);
/// <summary> /// Rotates a given rectangle by a specific angle along a specified axis point (default (null) value is midpoint of the specified rectangle) /// </summary> /// <param name="rectangle">Rectangle to be rotated</param> /// <param name="angle">Angle of rotation</param> /// <param name="axis">Axis of rotation</param> /// <returns>Rectangle</returns> public static Rectangle2D Rotate(Rectangle2D rectangle, Angle angle, Point2D axis = null) => new Rectangle2D(rectangle.Length, rectangle.Breadth, rectangle.Midpoint = rectangle.Midpoint.Rotate(angle, axis ?? rectangle.Midpoint), rectangle.Inclination += angle);
/// <summary> /// Moves the specified rectangle object by a specified distance along a specified angle /// </summary> /// <param name="rectangle"></param> /// <param name="distance">distance to be moved</param> /// <param name="angle">angle to be moved</param> /// <returns>Rectangle</returns> public static Rectangle2D Move(Rectangle2D rectangle, double distance, Angle angle = null) => new Rectangle2D(rectangle.Length, rectangle.Breadth, rectangle.Midpoint.Move(distance, angle ?? Angle.A0), rectangle.Inclination);