Membuat Garis Threeleaf di delphi 7
Baca juga : Membuat Garis Sepiral di delphi 7
Berikut Langka-langkah membuat Garis Threeleaf
1. Tambahkan 1 Button
2. lalu ketikan coding di bawah ini dengan cara klik 2 kali tombol Button
var r,d,c,x,y,theta,thetf: real;
a,xc,yc:integer;
begin
a:=100;xc:=300;yc:=200;
thetf:=0.0;
d:=2*PI;
theta:=d;
c:=1/a;
while (thetf<theta) do
begin
r:=a*cos(3*thetf);
x:=r*cos(thetf);
y:=-r*sin(thetf);
canvas.pixels[trunc(xc+x),trunc(yc+y)]:=clblue;
thetf:=thetf+c;
end;
end;
end.
Demikian Cara membuat garis Threeleaf. selamat mencoba semoga berhasil.
.png)
0 Comments:
Posting Komentar