16 Nisan 2010 Cuma

ALTIGEN-Uzun yoldan


program dizmece;
uses dos,crt,graph,printer;
const pi = 22/7;
var gs, gm, i, X, Y, k,j:integer;
altigen: ARRAY[1..12] OF integer;
aci: real;

procedure altigenciz (X,Y,L:word);

begin
aci:= pi * (60/180);
altigen [1] := X + round (L* cos(aci)); {X1}
altigen [2] := Y + round(L* sin(aci));
altigen [3] := X + round (L* cos(aci*2));{X2}
altigen [4] := Y + round(L* sin(aci*2));
altigen [5] :=X + round (L* cos(aci*3)) ;{X3}
altigen [6]:=Y + round(L* sin(aci*3)) ;
altigen [7] :=X + round (L* cos(aci*4)) ;{X4}
altigen [8] :=Y + round(L* sin(aci*4)) ;
altigen [9] :=X + round (L* cos(aci*5)) ;{X5}
altigen [10] :=Y + round(L* sin(aci*5)) ;
altigen [11] :=X + round (L* cos(aci*6));{X6}
altigen [12] :=Y + round(L* sin(aci*6)) ;


SETFILLSTYLE (7,11);
SETCOLOR(12);
FILLPOLY(6,altigen);

end;

begin
{{bu kısım sadece deneme amaçlı}
aci:= pi * (60/180);
writeln ('sin60:', sin(aci):8:2);
writeln ('cos60:', cos(aci):8:2);
readln;}

gs:=detect;
initgraph(gs,gm, 'c:\tp\bgi');
if graphresult <>grok then halt(1);
cleardevice;

altigenciz(200,200,100);

readln;
closegraph;
end.

Hiç yorum yok:

Yorum Gönder