?
Solved

graphing a function

Posted on 2003-03-25
8
Medium Priority
?
154 Views
Last Modified: 2010-05-01
I am not sure if this has already been answered. I have been looking but i havent found an answer i feel helps me.

I want to generate a list of plot points and plot them continously. or i want to be able to plot the sin function. either would be sufficient since i could just calculate the list points.

These points or functions will be created at run time.
0
Comment
Question by:seanreynolds
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8206033
where do you want to draw them?
0
 
LVL 2

Expert Comment

by:Jacamar
ID: 8206145
Make a new application and add one command button, and one picturebox of whatever size you want it to be.  Paste this code.

Private Sub Form_Load()
Picture1.Scale (-1, 1.1)-(10, -1.1)
Picture1.Line (0, 1)-(0, -1)
Picture1.Line (0, 0)-(10, 0)
End Sub

Private Sub Command1_Click()
Dim sgPi As Single
Dim sgX(1 To 1000) As Single
Dim sgY(1 To 1000) As Single

sgPi = Atn(1) * 4

For inI = 1 To 1000
sgX(inI) = 10 / 1000 * inI
sgY(inI) = Sin(sgX(inI))
Next inI

For inI = 1 To 999
Picture1.Line (sgX(inI), sgY(inI))-(sgX(inI + 1), sgY(inI + 1))
Picture1.Refresh
Next inI
End Sub
0
 

Author Comment

by:seanreynolds
ID: 8206153
i would like to draw my graph in a form. just a regular form. I dont mind using anything i have to. i just want to run a program click a buton and see a sin graph with any x i put in.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
Jacamar earned 200 total points
ID: 8206269
You can do the same thing I did above except use a form.  in te form load, add some code like so:

Form1.Height = 4000
Form1.Width = 8000

If you enter an X, it should return a Y, not a graph.  Just one point.
0
 

Author Comment

by:seanreynolds
ID: 8206772
to be honest your code didnt work. but you did enlighten me as to using line for graphing... i didnt know pictureboxes had a line function. so i figured it out anyway. but thanks for showing me the line function.
0
 
LVL 2

Expert Comment

by:Jacamar
ID: 8207488
Funny......I tried it on my machine before I gave it to you.  What didn't work about it?
0
 

Expert Comment

by:CleanupPing
ID: 8531618
Hi seanreynolds,
This old question (QID 20562919) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9441058
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Jacamar's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question