xxxxxxxxxx
14
function setup() {
createCanvas(400, 400);
// using the coordinates of two diagonal corner points of rectangle
rect(topLeftX, topLeftY, bottomRightX, BottomRightY);
// using center of the rectangle as a starting point and use width and height
rect(centerX, centerY, width, height);
// using coordinates of every four corner points of rectangle
rect(topLeftX, topLeftY, topRightX, topRightY, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY)
}