16 Nisan 2010 Cuma
Cokgen Koselelerini Elipslemece
PROGRAM COKGENLER;
USES CRT, DOS, GRAPH, PRINTER;
CONST PI=22/7;
VAR GRAFIKSURUCU, GRAFIKKONUMU,I,J,N,K:INTEGER;
ACI:REAL;
COKGENXY: ARRAY[1..100] OF INTEGER;
PROCEDURE COKGEN (X,Y,L :INTEGER);
BEGIN
N:=34;
ACI:=PI*((360/N)/180);
FOR I:=1 TO N+1 DO
BEGIN
COKGENXY[2*I-1]:= X+ROUND(L*COS(ACI*I));
COKGENXY[2*I]:= Y+ROUND(L*SIN(ACI*I));
END;
SETFILLSTYLE (13,13);
{FILLPOLY (N,ALTIGENXY);}
FOR J:=1 TO N DO
BEGIN
{CIRCLE (COKGENXY[2*J-1],COKGENXY[2*J],40); }
{LINE (COKGENXY[2*J-1],COKGENXY[2*J],X,Y);}
ELLIPSE (COKGENXY[2*J-1],COKGENXY[2*J],0,360,X,Y);
END;
FOR K:=1 TO N DO
BEGIN
LINE (COKGENXY[2*K-1],COKGENXY[2*K],COKGENXY[2*(K+1)-1],COKGENXY[2*(K+1)]);
END;
END;
BEGIN
GRAFIKSURUCU:=DETECT;
INITGRAPH (GRAFIKSURUCU, GRAFIKKONUMU,'C:\PROGRA~1\TP\BGI');
IF GRAPHRESULT<>GROK THEN HALT(1);
CLEARDEVICE;
COKGEN(GETMAXX DIV 2, 250, 200);
READLN;
CLOSEGRAPH;
END.
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder