 DevX Home Today's Headlines   Articles Archive   Tip Bank   Forums

# Thread: SOS:How to solve point of intersection on two curves.

1. Registered User
Join Date
Sep 2004
Posts
96

## SOS:How to solve point of intersection on two curves.

Hi,I want to seek the point of intersection on Line(y=-k*x) and parabola(x*x=4*y).But it is failure.My code:

Sub DeterminP(tx As Double, ty As Double)
Dim x As double, y As double
For x = 0.1 To 3.8 Step 2 ^ -12
y = -tx / ty * x
If round(y,3) = Round(x * x / 4, 3) Then
By = y: Bx = x:Exit for
End If
Next x
End Sub

Help for me! Thanks a lot.  Reply With Quote

2. That is not the way to solve a discreet equation, it will never work.

Well, this is not really a VB question.
There are many methods that you can use instead, you need a good book or manual of basic Numerical Analysis 101, search for "Root finding"
http://en.wikipedia.org/wiki/Root-finding_algorithm

For example, take a look at the Secant Method (a derivative of the Newton method), it is fairly easy to implement:
http://en.wikipedia.org/wiki/Secant_method  Reply With Quote

#### Posting Permissions

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