“Processing Draw Circle” Kode Jawaban

Processing Draw Circle

circle(x, y, diameter)
Puzzled Peacock

Processing Draw Circle


void setup() 
{
  size(400, 400);
  background(255,255,255);
}

void draw()
{  
  float step=(2*PI)/120;
  int posX = width/2;
  int posY = height/2;
  float radius = 100;
  int xOld=0, yOld=0;
  for(float theta=0;theta<=(2*PI)+step;theta+=step)
  {
    stroke(0,0,255);
    int x = int(radius*sin(theta) + posX);
    int y = int(radius*cos(theta) + posY);
    if(theta>0)
    {
      line(x,y,xOld,yOld);
    }
    xOld = x;
    yOld = y;
  }

}

Average Anteater

Jawaban yang mirip dengan “Processing Draw Circle”

Pertanyaan yang mirip dengan “Processing Draw Circle”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya