xxxxxxxxxx
23
function setup() {
createCanvas(400, 400);
}
function draw() {
// clear the canvas
background(220);
// X and Y coordinates and diameter of the circle to be drawn
let centerX = 150;
let centerY = 250;
let diameter = 80;
// Draw a circle at the chosen center with the chosen diameter
circle(centerX, centerY, diameter);
// Draw a small dot at the center of the circle
circle(centerX, centerY, 3);
// Print the center and diameter in the top-left corner
text("Center X: " + centerX, 4, 16);
text("Center Y: " + centerY, 4, 32);
text("Diameter: " + diameter, 4, 48);
}