Re: Finding the intersect of two curves
- To: mathgroup at smc.vnet.net
- Subject: [mg30202] Re: [mg30179] Finding the intersect of two curves
- From: Hugh Goyder <goyder at rmcs.cranfield.ac.uk>
- Date: Thu, 2 Aug 2001 03:15:57 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
At 02:19 01/08/01 -0400, you wrote: >Hello there. > >I was wondering if there is any way to find the intersection of two curves >without knowing the equation of one of them. > >For example, I have the following curves: > >ImplicitPlot[function[x,y] == constant, {x, xmin, xmax}, {y, ymin, ymax}] > >function[x] == constant > > >The curve generated by Implicit Plot does not have an explicit equation. Is >it still possible to find the point where these two curves intersect? > >Any help would be greatly appreciated. > >Sincerely, > >Catherine Neish >cdneish at physics.ubc.ca > > > > > Catherine, Here are two implicit equations. One is an ellipse the other is just complicated. eqns = {x^2 + 2 y^2 == 3, (x - 1)^2 + 2y^3 == 2} ImplicitPlot will plot these as you have discovered. ImplicitPlot[eqns, {x, -4, 4}, {y, -3, 3}] In this case Solve will give you solutions for their intersection sol = Solve[eqns, {x, y}] There are 6 solutions 4 of which are non-physical complex values. The coordinates are just horrid and it is better looking at the numbers using sol//N. The result from Solve is a bit lucky. I think I am correct in saying that you will only get solutions from Solve if the equations are polynomials or similar. For more complicated equations FindRoot is the correct approach. FindRoot[eqns, {x, 2}, {y, 0.5}] will give you one intersection. The disadvantage is that you have to give starting points (in this case {2,0.5}). So you may have to get approximate values from the ImplicitPlot curves. You do this by clicking the graphic and then pressing Control while moving the mouse around, the values appear in the window border. Regards Hugh Goyder