Find point of intersection of 2 curves

Discuss all kind of algorithms and data structures from their mathematical and programming sides.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Find point of intersection of 2 curves

Postby Prashant » Wed Jan 12, 2005 6:42 am

I need a function to find out all the points of intersection of two functions in x and y. (over a range)
The function can only be linear, quadratic, log or mod(%)
Can anyone please help me come up with a solution.
The algorithm I have will be extremely hard to implement and will cost a lot in terms of computing time.
Prashant
 

Postby DannyBoy » Wed Jan 12, 2005 12:01 pm

I guess you are using a root-finding algorithm to find the roots of f(x,y)-g(x,y) (i.e. the points where f(x,y)=g(x,y) so they intersect), right? Some implementations of root-finding algorithms can be founds here (section 9) for C.
User avatar
DannyBoy
 
Posts: 1160
Joined: Fri Feb 13, 2004 12:56 pm
Location: In the Billiard Room with the Lead Pipe

Thanks

Postby Prashant Maskara » Thu Jan 13, 2005 5:59 am

Prashant Maskara
 

Re: Thanks

Postby tomcant » Thu Jan 13, 2005 11:01 am

[quote="Prashant Maskara"][/quote]

?!? How can a post be blank?
If it wasn't for C, we would be using BASI, PASAL and OBOL.
User avatar
tomcant
 
Posts: 3101
Joined: Tue Sep 23, 2003 1:56 am
Location: Colchester, UK

Postby Beer Hunter » Fri Jan 14, 2005 12:36 am

User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby coolian » Fri Jan 14, 2005 1:58 am

User avatar
coolian
 
Posts: 1012
Joined: Wed Oct 29, 2003 6:17 pm
Location: USA

Postby Beer Hunter » Fri Jan 14, 2005 4:15 am

In all seriousness, just type a few spaces and hit Submit.
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby tomcant » Fri Jan 14, 2005 12:17 pm

Beer Hunter wrote:In all seriousness, just type a few spaces and hit Submit.


Ahhh, I see. :)
If it wasn't for C, we would be using BASI, PASAL and OBOL.
User avatar
tomcant
 
Posts: 3101
Joined: Tue Sep 23, 2003 1:56 am
Location: Colchester, UK

Postby Prashant » Wed Jan 19, 2005 3:05 am

Please get back to the question guys
Prashant
 

Postby DannyBoy » Wed Jan 19, 2005 6:11 am

Prashant wrote:Please get back to the question guys
Did you look at the link I posted? :roll:
There are lots of coded examples of how to implement various root-finding algorithms.
User avatar
DannyBoy
 
Posts: 1160
Joined: Fri Feb 13, 2004 12:56 pm
Location: In the Billiard Room with the Lead Pipe

Postby Darobat » Wed Jan 19, 2005 4:41 pm

Solve a two variable equation. When x1 = x2 and y1 = y2 then the curves are intersecting there.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm


Return to Algorithms & Data Structures

Who is online

Users browsing this forum: No registered users and 1 guest

cron