Results 1 to 2 of 2

Thread: create a curve from an equation (EX. y=e^x)

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2

    Question

    How can I create a curve from an equation? I would like it to be displayed as a line and not a series of points. Kind of like a treadline. This is for a school project where I'm trying to generate a series of lines based on engineering equations. Thanks!

  2. #2
    Lively Member
    Join Date
    May 2000
    Posts
    84
    Am I right in assuming that you are simply looping through the x variables and ploting the points?

    Code:
    'creates dots
    For X=0 to 100
      Y=Exp(X)
      Picture1.pset(X, Picture1.Height-Y), vbBlack
    Next X
    
    'creates lines (not smooth)
    Picture1.PSet (0, Picture1.Height), vbBlack
    For X = 0 To 10
      Y = Exp(X)
      Picture1.Line -(X * 10, Picture1.Height - Y)
    Next X
    
    'creates lines (smooth)  You have to loop for all x's and 
    y's
    
    For X = 0 To Picture1.Width / 10
      Y = Exp(X)
      Picture1.PSet (X * 10, Picture1.Height - Y), vbBlack
    Next X
    
    For Y = 1 To Picture1.Height
      X = 10 * Log(Y)
      Picture1.PSet (X, Picture1.Height - Y), vbBlack
    Next

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