xxxxxxxxxx
20
//The vertices of the triangle are located according to the red elements in the diagram above. (Note: the left edge of the triangle is purely vertical.). Your triangle should retain these relationships to the edges of he canvas, even if the dimensions of the canvas were modified.
//In your blog post, embed a screen capture image of your sketch, and embed a link to your Editor code.
function setup() {
createCanvas(400, 400);
d = random(75, 125);
}
function draw() {
background(color('lightgray'));
fill(color('white'));
strokeWeight(3);
strokeCap(ROUND);
triangle(d, d,
d, d * 3,
width - d, height - (d*3));
}