Method FromRectangle
FromRectangle(Rectangle)
Creates a quadrilateral from a Rectangle.
public static Quadrilateral FromRectangle(Rectangle r)
Parameters
rRectangleThe 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
rRectangleThe rectangle to rotate.
angleDegreesdoubleClockwise rotation angle in degrees.
pivotPointThe 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
leftdoubleThe X-coordinate of the left edge.
topdoubleThe Y-coordinate of the top edge.
widthdoubleThe rectangle width.
heightdoubleThe 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
leftdoubleThe X-coordinate of the left edge.
topdoubleThe Y-coordinate of the top edge.
widthdoubleThe rectangle width.
heightdoubleThe rectangle height.
angleDegreesdoubleClockwise rotation angle in degrees.
pivotPointThe pivot point to rotate around.
Returns
- Quadrilateral
A new Quadrilateral representing the rotated rectangle.