74
Dasturi:
Uses Graph;
var
gd, gm: Integer;
Begin
gd:= 0; InitGraph(gd, gm, '');
Setcolor(yellow);
Circle(320,240,45);
Circle(320,240,60);
Circle(320,240,75);
Circle(320,240,90);
Readln; CloseGraph;
end.
Natijaning ekrandagi ko‘rinishi:
Ellipse(X,Y,BB,OB,XR,YR) protsedurasi markazi (X,Y) nuqtada,
x va
y
o‘qlari bo‘yicha radiuslari mos ravishda XR va YR
ga teng ellipsning BB bur-
chagidan OB burchagigacha bo‘lgan yoyini chizadi. Burchak gradus o‘lchov birl-
igida beriladi.
XR=YR bo‘lsa,
aylananing yoyi chizi
Rectangle(X1,Y1,X2,Y2) protsedurasi ekranda yuqori chap burchagi (X1,Y1)
koordinatali va quyi o‘ng burchagi (X2,Y2) koordinatali nuqtada bo‘lgan to‘g‘ri
to‘rtburchak chizadi.
۩
. Markazi (300,200) koordinatali nuqtada, x o‘qi bo‘yicha radiusi 100, y o‘qi
bo‘yicha radiusi 50, boshlang‘ich burchagi 0
o
, oxirgi burchagi 135
o
bo‘lgan qizil
rangli yoy hamda chap yuqori va o‘ng
pastki uchlari,
mos ravishda, (10,220) va
(300,400) koordinatali nuqtalarda bo‘lgan ko‘k rangli to‘g‘ri to‘rtburchak chizing.
Uses Graph;
Var gd, gm : Integer;
Begin
Gd:=0; InitGraph(gd,gm, ‘‘);
Setcolor(4);
Ellipse(300,200,0,135,100,50);
Setcolor(1);
Rectangle(10,220,300,400);
Readln; CloseGraph;
End.
DrawPoly(BS,KM) protsedurasi siniq chiziq chizadi. BS –
siniq chiziqning
sinish nuqtalari soni, KM – siniq chiziq sinish nuqtalarining koordinatalari beril-
gan massiv nomi. Agar siniq chiziq boshlang‘ich nuqtasining
koordinatasi bilan
oxirgi nuqtasining koordinatasi ustma-ust tushsa, yopiq soha – ko‘pburchak hosil
bo‘ladi.
Do'stlaringiz bilan baham: