void setup() {
size (500, 500);
background(0);
// Value of radius
float radius=15;
// Area of Circle
float area=PI*radius*radius;
// Circumference
float circ=2*PI*radius;
// Console Viewer
println("Radius is "+ radius);
println("Area of circle is "+ area);
println("Circumference of circle is "+ circ);
// Image
fill(0);
stroke(255);
ellipse(250, 250, radius*20, radius*20);
// Text Image Area
fill(255, 0, 0);
textAlign(CENTER);
textSize(5+radius);
text("Area of circle is "+ area, 250, 250);
// Text Image Circumference
fill(0, 0, 255);
textAlign(CENTER);
textSize(5+radius);
text("Circumference of circle is "+ area, 250, 20);
// Text Image Radius
fill(0, 255, 0);
textAlign(CENTER);
textSize(5+radius);
text("Radius of circle is "+ radius, 250, 480);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น