Edit in JSFiddle

</script>
<script type="application/processing" data-processing-target="myCanvas">

// キャンバスのサイズ
size(480, 320);

// 線の太さ
strokeWeight(5);

// 矩形を描く
// rect(a, b, c, d)
rect(30, 100, 100, 180);

strokeWeight(1);
// rect(a, b, c, d, r)
rect(350, 200, 50, 50, 10);

// 塗りつぶさない
noFill();

// 座標指定を設定する
// rect(左上頂点のx座標, 左上頂点のy座標, 幅, 高さ)  デフォルトの値
rectMode(CORNER);
rect(100, 150, 100, 100);

// rect(左上頂点のx座標, 左上頂点のy座標, 右下頂点のx座標, 右下頂点のy座標)
rectMode(CORNERS);
rect(350, 100, 400, 50);

// rect(中心のx座標, 中心のy座標, 幅, 高さ)
rectMode(CENTER);
rect(200, 150, 100, 100);

// rect(中心のx座標, 中心のy座標, 幅の半分, 高さの半分)
rectMode(RADIUS);
rect(200, 150, 100, 100);

// 自由に四角形を描く
// quad(x1, y1, x2, y2, x3, y3, x4, y4)
quad(38, 31, 86, 20, 69, 63, 30, 76);