## 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

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

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.

DannyBoy

Posts: 1160
Joined: Fri Feb 13, 2004 12:56 pm
Location: In the Billiard Room with the Lead Pipe

Prashant Maskara

### Re: Thanks

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

?!? How can a post be blank?
If it wasn't for C, we would be using BASI, PASAL and OBOL.

tomcant

Posts: 3101
Joined: Tue Sep 23, 2003 1:56 am
Location: Colchester, UK

Beer Hunter

Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

coolian

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

In all seriousness, just type a few spaces and hit Submit.

Beer Hunter

Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

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.

tomcant

Posts: 3101
Joined: Tue Sep 23, 2003 1:56 am
Location: Colchester, UK

Please get back to the question guys
Prashant

Prashant wrote:Please get back to the question guys
Did you look at the link I posted?
There are lots of coded examples of how to implement various root-finding algorithms.

DannyBoy

Posts: 1160
Joined: Fri Feb 13, 2004 12:56 pm
Location: In the Billiard Room with the Lead Pipe

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(){}`

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 3 guests