PennDraw.java
/**
     * Draw a rectangle of given half width and half height, centered on (x, y) and rotated counter-clockwise.
     * @param x the x-coordinate of the center of the rectangle
     * @param y the y-coordinate of the center of the rectangle
     * @param halfWidth is half the width of the rectangle
     * @param halfHeight is half the height of the rectangle
     * @param degrees counter-clockwise rotation by angle degrees around the center
     * @throws IllegalArgumentException if halfWidth or halfHeight is negative
     */
Draw a rectangle of given half width and half height, centered on (x, y) and rotated counter-clockwise.
Draw a rectangle of given half width and half height centered on ( x y ) and rotated counter - clockwise .
public static void filledRectangle(double x, double y, double halfWidth, double halfHeight, double degrees) {
        AffineTransform t = (AffineTransform) offscreen.getTransform();
        offscreen.rotate(Math.toRadians(-degrees), scaleX(x), scaleY(y));
        filledRectangle(x, y, halfWidth, halfHeight);
        offscreen.setTransform(t);
    }
public static void filledRectangle ( double x , double y , double halfWidth , double halfHeight , double degrees ) { AffineTransform t = ( AffineTransform ) offscreen . getTransform ( ) ; offscreen . rotate ( Math . toRadians ( - degrees ) , scaleX ( x ) , scaleY ( y ) ) ; filledRectangle ( x , y , halfWidth , halfHeight ) ; offscreen . setTransform ( t ) ; }
Draw a rectangle of given half width and half height, centered on (x, y) and rotated counter-clockwise.
Draw a rectangle of given half width and half height centered on ( x y ) and rotated counter - clockwise .