MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: More about ellipse and circle intersection

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38437] Re: More about ellipse and circle intersection
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Sun, 15 Dec 2002 02:10:05 -0500 (EST)
  • References: <ateqoe$944$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Tomas Garza <tgarza01 at prodigy.net.mx> wrote:
> In a previous message  Re: Ellipse and circle intersection, I
> hinted that Solve would not always give the right answer when trying to
> obtain the intersections of an ellipse and a circle. Two comments were
> received (Tom Burton and Rasmus Debitsch) suggesting that there was
> nothing wrong. Still, definitely there is, as shown in the example
> below. The situation is as follows:
>
> In[1]:=
> ellipse = (x - c)^2/b^2 + (y - d)^2/a^2 == 1;
> circ = x^2 + y^2 == 1;
> sol = Solve[{ellipse, circ}, {x, y}];
>
> The solution comes out all right in terms of the four parameters a, b,
> c, d. The following sets of values for the parametrs are tested:
>
> In[2]:=
> example1Tom = {a -> 1.2, b -> 1.3, c -> 0.2, d -> 0.3};
> example2Tom = {a -> 1.2, b -> 1.3, c -> 1.2, d -> 1.3};
> example3Rasmus = {a -> 2, b -> 1, c -> 1, d -> 1};
> example4Tomas = {a -> 0.25, b -> 0.75, c -> 0.5, d -> 0};
>
> (the first two come from Tom Burton, the third one from Rasmus, and the
> fourth one is mine). Numerical solutions are then obtained for each set:
>
> In[3]:=
> sol1=sol/.example1Tom;
> In[4]:=
> sol2=sol/.example2Tom;
> In[5]:=
> sol3=sol/.example3Rasmus//N;
> In[6]:=
> sol4=sol/.example4Tomas;
>
> In each of the first three cases the correct intersections (as observed
> graphically through ImplicitPlot) are found, in addition to some complex
> points. However, the fourth case fails to give a correct answer,

You are correct.

> This points to a weird behavior of Solve. I hope someone will
> come forward with some explanation.

I do too! I find this behavior to be very disturbing. (Am I overlooking
some obvious "reason" for such behavior?)

It might be noted, for some _slight_ comfort, that at least if we first
set a = 0.25, b = 0.75, c = 0.5, d = 0, then Solve[{ellipse, circ}, {x, y}]
will give us, correctly it seems,

{{y -> -0.19168849014437106, x -> 0.9814558180306291},
 {y -> 0. - 0.47354458845374703*I, x -> -1.106455818030629},
 {y -> 0. + 0.47354458845374703*I, x -> -1.106455818030629},
 {y -> 0.19168849014437106, x -> 0.9814558180306291}}

As a trivial aside:
Just as a curiosity, why does Mathematica see fit to reverse x and y?
In other words, since we had asked for {x, y}, why does Mathematica report
the results in the form {y -> , x -> }, rather than {x -> , y -> }?

But back to Tomas' observation of incorrect behavior of Solve:
I crave an explanation!

-- 
Regards,
  David Cantrell


  • Prev by Date: Determining the size of text in graphics
  • Next by Date: JLink problem
  • Previous by thread: Re: Re: More about ellipse and circle intersection
  • Next by thread: AW: Pasting tables into Excel