Results 1 to 7 of 7

Thread: drawing the function graphic

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2011
    Posts
    53

    drawing the function graphic

    Hi friends,

    I want to ask a question about drawing a graphic

    these are my code

    vb Code:
    1. Option Explicit
    2.  
    3. Const i3 As Integer = 1
    4. Const i2 As Integer = 2
    5. Const i1 As Integer = 1
    6. Const xmin As Integer = -10
    7. Const xmax As Integer = 10
    8. Const ymin As Integer = 0
    9. Const ymax As Integer = 121
    10. Const N As Integer = 20
    11.  
    12.  
    13.  
    14.  
    15. Private Sub Form_Load()
    16. Dim i As Integer
    17. Dim A As Double
    18.  
    19.  
    20.     Scale (xmin, ymax)-(xmax, ymin)
    21.     Line (xmin, 0)-(xmax, 0)
    22.     Line (0, ymin)-(0, ymax)
    23.     PSet (xmin, Pol(xmin))
    24.    
    25.         For i = xmin To xmax Step (xmax - xmin) / N
    26.             A = Pol(i)
    27.             Line -(i, A)
    28.             Circle (i, A), 0.005
    29.         Next
    30.        
    31.            
    32. End Sub
    33.  
    34. Function Pol(x As Integer) As Double
    35.  Dim y As Double
    36.     y = i3 * x * x + i2 * x + i1
    37.     Pol = y
    38.    
    39. End Function


    This is the graphic which the programme drew




    This is what I want





    What should I do?


    Edit: If you also say how I can make the program draw the graphic below, it will be awesome






    I chose x1,y1 randomly to tell what I want to make

    Thanks
    Last edited by _MeRKeZ_; Jan 7th, 2012 at 06:21 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width