Search form

Melingkar

int ukuran = 400;
int separuh = ukuran / 2;
int jumlah = 12;

size(ukuran, ukuran);
background(#000000);
smooth();

int i;
for (i = 0; i < jumlah; i++) {
  float csudut = 2 * PI * i / jumlah;
  float ccos = cos(csudut);
  float csin = sin(csudut);  

  noStroke();
  fill(255, 255, 0, 90);
  ellipse(
    width/2 + 0.6 * ukuran/2 * ccos,
    height/2 + 0.6 * ukuran/2 * csin,
    0.15 * ukuran,
    0.15 * ukuran
  );

  stroke(#ffff00);
  strokeWeight(3);
  fill(255, 255, 0, 90);
  ellipse(
    width/2 + 0.6 * ukuran/2 * ccos,
    height/2 + 0.6 * ukuran/2 * csin,
    0.1 * ukuran,
    0.1 * ukuran
  );
  
  stroke(255, 0, 0, 80);
  strokeWeight(1);
  fill(255, 255, 0, 30);
  ellipse(
    width/2 + 1.1 * ukuran/2 * ccos,
    height/2 + 1.1 * ukuran/2 * csin,
    0.8 * ukuran,
    0.8 * ukuran
  );

  noStroke();
  fill(255, 255, 0, 80);
  ellipse(
    width/2 + 1.1 * ukuran/2 * ccos,
    height/2 + 1.1 * ukuran/2 * csin,
    0.2 * ukuran,
    0.2 * ukuran
  );

  stroke(255, 255, 0, 150);
  strokeWeight(5);
  line(
    width/2,
    height/2,
    width/2 + 0.5 * ukuran/2 * ccos,
    height/2 + 0.5 * ukuran/2 * csin
  );
  
  stroke(255, 0, 0, 80);
  strokeWeight(1);
  line(
    width/2,
    height/2,
    width/2 + 1.5 * ukuran/2 * ccos,
    height/2 + 1.5 * ukuran/2 * csin
  );
}

Beri tanggapan