Results 1 to 2 of 2

Thread: sine and cosine curves

  1. #1
    Guest
    Hi all,

    i was wondering, how do i draw sine and cosine curves?

    thanx

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Here's a start

    Code:
    Option Explicit
    Dim pi As Double
    
    Private Sub Command1_Click()
      Dim x As Double
      Dim y As Double
      For x = 0 To Form1.ScaleWidth Step 0.001
        Form1.PSet (x, 2 + Sin(x)), QBColor(2)
        Form1.PSet (x, 2 + Cos(x)), QBColor(12)
      Next
    End Sub
    
    Private Sub Form_Load()
      pi = Atn(1) * 4
      Form1.ScaleWidth = 4 * pi
      Form1.ScaleHeight = 4
    End Sub
    Cheers
    Paul Lewis

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