Tam giác nội tiếp đường tròn

đăng 02:40, 27 thg 3, 2012 bởi Thanh Vũ Nguyễn   [ đã cập nhật 02:40, 27 thg 3, 2012 ]
program DoHoa;
uses graph;
procedure KhoiDong;
var
 grDriver: Integer;
 grMode: Integer;
 ErrCode: Integer;
begin
 grDriver := Detect;
 InitGraph(grDriver, grMode,' ');
 ErrCode := GraphResult;
 if ErrCode <> grOk then
 begin  { Do graphics }
   Writeln('Graphics error:', GraphErrorMsg(ErrCode));
   halt(1);
 end;
end;
{-----------------------------}
{      CHUONG TRINH CHINH     }
{-----------------------------}
const a = 300;
var
  x0,y0,R,x1,y1,x2,y2,x3,y3: integer;
BEGIN
  KhoiDong;
  x0:= GetMaxX div 2;
  y0:= GetMaxY div 2;
  R := round((a/Cos(30*Pi/180)/2));
  setcolor(yellow);
  Circle(x0,y0,R);
  x1 := x0;
  y1 := y0 - R;
  x2 := x0 - a div 2;
  y2 := y0 + R div 2;
  Line(x1,y1,x2,y2);
  x3 := x0 + a div 2;
  y3 := y0 + R div 2;
  Line(x1,y1,x3,y3);
  Line(x2,y2,x3,y3);
  readln;
  closegraph;
END.
ċ
MAUDOHOA.PAS
(1k)
Thanh Vũ Nguyễn,
02:40, 27 thg 3, 2012
Comments