linkedin facebook linkedin facebook nod32

PaskalABC da nuqtalar va to’g’ri to’rtburchaklar bilan ishlash

Muallif: Faxriddinov Sh.

Qo`shilgan sana: 2015-01-21

PaskalABC da nuqtalar va to’g’ri to’rtburchaklar bilan ishlash

9.1. Point=record  x,y: integer; end; Rect=record Left,Top,Right,Bottom: integer; end;
program grafik9_1
//Point=record  x,y: integer; end; Rect=record Left,Top,Right,Bottom: integer; end;
 // PointF(x,y: integer): Point;
 //nuqtaning x va y koordinatalari bo'yicha Point turidagi yozuvni qaytaradi;
uses graphABC,pointRect;
var x,y:integer;
PointF(100,100)
End.

9.2. EqualRect(r1,r2: Rect): boolean;
program grafik9_2;
//  EqualRect(r1,r2: Rect): boolean;
//r1 va r2 to'g'ri to'rtburchaklar teng bo'lsa TRUE aks
//holda FALSE ni qaytaradi
uses graphABC, PointRect;
var r1,r2: rect;
i:integer;
procedure drawrect(r0:rect);
begin
rectangle(r0.left,r0.top,r0.right,r0.bottom);
end;
begin
r1:=rectF(100,50,300,200);
r2:=rectF(250,100,450,250);
drawrect(r1);drawrect(r2);setfontsize(12);if equalrect(r1,r2)
then textout(100,270,'r1 va r2 bir xil.')  else textout(100,270,'r1 va r2 har xil.');
end.

9.3. IntersectRect(r1,r2: Rect): boolean;
program grafik9_5;
// IntersectRect(r1,r2: Rect): boolean;
//r1 va r2 to'g'ri to'rtburchaklar kesishmasi bo'sh bo'lmasa TRUE
//aks holda FALSE ni qaytaradi
uses graphABC, PointRect;
var r1,r2: rect;
i:integer;
procedure drawrect(r0:rect);
begin
rectangle(r0.left,r0.top,r0.right,r0.bottom);
end;
begin
r1:=rectF(100,50,300,200);
r2:=rectF(250,100,450,250);
drawrect(r1);
drawrect(r2);
setfontsize(12);
if intersectrect(r1,r2)
then textout(100,270,'r1 va r2 kesishadi.')
else textout(100,270,'r1 va r2 kesishmaydi.');
end.

9.4. OffsetRect(var r: Rect; x,y: integer);
program grafik9_6;
// OffsetRect(var r: Rect; x,y: integer);
//to'g'ri to'rtburchakni (x,y) masofaga suradi
uses graphABC, PointRect;
var r: rect;
i:integer;
procedure drawrect(r0:rect);
begin
rectangle(r0.left,r0.top,r0.right,r0.bottom);
end;
begin
r:=rectF(100,50,300,200);
drawrect(r);
for i:=0 to 15 do
begin
offsetrect(r,15,5);
drawrect(r);
end;
end.

1624 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений