void setup()
{
size(500,500);
}
float cir = 0;
float area = 0;
void draw()
{
draw_Calculate(7.00,cir,area);
}
void draw_Calculate(float rad,float cir,float area )
{
background(0);
cir = 2 * PI * rad ;
area = PI * sq(rad) ;
textSize(20);
text("Radius ="+ nfc(rad,3),250,150);
text("Circumference ="+ nfc(cir,3),250,250);
text("Area ="+ nfc(area,3),250,350);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น