Method FromRectangle
FromRectangle(Rectangle)
Creates a quadrilateral from a Rectangle.
public static Quadrilateral FromRectangle(Rectangle r)
Parameters
r
RectangleThe rectangle to convert.
Returns
- Quadrilateral
A new Quadrilateral matching
r
.
FromRectangle(Rectangle, double, Point)
Creates a quadrilateral by rotating a Rectangle about a given pivot point.
public static Quadrilateral FromRectangle(Rectangle r, double angleDegrees, Point pivot)
Parameters
r
RectangleThe rectangle to rotate.
angleDegrees
doubleClockwise rotation angle in degrees.
pivot
PointThe pivot point to rotate around.
Returns
- Quadrilateral
A new Quadrilateral representing the rotated rectangle.
FromRectangle(double, double, double, double)
Creates a quadrilateral from rectangle parameters (left, top, width, height).
public static Quadrilateral FromRectangle(double left, double top, double width, double height)
Parameters
left
doubleThe X-coordinate of the left edge.
top
doubleThe Y-coordinate of the top edge.
width
doubleThe rectangle width.
height
doubleThe rectangle height.
Returns
- Quadrilateral
A new axis-aligned Quadrilateral.
FromRectangle(double, double, double, double, double, Point)
Creates a quadrilateral from rectangle parameters and rotates it around a specified pivot point.
public static Quadrilateral FromRectangle(double left, double top, double width, double height, double angleDegrees, Point pivot)
Parameters
left
doubleThe X-coordinate of the left edge.
top
doubleThe Y-coordinate of the top edge.
width
doubleThe rectangle width.
height
doubleThe rectangle height.
angleDegrees
doubleClockwise rotation angle in degrees.
pivot
PointThe pivot point to rotate around.
Returns
- Quadrilateral
A new Quadrilateral representing the rotated rectangle.