15,877,168 members
See more: , +
Hi All

I am drawing linear and rational function in canvas.I have 2 arrays of points for linear and rational respectively. my requirement is to find the intersection of this two equation. since we dont have static formula for this to find intersection.please refer me some code in any tagged languages

Posted
nv3 21-Aug-14 11:47am
If you only know that the second function is "rational" then there is no general solution. If the second function is a polynomial, then things are better and you can recover the closed form (formula) of the function if you have enough points.

For the general case, just determine for every neighboring pair of points of your rational function if the linear function intersects in this interval. This is easy as it is only determining the intersection of two lines. If yes, you have found one intersection of the two functions; there may be several.

Ready made code: You probably won't find any. So you will have to program a couple of lines by yourself.