SieuHoTro.Com
 
Home My Account Register Domain Transfer Domain Contact Us Whois Documentation
 
Forum Home Forum Home > Information Technology > The programming language > Turbo Pascal,Turbo C
  New Posts New Posts RSS Feed: Vẽ đồ thị hình sin
  FAQ FAQ  Forum Search   Register Register  Login Login
If this is your first visit, be sure to check out theForum by clicking the link above. You may have toregister before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
ASG Vietnam

Vẽ đồ thị hình sin

 Post Reply Post Reply
Author
Poster View Drop Down
Guest
Guest
Avatar

Joined: 23 January 2008
Online Status: Offline
Posts: 378
  Quote Poster Quote  Post ReplyReply Direct Link To This Post Topic: Vẽ đồ thị hình sin
    Posted: 21 August 2008 at 20:00

PROGRAM  VE_DO_THI_HAM_SO_SIN;
USES
 CRT, GRAPH;
 VAR
            I,M1,M2,dvx,dvy:integer;
            Device,Mode,X0,Y0,P,Q:integer;
            Nr: String;
 BEGIN
   ClrScr;
   InitGraph(Device,Mode,'C:\tp70\bgi');
 
   If GraphResult<>0 then
       Begin
          Write('Loi do hoa! ', GraphErrorMsg(GraphResult) );
          Exit;
       End;
          m1:=GetMaxX; m2:=GetMaxY;
          dvx:=64;{ m1 div 10;}
          dvy:=48;{  m2 div 10;}
          x0:= 2* dvx;
          y0:= 4* dvy ;
              { Ve 2 truc toa do }
          Line (dvx,y0,9*dvx,y0);   { Truc Ox}
          Line (x0,dvy,x0,7*dvy);   { Truc Oy}
 
                                                { VÏ c¸c v¹ch chia ®¬n vÞ trªn trôc Ox}
          for i:=1 TO 6 DO
             LINE (X0+Dvx*I, Y0-2, X0+Dvx*I, Y0+2);
 
          for i:=1 TO 6 DO          { ®¸nh sè trªn trôc Ox}
             begin
                Moveto(x0+dvx*i-3, y0+12);          { lïi 3 ®Ó ch÷ sè ®«Ý xøng víi v¹ch}
                Str(i,Nr);
                outtext(Nr);
             end;
                Moveto(x0+dvx*7-13, y0-12);
                outtext('x');
                                                { VÏ c¸c v¹ch chia ®¬n vÞ trªn trôc  Oy}
          for i:=2 TO 6 DO
             LINE (X0-2, dvy*i, X0+2, dvy*i);
                                                { ®¸nh sè trªn trôc Oy}
          for i:=-2 to 2 do
             Begin
              Moveto(x0-40,y0-i*dvy-3);
              Str((i* 0.5):3:1,Nr);
              If i<0 then Outtext(Nr) else if i>0 then Outtext(' '+Nr);
             End;
          Moveto(x0-10,y0-3*dvy+5);  outtext('Y');
 
                 { VÏ ®å thÞ hµm sè SIN víi hÖ sè tû lÖ an-pha = PI/2 dvx, be-ta=2dvy  }
 
          for i:=0 to 7*dvx do
             PutPixel (x0+i,y0-trunc(2*dvy*sin(i*pi/(2*dvx)) ),yellow );
 
          Moveto(250, 350);
          Outtext(' Do thi ham so Y = SIN(X)');
          readln;
          CloseGraph;
  END.

  Share Topic     
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 2.062 seconds.
[Free Express Edition]
Copyright ©2001-2009 Web Wiz
Support: raovatphanmem Support: Info hanoi software
Online(s): 235.
Visitors Counter:40279281, AVERAGE/day(3894) is: 10344
Begin count is day 02/16/2009

You are browsing this site with: CCBot/2.0 (https://commoncrawl.org/faq/)
Your IP address is: 18.210.22.132
The DNS lookup of the IP address is: 18.210.22.132
The method used to call the page: GET
The server's domain name: sieuhotro.com
The link
BaoKyNam Viêm gan b Thẩm mỹ viện Hoa Kỳ