|
-
Jul 12th, 2001, 12:22 AM
#1
Thread Starter
Member
parabolic graph
How do you draw a parabolic graph in a Picture object?
-
Jul 12th, 2001, 12:52 AM
#2
Thread Starter
Member
cont
Actually I want to do is drawing a graph between 2 points that will result as a parabolic graph
-
Jul 13th, 2001, 08:24 PM
#3
Frenzied Member
Be more specific.
Your question is too general to answer.
What is it you are trying to do?
Are you trying to display XY-Axes with scales and a plot of a parabola?
Are you just trying to display part of a parabola as one item in some graphic display?
Are you trying to do curve fitting using a parabola?
Do you know how to plot points in a Picture Box? Do you know what the scale mode property is?
Do you just need to know the equation of a parabola?
Might you be interested in second order curves in general instead of parabolas?
BTW: There are many possible parabolas through any two points. Three points determine a unique parabola.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Aug 11th, 2001, 09:04 PM
#4
-
Aug 11th, 2001, 09:18 PM
#5
PowerPoster
relatively simple..i think?
I dont think it is so simple. The shortest line between two points (ignoring all space/time stuff ) is going to be a straight line. As Guv said, any number of parabolic curves could contain the two points that u are referencing. I wonder if eida is talking about chart smoothing a la Excel charts?
Regards
Stuart
-
Sep 9th, 2001, 01:43 PM
#6
One way of writing a 'parabolic' graph equation is: y=x^2
(X squared)
But that doesn't mean it is obvious where the zeroes are...
Lets say that you want the graph to pass through the 2 points at: (-3, 4) and (7,4), then you would use the equation: y=i*(x+3)*(x-7)+4
The plus 4 raises the entire shape of the graph upwards by 4.
The x- and x+ parentheses define where the zeroes are (remember to reverse the signs before you put them into the equation).
i determines the flatness of the parabola. As is mentioned earlier there is actually an infinite number of parabolas that can pass through 2 points, but it it either the i value or a third point that is the defining entity.
-
Sep 16th, 2001, 10:10 PM
#7
RE: Parabola
Hello,
The general equation for one type of parabola is
Y^2=4*a*X
a is a constant (distance between focus and center of parabola).
fix a value of 'a' and then feed different values of Y into the equation to get the corresponding value of X.
obtain 10 points once you have done this scale these points to fit into the picture box control, and you get a parabola with the pointed side facing left and the open end to the right ...like this (
I think this should work.....
Thank you
Arun
-
Sep 17th, 2001, 04:05 PM
#8
I already made something who work with Sinus and it make with a timer the curve slowly ( and when you change the X variable in create the sinus more fast ) If you want to take a look I can give you the code.
-
Sep 18th, 2001, 05:32 AM
#9
Hi
Why not post the code here??
Appi
-
Sep 18th, 2001, 09:40 AM
#10
Add one picturebox : Picture1
Add one timer : Timer1
VB Code:
Option Explicit
Dim speeD
Dim gfDrawing As Integer
Dim gColor
Dim gWidth As Integer
Dim gfPoint As Integer
Dim X1 As Integer
Dim Y1 As Integer
Dim choice As Boolean
Dim abc As Integer
Dim save1 As Integer
Private Sub Form_Load()
Me.Width = 4000
Me.Height = 1500
Picture1.Top = 0
Picture1.Left = 0
Picture1.Width = 4000
Picture1.Height = 1500
Timer1.Interval = 10
gWidth = 2
gfDrawing = True
Picture1.DrawWidth = gWidth
choice = True
Picture1.CurrentX = 0
Picture1.CurrentY = 175
End Sub
Private Sub Timer1_Timer()
'Daok own code
If Picture1.CurrentY > Picture1.ScaleHeight Then
choice = False
End If
If Picture1.CurrentY < 0 Then
choice = True
End If
If choice = True Then
If gfDrawing Then
Picture1.DrawWidth = (gWidth)
'picture1.Line -(picture1.CurrentX + 8, picture1.CurrentY + abc), (gColor)
Picture1.Line -(Picture1.CurrentX + 8, abc), (gColor)
End If
End If
If choice = False Then
If gfDrawing Then
Picture1.DrawWidth = (gWidth)
'picture1.Line -(picture1.CurrentX + 8, picture1.CurrentY - abc), (gColor)
Picture1.Line -(Picture1.CurrentX + 8, abc), (gColor)
End If
End If
If Picture1.CurrentX > Picture1.ScaleWidth Then
save1 = Picture1.CurrentY
Picture1.Cls
Picture1.CurrentY = save1
End If
gColor = RGB(150, 200, 100)
speeD = 0.0048
abc = (Picture1.ScaleHeight / 2) * Cos(speeD * Picture1.CurrentX) + (Picture1.ScaleHeight / 2)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|