dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

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

  1. #1
    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.
    xuliangchu

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    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
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. How to draw a intersection point on two cures?
    By liangchu in forum VB Classic
    Replies: 2
    Last Post: 03-08-2010, 05:53 PM
  2. Replies: 4
    Last Post: 04-22-2009, 05:38 PM
  3. vb.net point of intersection
    By noobsaibot in forum .NET
    Replies: 5
    Last Post: 09-16-2007, 09:01 PM
  4. already defined error
    By rssmps in forum C++
    Replies: 6
    Last Post: 05-31-2006, 05:07 PM
  5. Intersection pt. of 2 curves
    By luan_ngo in forum VB Classic
    Replies: 1
    Last Post: 05-09-2006, 01:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center